Cockroach Labs Icon Cockroach Labs – Sponsored

How we built REGIONAL BY ROW

logged by @logbot permalink

CockroachDB comes with new easy-to-use SQL syntax for configuring a database across multiple regions. One of these SQL features is to declare a table to have the locality REGIONAL BY ROW, allowing developers to place individual rows of a table in a specific region whilst maintaining the facade of a single SQL table, for example:

CREATE TABLE users (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  username STRING NOT NULL UNIQUE
) LOCALITY REGIONAL BY ROW;

With this extra piece of syntax during CREATE TABLE, they’ve made row-level data homing simple.

Get Started with CockroachDB for free

Player art
  0:00 / 0:00