Kinja Technology
Kinja Technology

The speech by Andrew Godwin was actually more interesting that what its title would suggest. He covered many of PostgreSQL's features which make it superior to MySQL.

Among lock-free schema changes, read-only mode and many others, what I found would be most useful for us is the ability to mix relational and schemaless data in one single table. When we designed our MySQL database for the core data of Kinja, we settled on storing most of it in a schemaless way to support rapid and painless changes by using Google's Protocol Buffers stored in blob fields. Indexing is then done by proprietary background processes writing data to be indexed in separate MySQL tables and keeping them in sync. This setup indeed supports rapid changes as long as you want to change how the schemaless data is indexed, which leads back to square one of having to make alter tables on huge index tables.


PostgreSQL supports all of this out of the box. It has a json data type to store schemaless data and allows them being filtered and indexed using special operators together with the relational fields. Why this is awesome is what this provides over plain document stores like MongoDB is that for the relational fields it still guarantees the ACID properties (Atomicity, Consistency, Isolation, Durability) while providing an incredible flexibility for the rapidly changing structure of your data.

Share This Story

Get our newsletter