Question

So I have an app which needs to read a lot of small data (e.g an app that processes lots of customer records).

Normally, for server systems that do this kind of stuff, you can use a database which handles a) caching most recently used data b) indexing them, and c) storing them for efficient retrieval from the file system.

Right now, for my app, I just have a std::map<> that maps data id into the data themselves which are pretty small (like 120 bytes each, or something close to that). The data id themselves are just mapped into the file system directly.

However, this kind of system does not handle unloading of data (if the memory starts to run out) or efficient storage of the data (granted, iOS uses flash storage, and so the OS should handle the caching), but yeah.

Are there libraries or something like that that can handle this kind of stuff? Or would I have to build my own caching system from scratch? Not too bothered with indexing, only a) caching/unloading and c) storing for efficient retrieval. I'm feeling wary on storing thousands (or potentially hundreds of thousands) of files onto the file system.

Was it helpful?

Solution

There is SQLite that can be used in iOS or use CoreData which is already available on the device

OTHER TIPS

Why don't you trust property list files and NSDictionary? They're exactly for this purpose.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top