开发者

Data structure functioning like Database in C or C++

Is there a d开发者_如何学Cata structure which gives you functions of a database (like insert, update, delete etc)? For example:

  • create a struct like the database table
  • store data on it and query on it
  • selectively delete it

I know that with a hashtable you can do this (ex: uthash library). But as far as I know updating one column element only is not easy in a hash table.


Look at sqlite. Rather than a relational database system, it is essentially a connectionless, file-based database library that supports SQL. You link your program against it and it provides functions to perform SQL queries over data files.


Look At NoSQL itis The RMDBS used By FaceBook


Use C structs to represent rows of data and then trees (or maybe hashes) for indexes. There are a lot of little problems you will need to solve, specially in order to make all the operations efficient, but this forms the basis for an in-memory table.

For simple things, a tree structure may be enough.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜