Re: Dictionary or Database輝lease advise

km srikrishnamohan at gmail.com
Fri Feb 26 13:03:43 EST 2010


Hi,

Probably u should try couchdb! its a document oriented database. (
apache.couchdb.org)
u can store your dictionaries as json documents and yes they  are simple
text files; data structures cna be directly stored into JSON documents.
memory efficient too..
python module @ http://code.google.com/p/couchdb-python/

HTH
Krishna
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
On Sat, Feb 27, 2010 at 1:39 AM, Roy Smith <roy at panix.com> wrote:

> In article
> <891a98fa-c398-455a-981f-bf72af77256c at s36g2000prh.googlegroups.com>,
>  Jeremy <jlconlin at gmail.com> wrote:
>
> > I have lots of data that I currently store in dictionaries.  However,
> > the memory requirements are becoming a problem.  I am considering
> > using a database of some sorts instead, but I have never used them
> > before.  Would a database be more memory efficient than a dictionary?
> > I also need platform independence without having to install a database
> > and Python interface on all the platforms I'll be using.  Is there
> > something built-in to Python that will allow me to do this?
> >
> > Thanks,
> > Jeremy
>
> This is a very vague question, so it'll get a vague answer :-)
>
> If you have so much data that you're running into memory problems, then
> yes, storing the data externally in an disk-resident database seems like a
> reasonable idea.
>
> Once you get into databases, platform independence will be an issue.  There
> are many databases out there to pick from.  If you want something which
> will work on a lot of platforms, a reasonable place to start looking is
> MySQL.  It's free, runs on lots of platforms, has good Python support, and
> there's lots of people on the net who know it and are willing to give help
> and advice.
>
> Databases have a bit of a learning curve.  If you've never done any
> database work, don't expect to download MySql (or any other database) this
> afternoon and be up and running by tomorrow.
>
> Whatever database you pick, you're almost certainly going to end up having
> to install it wherever you install your application.  There's no such thing
> as a universally available database that you can expect to be available
> everywhere.
>
> Have fun!
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100227/1d50319f/attachment.html>


More information about the Python-list mailing list