I finally got it! I have been looking at persistence frameworks and various other toolkits, and I have been mentally comparing them to relational databases. Even if the framework worked with a relational database, I have been making the comparison, concluding that I would rather write stored procedures than use the framework.
In fact, I created a quick and dirty little database with the Berkeley DB, and the first thing I did was moan about my limited ability to query records out of the database. However, now I get it. Use a relational database when you need to analyze data; but, use a persistence engine when all you need to do is persist data.
Many applications are based on data that is saved and retrieved by objects, but it is never really analyzed. The only SQL statements that are used are used to retrieve, save, delete and update data. There is no continuing need to write queries against the database.
In that case, using DB40, Berkeley Db, or some other tool makes sense. Even if the tool interacts with an underlying relational database. Perhaps it makes sense not to require a skill that is not necessary – in the long run, that can save money.
I have been working with SQLAlchemy, and I an fairly impressed. This toolkit can be used with two popular Python based web frameworks: Turbogears, and Django. The old dog is learning new tricks. I may even play with Hibernate or NHibernate at some point, but the learning curve seems steep – or, that’s what people say.