data-persistence

Size Limitation of NSUserDefault?

我的梦境 提交于 2019-11-28 11:28:59
问题 Is there a size limit to NSUserDefaults? What is it? I'm afraid that such a limit can cause my app to crash. 回答1: No, there is no size limit to NSUserDefaults , aside from the storage capacity of the device itself. if you are storing a dynamic amount of variables, for example, you are recording time stamps every time the user presses a button, I would recommend implementing an SQL db. 来源: https://stackoverflow.com/questions/5698816/size-limitation-of-nsuserdefault

Disk based HashMap

时间秒杀一切 提交于 2019-11-27 01:17:45
Does Java have (or is there a library available) that allows me to have a disk based HashMap? It doesn't need to be atomic or anything, but it will be accessed via multiple threads and shouldn't crash if two are accessing the same element at the same time. Anyone know of anything? Either properties files or Berkeley DB might be what you're looking for. The java.util.Properties itself implements java.util.Map and provides methods to load from and store to a file. The Berkeley DB is often been recommended as a lightweight key-value pair datastore. Quartz MapDB MapDB provides concurrent TreeMap

Disk based HashMap

随声附和 提交于 2019-11-26 09:39:31
问题 Does Java have (or is there a library available) that allows me to have a disk based HashMap? It doesn\'t need to be atomic or anything, but it will be accessed via multiple threads and shouldn\'t crash if two are accessing the same element at the same time. Anyone know of anything? 回答1: Either properties files or Berkeley DB might be what you're looking for. The java.util.Properties itself implements java.util.Map and provides methods to load from and store to a file. The Berkeley DB is