Tag: data modeling
Conditional foreign keys and polymorphism in SQL: 4 Methods
This article is about the notoriously difficult problem of “conditional foreign keys”. In object-oriented programming languages, polymorphism is a natural concept. However, it does not translate well to SQL. As a consequence, many people whose data models are driven by an object-oriented application design end up trying to implement conditional foreign keys. In this […]
Practical Examples of Data Normalization in PostgreSQL
Normalization by Osmosis Part 2: Practical Examples of Data Normalization in PostgreSQL Having gone through a theoretical introduction in part 1, it is now time to discuss some more practical examples. I’ll first talk about the… type modeling … of columns. It is important to realize that during the time Codd formulated the base 3 […]
JSON in PostgreSQL: how to use it right
The comprehensive JSON support in PostgreSQL is one of its best-loved features. Many people – particularly those with a stronger background in Javascript programming than in relational databases – use it extensively. However, my experience is that the vast majority of people don’t use it correctly. That causes problems and unhappiness in the long […]
Insert-only data modelling to smooth peaks on slow disks
A few years ago, I wrote a short post on a similar topic; since then, I’ve often seen that the whole concept of suggesting to do more INSERT-s in critical parts of the code seems pretty strange to most customers. It’s even alien to those who are not new to databases in general. So I […]
Insert-only data modeling with PostgreSQL?
By Kaarel Moppel – In recent years, there has been quite a lot of buzz about “insert-only” approaches and some database-like products (Datomic, Apache Samza) have emerged, being inspired by the idea of having an immutable data store. In light of cheap storage and powerful hardware, I see the idea definitely having potential for certain […]