[Haskell-cafe] ORM for haskell?
Alberto G. Corona
agocorona at gmail.com
Sat Jul 4 06:21:06 EDT 2009
And I realize that you are not trying to replace RDBs, just building a
> nicer interface to them. I am just concerned that some of the nice
> properties are lost in the process. I think my main concern comes from
> seeing people create databases, by automatically generating tables from
> OO-classes. They invariably ends up with something not nearly as nice,
> as if they had constructed the database in a more traditional fashion.
for web applications in the Internet, due to security reasons, 99% of the
databases are handled exlusively by te web application. This increases the
arguments in favor of spending less time in database design. Moreover, since
there are no concurrent updates from different applications, (communication
with other applications are done trough the middle tier of the web
application rather than trough the database), the database just provides
transaction coherence (for the single application) and storage. Then it is
much faster to perform transactions in the application trough STM and leave
the database for storage purposes. At this time the database can be
substituted with advantage by files.
All of this gives credit to ORM solutions and HappStack or SQLalchemy,
Database design and maintenance don't worth the pain in this scenario. My
package TCache http://hackage.haskell.org/package/TCache is made also
around this philosophy.
If the ORM has an interface such is SQLalchemy, it would be nice to have two
"drivers" one for pure SQL databases, where all the primitives would be
executed in the database, and other pure Haskell where the primitives are
executed in memory. For example, the transactions would be executed trough
STM. This driver would have configurable persistence (either in files,
manualy designed databases or whatever) . Perhaps mixed drivers can be added
later. This would unite the best of both worlds. It would be flexible enough
to permit the change of scenario without breaking the code. This would be
nice for prototyping for example.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe