Friday, January 23, 2009

Using SQLite Database for Crackpot

Case for Database
There are several places where database can be useful in Crackpot. Storing and retrieving plans. Storing data from GUI for replay. Storing information for long term, learning etc. In summary, any place which is not in the critical performance path.

SQLite
The use of a database can simplify the work needed for storing and retrieving information. Some candidate databases are: BerkeleyDB, SQLite, MySQL, PostgresQL. Out of these, SQLite is a high performance and simple database with an open license. SQLite seems fit for our purposes.

In-memory databases
There are some databases which can be used to store and query information within the main memory (RAM). SQLite also supports in-memory databasing.

SQLite with C++
A good C++ wrapper for SQL in general is seems to be SOCI. Unfortunately using it for SQLite might need some work. But still seems to be a productive choice.

2 comments:

  1. I'd like to suggest Poco C++ which has better very similiar but better interface to SQLite, ODBC and MySQL. Poco is available under BSD license and backed by commercial support and a company of developers. Hence, it is better supported.

    Calling SQLite high performance is very misleading. SQLite has never been aimed for high performance. It rather is suitable for personal or small scale uses or for embedded devices (addressbook, Firefox data, etc).

    In-memory DB storage is quite a good idea implemented by SQLite.

    Just my 2 cents.
    Viet.

    ReplyDelete
  2. You also can use Nokia Qt C++ database driver for SQLite. Simply smooth and sweet! LGPL-licensed so no worries.

    ReplyDelete