PDA

View Full Version : [SOLVED] Should I use an external database in this case?



zhaotianwu
August 4th, 2011, 01:08 PM
I'm building a small diary application using Python 2.7. The most important problem here is, should I use a XML database to store all the data or an object oriented database like ZOPE? or just serialize them using Python pickles? I know they both have their pros and cons, like XML is more suitable for interoperability, however this application is basically just a desktop application for one user so I guess interoperability is not a concern in this case. Given this, what would be a sensible path choice to store the data, in the long run and better supports SVG visualization? Thanks.

p.s. I guess relational database should be out in this case as the diary part is likely to be very unstructured.

PaulM1985
August 4th, 2011, 06:14 PM
Isn't a diary just a series of textual entries associated with given dates? Surely this could be part of a relational database.

zhaotianwu
August 4th, 2011, 08:54 PM
Isn't a diary just a series of textual entries associated with given dates? Surely this could be part of a relational database.

Hi PaulM1985, thanks for replying. No it really is not just textual, it contains pictures, sound clips. I'm sure relational database does not fit my project at the moment, but I'm really not sure which path of database design is best at doing this kind of task? XML? ZOPE? Json? Here is why I'm looking for some advice from experienced members. Thanks.:)

zhaotianwu
August 5th, 2011, 01:22 AM
Please someone with experience in Python data model design share some thoughts here, thanks!

Tony Flury
August 5th, 2011, 02:34 PM
Thios sort of design question is really language indepedent, although some languages might make it easier to do some stuff natively.

Think about your data model first - and then think about how you implement your storage.

As a guide - describe your data and the relationship - every noun in your description will possibly be a data type, and each verb will be a relationship between data types.

Then think about the volumes - if you large amounts of data and complex relationships - then maybe using relational database (such as sqllite) might be appropriate.

If you have a small amount of data then python lists, dictionaries and using pickle to keep data between execution.

PaulM1985
August 5th, 2011, 02:57 PM
Thios sort of design question is really language indepedent, although some languages might make it easier to do some stuff natively.

Think about your data model first - and then think about how you implement your storage.

As a guide - describe your data and the relationship - every noun in your description will possibly be a data type, and each verb will be a relationship between data types.

Then think about the volumes - if you large amounts of data and complex relationships - then maybe using relational database (such as sqllite) might be appropriate.

If you have a small amount of data then python lists, dictionaries and using pickle to keep data between execution.

I agree.

You mentioned in your description of a diary entry that the types things allowed in an entry are flexible, but you must have a definitive set on things that are allowed. This things would be attributes of an entry.

Paul

zhaotianwu
August 6th, 2011, 01:26 AM
Thanks everyone