Skip to Content
CockroachDB: The Definitive Guide
book

CockroachDB: The Definitive Guide

by Guy Harrison, Jesse Seldess, Ben Darnell
April 2022
Intermediate to advanced
485 pages
12h 4m
English
O'Reilly Media, Inc.
Book available
Content preview from CockroachDB: The Definitive Guide

Chapter 5. CockroachDB Schema Design

A sound data model is the foundation of a highly performant and maintainable application. In this chapter, we’ll review the fundamentals of relational schema design, with a particular focus on aspects of schema design that bear on distributed database operations and on advanced CockroachDB features such as column families and JSON binary (JSONB) support. We’ll cover the creation of tables, indexes, and other schema objects that support a well-designed CockroachDB application.

Although CockroachDB supports mechanisms for efficiently altering schemas online, schema changes to production applications are nevertheless high-impact changes, typically involving coordinated changes to application code and production database configuration. If done poorly, there’s the risk of loss of application functionality, availability, or performance. Therefore, although it’s quite possible to alter CockroachDB schemas in production, it’s far better to get the schema right during application design.

Relational database design is a big topic and has been the subject of many books and continuing debate. We don’t want to try to cover advanced design principles here, nor do we want to engage in any debates about the purity of various design patterns. Most database models are a compromise between the mathematical purity of the relational model and the practicalities imposed by the physical database system. Therefore, in this chapter, we’ll attempt to briefly cover only ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Cassandra: The Definitive Guide, 3rd Edition

Cassandra: The Definitive Guide, 3rd Edition

Jeff Carpenter, Eben Hewitt
Getting Started with CockroachDB

Getting Started with CockroachDB

Kishen Das Kondabagilu Rajanna

Publisher Resources

ISBN: 9781098100230Errata PageSupplemental Content