For people used to relational databases, using NoSQL solutions such as MongoDB brings interesting challenges. One of them is schema design: while in the relational world, normalization is a good way to start, how should we design our collections when creating a new MongoDB application?
Let’s see with a simple example how we would create a data structure for MySQL (or any relational database) and for MongoDB. We will assume in this post that we want to store people information (their name) and the details from their passport (country and validity date).
In the relational world, the basic idea is to try to stick to the 3rd normal form and create two tables (I’ll omit indexes and foreign keys for clarity – MongoDB supports indexes but not foreign keys):
mysql> select * from people;[Read more...]
Below are the slides from my last talk at this Percona Live Worldwide MySQL Conference. The idea for this talk was proposed by my co-presenter Massimo Brignoli and goes back to a debate on this topic that went through the MySQL blogosphere during last Autumn - which in itself was sparked by an outstanding retrospective published about a MySQL failure at Github.
This tutorial has been authored by Craig Russell and JD Duncan
- native "NoSQL" access to the storage layer without going first through SQL transformations and parsing.