another cgi / database concern (SQL vs. 'shelve')

Syver Enstad syver-en+usenet at online.no
Wed Nov 13 15:30:36 EST 2002


"Stephen Aichele" <stephen at mochamail.com> writes:

> thanks to those who replied to may last questions here.  what a busy
> mailing list!
> 
> So the next topic:  For the site I'm building, I'll need to access
> user stats and log user input rather frequently.  The amount of data
> to be stored for any given user is not significant, but there will be
> a lot of accessing of database files.  
> 
> I have no experience with SQL, but I do have experience using shelve
> for persistent storage of data.  I'd like to get some exposure to
> SQL, but I'm not sure if it is overkill for what I'm doing -
> considerations would be the learning curve of SQL and whether or not
> continual access of and writing to a db file using 'shelve' would be
> wise.  
> 
> any suggestions greatly appreciated.

I am just going to make a common sense type suggestion. If you know
shelve, use it, but be aware that you have to protect shelves from
concurrent writing/reading. If I remember right, it's okay to have
several readers simultaneously, but a writer needs exclusive access
(no readers and no writers).

A "proper" RDBMS will take care of concurrency issues for you, so if
you think the concurrency problem will be tricky use an RDBMS (SQL
server, Oracle, PostgreSQL). If you go with shelves and got the
concurrency problem sorted out, script some typical scenarios for use
and time them, if the performance with shelves is good enough, you
don't need SQL yet (Mind you, you are not guaranteed in any way to get
enhanced performance using SQL).
 

-- 

Vennlig hilsen 

Syver Enstad



More information about the Python-list mailing list