[Tutor] Which non SQL Database ?

Alan Gauld alan.gauld at btinternet.com
Sun Dec 5 17:00:52 CET 2010


"Knacktus" <knacktus at googlemail.com> wrote

>> Why not use SQL?
>> SQLlite comes with Python, is small, easy to use and if necessary 
>> can be
>> used in-memory and as such fast.
> The NoSQL databases seem to be en vogue. Some big internet companies 
> have started to use them, like Google with its Big Table.

There are cases where it makes sense but they are nearly all cases 
where
extreme performance is required for a small fixed set of queries. In 
these
cases the data structures can be optimised to match the queries and
low level file access can provide optimum access speed. But unless you
absolutely know you need that a lightweight SQL database like SQLlite
or firebird will be easier to configure, easier to query and be much 
more
scaleable and flexible. (Plus you get for free the ability to run 
ad-hoc
MIS style reports of the back of the SQL engine.)

> one kind of the database type is the clear winner, but most use 
> cases can be modelled with both.

Yes, its like OOP v procedural, both can be used for any problem but
usually OOP is is the more powerful, flexibly and easier option. But
for specific, small or high performance apps procedural can be better.

> My conclusion and what draw me finally to MongoDB over PostgreSQL 
> and SQLAlqemy was:

I've no idea what MongoDB is like but PostGrres is one of the more 
complex
(and powerful) SQL options. Certainly not my first chooice for a 
small,
single user app.

> 1) Really the ease of use (from setting up the database and later 
> when it comes to administration and scaling, which is particularly 
> easy).

Most SQL databases come with GUI tools for all of that.

> MongoDB is very useful for prototyping.
>
> 2) I don't need complex transactions and the ability to perform 
> complex, not in advanced known queries.

Fixed in advance, simple, single dimensional queries are the area
where non SQL can be a valid choice. Any kind of multi dimensional
query will quickly become difficult to code and maintain, and thats
where SQL wins. In my experience the majority of so-called
"simple database" applications very quickly become complicated!

Of course if all you need is data persistence then flat files are
a perfectly valid option. But I'm assuming here that database
implies off-disk data search and access.


-- 
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/




More information about the Tutor mailing list