Skip to content

Cockroach DB Notes

meddlin edited this page Oct 27, 2019 · 1 revision

A collection of useful links, code snippets, etc. I've come across while trying to connect Cockroach DB to the project.

Auto-incrementing INT IDs

The serial keyword will default to an int data type.

https://www.cockroachlabs.com/docs/stable/serial.html

create table if not exists accounts (id serial primary key, balance int)

Admin UI

Address: http://localhost:8080

That is the default config for insecure nodes. The current addr is listed in the CLI output when Cockroach DB is started from the binary.

https://www.cockroachlabs.com/docs/stable/admin-ui-overview.html

Change Data Capture

This is the key feature which appears to offer some sort of real-time data support in Cockroach DB. It's the hope that we can have (pseudo) real-time data across the application via tracking changefeeds.

Change data capture (CDC) provides efficient, distributed, row-level change feeds into Apache Kafka for downstream processing such as reporting, caching, or full-text indexing.

Emphasis mine.

https://www.cockroachlabs.com/docs/stable/change-data-capture.html

Clone this wiki locally