Posts Tagged ‘PostgreSQL’

On ORMs and "Impedence Mismatch"

Monday, December 3rd, 2007

The solution ORMs provide is to “map” an object class, which is a type (or domain), onto a table, which is a relation variable (a.k.a. relvar). This supposedly abstracts away an “impedance mismatch” between the two. ORMs are already off to a bad start, mapping a type to a variable, but I’ll continue.

The real impedance mismatch is a set of very fundamental differences between application data and data in a well-designed relational database.

(more…)

700 queries for one page load?

Saturday, November 17th, 2007

My employer is evaluating RT. So, we have a test instance set up, of course, and it’s in a working state. The application is written in Perl with the Mason framework, it has support for many databases (including PostgreSQL), and generally has a decent feature set.

We need to migrate from our previous system, so we need to import the data into RT. RT’s tools and APIs do not meet our importing needs, so we look into the schema to do the import directly. I decide the easiest way to figure out how the schema fits together is to just turn on query logging. So, we reload the page, and all of a sudden a deluge of output appears in our “tail -f”. At first I thought it was just the normal number of queries generated by some abstraction layer, and we could dig through them. But it was about 700 queries.

(more…)

Databases and Data Types

Monday, October 29th, 2007

Hypothetically, if I were to use a much simpler database (let’s say SQLite or BerkeleyDB) for a project, rather than a powerful RDBMS like PostgreSQL, what would be the first thing that I would miss from PostgreSQL? Not “miss” in a theoretical, long term sense, but “miss” in that it would cause a practical impediment to actually constructing even a prototype application?

Would it be triggers? Certainly not. Server side functions? Those would certainly be missed, although may projects go along fine without them. SQL’s relational algebra and calculus that make a relational database relational? Maybe, that would certainly be preferable to procedural code using BerkeleyDB, but I don’t think this would be the first thing I’d miss (digression: actually, it wouldn’t be missed until later, when I was actually trying to debug a difficult problem or look at the data for analysis).

(more…)