April 2020
Intermediate to advanced
292 pages
6h 50m
English
Okay, so technically we used a relational database when writing to our Message Store in Chapter 3, Putting Data in a Message Store. That was optimized for writing data. In this chapter we’re going to build tables optimized for reading data. You won’t find third normal form[35] tables here. Those are optimized for writing. What if we could build our database schema in such a way that every screen only required querying for a single row? Let’s start with a migration to define the schema we’re going to write to:
| | exports.up = knex => |
| | knex.schema.createTable('pages', table => { |
| | table.string('page_name').primary() |
| | |
| | table.jsonb('page_data').defaultsTo( ... |
Read now
Unlock full access