1) you can use plists to build simply small type databases (dictionaries, arrays, strings, numbers and blobs (nsdata) are all supported, and they all serialize without additional work. The caveat is that these need to be loaded into memory for you to access (very bad once you start getting into 100s of records).
2) you can also use Berkeley DB (see man dbopen, btree, etc) - which is also included with OS X since the beginning of time. It supports hashtables, btrees, record-number-based storage, and persistent queues. You simply create the storage structure (you can mix and match the types of storage,operations,etc on the same application). The library provides strict ACID transaction semantics, and supports concurrency. Note this is not an SQL database or a db server. Performance is fairly good too, but not as good on OS X vs. Linux/Solaris. Still we are talking around 500K->millions of records reading per second depending on your machine. 1/10th of that for writing, which is not too shabby (and you’d be hard press to improve using your own code). The other plus, is that these are fairly standard apis, and thus portable. And because they are standard, you can access these files using not only C, but perl and other scripting languages.
if you don’t mind coding:
1) you can use plists to build simply small type databases (dictionaries, arrays, strings, numbers and blobs (nsdata) are all supported, and they all serialize without additional work. The caveat is that these need to be loaded into memory for you to access (very bad once you start getting into 100s of records).
2) you can also use Berkeley DB (see man dbopen, btree, etc) - which is also included with OS X since the beginning of time. It supports hashtables, btrees, record-number-based storage, and persistent queues. You simply create the storage structure (you can mix and match the types of storage,operations,etc on the same application). The library provides strict ACID transaction semantics, and supports concurrency. Note this is not an SQL database or a db server. Performance is fairly good too, but not as good on OS X vs. Linux/Solaris. Still we are talking around 500K->millions of records reading per second depending on your machine. 1/10th of that for writing, which is not too shabby (and you’d be hard press to improve using your own code). The other plus, is that these are fairly standard apis, and thus portable. And because they are standard, you can access these files using not only C, but perl and other scripting languages.