The Linux distillery
Bringing the world of Linux to you, David cuts through the tech and shows you how it works and how to use it, in terms that apply to any distro. RSS
Technology news and Jobs arrow The Linux distillery arrow Rapid Linux apps using object databases
Rapid Linux apps using object databases E-mail
by David M Williams   
Wednesday, 11 June 2008
db4o, as you’ve likely sussed from the previous paragraph, stores its data in a different way to a relational database. Rather than flat tables with repeated primary key and foreign key values splattered throughout, db4o uses a different model. It builds upon the popular object oriented programming paradigm which will be familiar and comfortable to those who code in C++, Java, Smalltalk, Python and even, on the Windows side, Visual Basic.NET, Delphi and more.

What makes it special are several abilities so cunning you could pin a tail on them and say it’s a field of weasels. Specifically, an object database ties in directly with the data structures you are using within your program. There’s no need to artificially convert to and from flat tables; you merely save the chunk of memory to disk with one line of code. It doesn’t matter how complex or how deep your data structure is. Reloading it is just as simple, and puts your program in a state just as if it were still running within the initial session; all the data held in memory is back exactly as it was.

For coders this is a huge time saving, particularly if they are coming from a different platform and are not familiar with Linux mainstays such as MySQL. I’m not even talking just about fat client programs but also Web-based programs can benefit from this, after all they too use a database to store information. And, of course, beginning programmers also benefit from decreased complexity. Those learning PHP on their home Linux setup can focus on PHP itself, without having to worry about such housekeeping as how to save their data. Instead, db4o will save slabs of memory to disk with a minimum of fuss.

You can get started by downloading db4o either from their direct web site or from SourceForge. You can also click directly through to the download page for the current version at the time of writing, version 6.4.

Presently, db4o only contains libraries for Java (and .NET) so you will need to use Java on a Linux platform, or perhaps the Mono framework. There isn’t a C++ library at this time. Mind you, it is open source and all the code is there so hopefully an altruist will provide additional libraries for other languages.

I’ve been spruiking this simplicity. Here’s some sample code to demonstrate.

CONTINUED







 
< Next story in category   Previous story in the category >
iTWire user statistics Visitors last 30 days
Suscribers
904,266
13,751
#1 independent technology news advertise here
  •   *  
  • Search
  • AdvSeach
  • Login
  • Events
  • FreeStuff
Subscribe to our free e-newsletter