Embedded relational db's
What options exist for application embedded databases?
I know of http://www.sqlite.org/, but I haven't investigated it in any detail yet. I'd like some experienced opinions on:
- When and where it is appropriate to employ such a relational database.
- What database transaction dialects exist, and what their strengths are.
References to any good articles on the subject would be useful as well. ;)
Many thanks..
Quote:Original post by dgrantkp
- When and where it is appropriate to employ such a relational database.
whenever there are strict hardware constraints (i.e. cpu/ram) and when there's hardly any forseeable need for a full-featured server-based solution.
Likewise, embedding a database engine in your app will significantly reduce the required setup and maintenance overhead, as you are decreasing external dependencies.
Also, by embedding your database natively into your app, you can theoretically improve security, as embedded databases usually do not feature server-based access to its data.
Basically, you'll really want to check out the sqlite site, as it features in-depth information about the strengths, weaknesses and application areas for embedded databases in general. Also, make sure to check out related wikipedia entries.
I've read up on the SQLite website now, it does appear very accessible. I will check out the wiki links next as you suggest, thanks for that.
I will add my interest is the potential of a database transaction dialect to simplify AI programming. AI benefits from assessing a data-rich environment from many different perspectives, and C++ is very poor at expressing the sort of database-sifting that SQL makes look very simple by comparison. (This expressivity is important to me because of numerous rewrites required during development to find a good solution.) What I don't have is the experience to understand the real applicability of a relational database like SQLite to this task.
I will add my interest is the potential of a database transaction dialect to simplify AI programming. AI benefits from assessing a data-rich environment from many different perspectives, and C++ is very poor at expressing the sort of database-sifting that SQL makes look very simple by comparison. (This expressivity is important to me because of numerous rewrites required during development to find a good solution.) What I don't have is the experience to understand the real applicability of a relational database like SQLite to this task.
i think microsoft's sql everywhere is worth mentioning. a relational db that fits on a floppy (if you can still find one :)). few dlls, native and managed interface.. runs on win.ce up to vista.
You may also want to look at Firebird. It is a pretty full featured database than can be deployed as a single dll with your application. It's free, open-source (very permissive license), and runs on just about any platform you want. I haven't done a lot with it, but it's worth looking at.
well, there are pretty powerful template-based database access layers available for C++, so that you can basically write pretty much standards-oriented SQL statements directly in your SQL code, this works without pre-processing, everything is done thru templates, so there are obviously some minor differences-apart from that it's however pretty intutive, and lends itself for further abstraction using scripting languages.
So, you may want to check out the liteSQL project (note *lite*SQL NOT SQLite!!) for further information:
http://litesql.sourceforge.net
For alternative solutions, you may want to check out the references collected in the boost wiki, as there's an up2date collection of SQL wrapper C++ libraries, because it is considered to eventually provide a boost-based solution for providing SQL access (and possibly later on also SQL databases).
So, you may want to check out the liteSQL project (note *lite*SQL NOT SQLite!!) for further information:
http://litesql.sourceforge.net
For alternative solutions, you may want to check out the references collected in the boost wiki, as there's an up2date collection of SQL wrapper C++ libraries, because it is considered to eventually provide a boost-based solution for providing SQL access (and possibly later on also SQL databases).
Embedded databases are for applications where you want a database, but don't want to require 'heavy'(large, cpu/resource intensive) database servers - stand-alone database programs are typically not something you want to install on a machine that won't be doing mainly database serving. Smaller servers like mysql might not be so bad, but the big ones like Oracle are designed to run on machines they 'own', and you can definitely tell that the machine belongs to the DB server when you install it. It can also be a lot of pain to set up a database server with users etc, and it can be difficult to export the entire database to a single file for easy moving. With an embedded database, your application directly controls everything and you don't need to worry about settings, and they typically work with a small number of files that you application can easily package up if you want to copy the data elsewhere.
You can find several embeddable databases in my thread Free Small Stand-Alone DataBase?
[Edited by - Extrarius on October 5, 2006 6:13:53 PM]
You can find several embeddable databases in my thread Free Small Stand-Alone DataBase?
[Edited by - Extrarius on October 5, 2006 6:13:53 PM]
Extrarius, your topic is enlightening. Your lightweight preferences are very similar to mine, though I don't have to worry about locking (so far). Your application appears to be a very suitable transaction implementation for users. I am looking more at the transaction dialect as a tool for exploring search-space solutions for AI. My idea is that I could take the concepts for solutions to implementation for testing much quicker than with C structs. (This also means I'm thinking of the working database as transient, with tables generated on entry into the AI processing function and dropped on exit.) Does this sound reasonable?
litesql looks promising in the sense that it has natural integration with existing C++ applications!
litesql looks promising in the sense that it has natural integration with existing C++ applications!
Quote:Original post by dgrantkp
litesql looks promising in the sense that it has natural integration with existing C++ applications!
litesql is indeed pretty cool, it allows you to define your database(object) structure using XML files, which are then compiled into C++ template code, so that you can easily access these databases using different backends (i.e. mySQL, SQLite, PostGres) directly in your C++ code using corresponding templates.
Quote:Original post by Anonymous PosterQuote:Original post by dgrantkp
litesql looks promising in the sense that it has natural integration with existing C++ applications!
litesql is indeed pretty cool, it allows you to define your database(object) structure using XML files, which are then compiled into C++ template code, so that you can easily access these databases using different backends (i.e. mySQL, SQLite, PostGres) directly in your C++ code using corresponding templates.
Excellent. Thanks everyone.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement