Comments on: Flexible Schemas and PostgreSQL http://thoughts.davisjeff.com/2010/05/06/flexible-schemas-and-postgresql/ Ideas on Databases, Logic, and Language by Jeff Davis Tue, 19 Jun 2012 16:18:51 +0000 hourly 1 http://wordpress.org/?v=3.3.1 By: Jeff Davis http://thoughts.davisjeff.com/2010/05/06/flexible-schemas-and-postgresql/comment-page-1/#comment-206 Jeff Davis Thu, 06 May 2010 19:15:12 +0000 http://thoughts.davisjeff.com/?p=267#comment-206 This isn't the same as EAV. EAV is a complete rejection of the idea of a schema at all, while pretending to use an RDBMS. A schema is a constraint, and there are degrees of constraints. The more constrained the data is, the more meaningful reports you can create, which is critical. But in order to constrain your data, you must understand it, and we don't always understand our data during the exploratory phase of application development. The point is that we shouldn't pretend to understand our data by declaring a sophisticated schema when we don't really understand our data that well. That will only leave a false sense of certainty and add confusion (and therefore bugs). During early development, even our verbal conversations tend to use vague nouns such as "stuff" and "properties". The most important rule of database design is that your database should represent reality (including vagueness), not what we wish reality was. This isn’t the same as EAV. EAV is a complete rejection of the idea of a schema at all, while pretending to use an RDBMS.

A schema is a constraint, and there are degrees of constraints. The more constrained the data is, the more meaningful reports you can create, which is critical. But in order to constrain your data, you must understand it, and we don’t always understand our data during the exploratory phase of application development.

The point is that we shouldn’t pretend to understand our data by declaring a sophisticated schema when we don’t really understand our data that well. That will only leave a false sense of certainty and add confusion (and therefore bugs).

During early development, even our verbal conversations tend to use vague nouns such as “stuff” and “properties”. The most important rule of database design is that your database should represent reality (including vagueness), not what we wish reality was.

]]>
By: Richard Broersma Jr. http://thoughts.davisjeff.com/2010/05/06/flexible-schemas-and-postgresql/comment-page-1/#comment-205 Richard Broersma Jr. Thu, 06 May 2010 18:29:42 +0000 http://thoughts.davisjeff.com/?p=267#comment-205 It seems that HStore serves the same purpose as an EAV table. Are there any advantages of using HStore over the EAV model? It seems that HStore serves the same purpose as an EAV table. Are there any advantages of using HStore over the EAV model?

]]>