OODB vs RDBMS
evenprimes at gmail.com
Mon Nov 20 18:15:53 CET 2006
You might want to look at either SQLObject or SQLAlchemy. They seem
to handle the related join issues very nicely without resorting to
calling SQL directly in your code.
My only experience so far is using SQLObject with TurboGears and while
it doesn't solve the issue of lots of tables, it makes the access code
feel far more Pythonic than direct access.
I use pyODBC for accessing corporate DB2 tables, and while having SQL
in my code kinda sucks, it's fairly easy to write parametrized
queries. If you create a DB access class you can encapsulate all your
DB specific code and SQL in 1 place and then have access to things by
method. Handy, but far from perfect.
The Unicode issue is really related to your backend RDBMS, Python
seems to handle whatever you throw at it. Still, be careful about how
you construct your SQL so you don't open yourself to a SQL-injection
like attack/bug. (I had a problem before I started using parametrized
queries where the text I was INSERTing had a quote in it...:-/)
Personally I would tend to be wary of DB specific extensions like the
Postgres array. While you're using a modern Postgres today, what
happens if you need to deploy on a slightly older version or on a
different DBMS that doesn't support arrays? Creating foreign keys is
simple and well supported by most of the majors. (I don't recall if
MySQL has true fk support in v5 or not...)
On 20 Nov 2006 16:34:30 GMT, Thomas Guettler
<guettli.usenet at thomas-guettler.de> wrote:
> most of the time I use ZODB/Durus to store my data.
> I like it, but I know that it has some weaknesses:
> - only accesible from python
> - I need to code your indexes for fast searching yourself.
> I think about using a RDBMS for the next project. What I don't like
> about RDBMS: If you need a list of values you need to create a new
> table. Example: If you want to store several email addresses of one
> customer, you need to create a new table.
> Since the namespace if tablenames is flat, you soon have so many
> tables, that it is hard to browse them.
> Postgres has extensions which allows you to store arrays in a column. Is
> this supported by the python binding? Are there other databases which
> support this?
> Are there OR-mappers (object relational mappers) which support lists in
> a column?
> How is the unicode support of the python bindings to RDBMSs? I don't
> want to convert the results of a query to unicode myself.
> Can you insert unicode strings into a SELECT statement?
> Which database supports fulltext searches with a customized word
> normalization? (All should be the same: str. str straße, strasse)
> Which OR-mapper do you suggest?
> Are there OR-mappers which support this: Subobjects are
> fetched automatically while you access the object tree?
> Example: One customer has N TroubleTicketItems:
> customerobj=get_customer(...) # First SELECT
> for ticket in customerobj.tickets: # (*)
> (*) Second SELECT gets executed only if needed.
> I now this message is vague, but maybe we can discuss the
> pros/cons of "OODB vs RDBMS"
> Thomas Güttler, http://www.thomas-guettler.de/ http://www.tbz-pariv.de/
> E-Mail: guettli (*) thomas-guettler + de
> Spam Catcher: niemand.leermann at thomas-guettler.de
"A little government and a little luck are necessary in life, but only
a fool trusts either of them." -- P. J. O'Rourke
More information about the Python-list