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 6. Application Design and Implementation

Like all databases, CockroachDB responds to requests from application code. How an application requests and uses data has a huge bearing on application performance and scalability. In this chapter, we’ll review how an application should work with CockroachDB, including best practices for coding CockroachDB requests and transactional models.

Because CockroachDB is PostgreSQL wire protocol–compatible, any language that supports PostgresSQL can be used with CockroachDB. And in general, the programming idioms and best practices of PostgreSQL apply to CockroachDB. However, because of the distributed nature of CockroachDB, there are some differences in programming styles between CockroachDB and PostgreSQL.

Although you can work with CockroachDB using pretty much any programming language in common use, in this chapter, we’ll constrain our discussion to four languages: Go, Java, Python, and JavaScript.

Previously, we showed how to install language drivers for each of these languages. Please refer back to Chapter 3 for instructions on driver installation, or refer to the CockroachDB documentation for more detailed guidelines, including guidance on how to install drivers for other languages or for alternative drivers.

CockroachDB Programming

CockroachDB is broadly compatible with the universe of SQL-relational databases and particularly compatible with PostgreSQL. However, there are a few unique programming idioms specific to CockroachDB ...

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