I’m reviewing database storage in my little app after several years of dealing with M$’s calculated disregard for older technology (DAO in this case).
DAO used to be a fully-respected local database storage API for any ODBC or Jet data source, complete with wizard support for easy updating of code as the database schema changed. I’ve been hand-coding updates for years now that the wizards have been killed. The fact that I now need to get the user to install special DAO library support when installing my app means Marketsoft wins, I officially give up on DAO. I may be the last to do so, but there still isn’t a good reason for it, except from M$’s point of view – Marketsoft has to keep rotating its tech to keep its customers paying. They killed DAO and are now suggesting that everyone use ADO.net instead of ADO. Why WOULDN’T you want to make your little app dependent on the bloated .net framework that’s 100 times the size of your app? And you don’t need an industry-standard language, use M$’s proprietary one, you’ll love it Anyway, I’m game, I’ll keep up with the times, but Microsoft isn’t the only show in town. So let’s review our options.
I’m just a little guy with a little app, and standard local database needs. I don’t want to have to license a mother-of-all-mother of database-servers. I want small and local. So Oracle and SQL Server are out. I thought for sure that MySQL would offer a nice solution, but if your app isn’t GPL, you’ll have to pay to bundle MySQL with your app. Maybe I should GPL my little baby, no one would care. Anyway, before I go that route, I have the following options for sane local managable database access…
- Stick with DAO, handcode updates, install DAO on app install
- Migrate DAO stuff to ADO
- Convert to a managed app and use ADO.net
- Make the app a native/managed hybrid and use ADO.net
- Write my own persistent storage with my old OOD code
- Write a persistent archive class for use with boost::serialize
I would love to make the storage binary-compatible across Windows and linux, so it would dovetail with my “big plans” for a MythTV module (shhhh!). So… without GPL’ing all my stuff, it looks like the last two are the most appealing… stay tuned…
As an aside, I have used ADO.net to connect to Oracle sources, and it looks like you can connect to MySQL sources too. You have to install third-party addons from Oracle and MySQL to get it to work. Originally .net included Oracle access tools but they have apparently been removed or reduced in scope – the docs suck.
SQLite3. Awesome little client database, SQL, C with C++ wrapper. I’ve used it before, and will use it again. Lots of little freebie clients and tools. No drivers or installers needed to go with your app, just compile it in.
Sweeeeet. A diamond in the rough. The idea of (re)writing my own database has been bogging me down. Thanks man!
Looks like GDBM is another option. There’s a Windows version here. That’s another GPL-only option though, so looks like SQLite wins for now.
Excellent 🙂 Let me know if you need any help, although I don’t think you will.
Looks like there are a handful of C++ wrappers, some that cost money, some that are not polished, etc. Which wrapper have you used?
[…] It’s showing that my database reads are taking the biggest hit, which makes sense. Sounds like time to revisit that Jet-to-sqlite replacement… […]
I used this one:
http://www.codeproject.com/database/CppSQLite.asp
And then created a thin wrapper around that to implement any code I felt was being duplicated around.
Thanks my man!