4

For a project i am looking for a simple database which is written in C (or C++) for a cross platform aplication. After looking into HamsterDB (which looked promissing) i had found out, that it is dependen on boost on windows. So the alternative should not relies on STL or other libraries as the Application will be run on different Eco Systems (like arduino,symbian,android,windows) and compiled on diferent IDEs.

It will store up ton 20mil keys(but usualy below 50k keys), IO will be low.

Therefor it should be as clean C (or C++) as possible.

Can somebody show me something which will fullfill this, ready made?

alfetta
  • 103
  • 2
  • 9
  • have you looked at [sqlite](http://www.sqlite.org/) – amdixon Nov 14 '13 at 10:22
  • is the boost dependency a problem? For Windows you can download precompiled libraries, and even precompiled dependencies are available in case you want to compile the hamsterdb library: https://github.com/cruppstahl/hamsterdb-alien. I do not know about Arduino/Symbian/Android - is boost an issue here? – cruppstahl Nov 15 '13 at 06:02
  • sqlite, yes, probably the easiest to compile/port on the desired platforms (thread and mutex also used) but surely a small overkill for the desired need – alfetta Nov 17 '13 at 12:08
  • hamsterDB, as far we will be able to compile the db on windows, we would like to keep the DB platform independent. An try to compile hamsterDB under Mosync (our IDE for android/ios/symbian IDE) looks for us as a lot of work. – alfetta Nov 17 '13 at 12:11

2 Answers2

2

LevelDB is what you're looking for. It's written in C++ but C functions are available as well.

LevelDB is a fast key-value storage library written at Google that provides
an ordered mapping from string keys to string values.
cutsoy
  • 10,127
  • 4
  • 40
  • 57
  • After a brief check of LevelDB, we will be probably unable to compile it without thread and mutex support on several desired machines. I assume that LevelDB performace is based on some of this points and we would like to use them, but we cannot warranty to have them on all platforms and would like to keep one codebase for all. Even compiling under Windows/MinGW was not easy. – alfetta Nov 17 '13 at 10:27
  • What platform - which runs applications requiring a database - has no threading support? You sound at bit weird man. – Lothar Feb 07 '15 at 13:08
0

Looks like Berkeley DB is an option to you. Not sure about the embedded part (especially for arduino).

You can find a complete tutorial at standford's classes.

Aif
  • 11,015
  • 1
  • 30
  • 44
  • Checked BDB, surely a great solution, but again using sockets. This will be an nogo on some platforms. – alfetta Nov 17 '13 at 11:42