Preface

This book will introduce you to the inner workings of CockroachDB and help you understand how it provides faster access to distributed data through a SQL interface. You'll learn how you can use the database to provide solutions that require data to be highly available.

Starting with CockroachDB's installation, setup, and configuration, this book will familiarize you with the database architecture and database design principles. You'll then discover several options that CockroachDB provides to store multiple copies of your data to ensure fast data access. The book covers the internals of CockroachDB, how to deploy and manage it on the cloud, performance tuning to get the best out of CockroachDB, and how to scale data across continents and serve it locally. In addition to this, you'll get to grips with fault tolerance and auto-rebalancing, how indexes work, and the CockroachDB Admin UI. The book will guide you in building scalable cloud services on top of CockroachDB, covering administrative and security aspects and tips for troubleshooting, performance enhancements, and a brief guideline on migrating from traditional databases.

By the end of this book, you'll have enough knowledge to manage your data on CockroachDB and interact with it from your application layer.

Who this book is for

Software engineers, database developers, database administrators, and anyone who wishes to learn about the features of CockroachDB and how to build database solutions that are fast, highly available, and cater to business-critical applications, will find this book useful. Although no prior exposure to CockroachDB is required, familiarity with database concepts will help you to get the most out of this book.

What this book covers

Chapter 1, CockroachDB – A Brief Introduction, talks about databases and how they have evolved over time. You will also get to know about the high-level architecture of CockroachDB.

Chapter 2, How Does CockroachDB Work Internally?, explores various layers of CockroachDB and some of its inner workings.

Chapter 3, Atomicity, Consistency, Isolation, and Durability (ACID), introduces you to ACID properties and how they are implemented in CockroachDB.

Chapter 4, Geo-Partitioning, explains the concept of geo-partitioning, why we need it, and what are the various options for geographically distributing the data using CockroachDB

Chapter 5, Fault Tolerance and Auto-Rebalancing, explores the concept of fault tolerance and auto-recovery strategies. It also covers a few experiments to understand these concepts better.

Chapter 6, How Indexes Work in CockroachDB, is all about database indexes, how they are useful in improving query performance, the different types of indexes that are supported in CockroachDB, and some of the best practices that you can follow while using indexes.

Chapter 7, Schema Creation and Management, introduces you to SQL syntaxes for DDL, DML, and DQL with examples, different data types available in CockroachDB, sequences, and how to manage schema changes.

Chapter 8, Exploring the Admin User Interface, explores the admin user interface that comes by default when you deploy a CockroachDB cluster. We examine all the metrics and other information that are available in the user interface and how they are useful in troubleshooting issues.

Chapter 9, An Overview of Security Aspects, touches upon the key security aspects that you have to pay attention to when using CockroachDB. We also learn about authentication, authorization, how to protect data with encryption while at rest and in flight, and how to achieve desired data protection by defining the correct strategies for RTO and RPO. Network security and some security best practices are also covered.

Chapter 10, Troubleshooting Issues, helps you in getting yourself familiarized with troubleshooting issues by collecting logs, looking at some of the metrics, understanding and tracking slow queries, and integrating logs with external sinks. This chapter also covers advanced debugging options at the end.

Chapter 11, Performance Benchmarking and Migration, discusses performance, what the key indicators of performance are, and how to measure them. You will also learn about migrating from other traditional databases to CockroachDB.

Appendix: Bibliography and Additional Resources, provides additional resource material that you can go through to become more familiar with CockroachDB.

To get the most out of this book

You should have access to the internet so that you can download CockroachDB and try it on your laptop.

If you are using the digital version of this book, we advise you to type the code yourself or access the code from the book's GitHub repository (a link is available in the next section). Doing so will help you avoid any potential errors related to the copying and pasting of code.

Download the example code files

You can download the example code files for this book from GitHub at https://github.com/PacktPublishing/Getting-Started-with-CockroachDB. In case there's an update to the code, it will be updated on the existing GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Download the color images

We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: https://static.packt-cdn.com/downloads/9781800560659_ColorImages.pdf.

Conventions used

There are a number of text conventions used throughout this book.

Code in text: Indicates code words in the text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "Here, in the SELECT query, you should use AS OF SYSTEM TIME follower_read_timestamp()."

A block of code is set as follows:

SHOW TABLES

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

DROP DATABASE <DATABASE_NAME>

DROP ROLE <ROLE_NAME>

DROP TABLE <TABLE_NAME>

Any command-line input or output is written as follows:

$ cockroach cert create-client <user_name>

--certs-dir=<certs_directory>

--ca-key=<CA_key_directory>

Bold: Indicates a new term, an important word, or words that you see on screen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "The Sessions dashboard gives information about all the active client sessions within the CockroachDB cluster."

Tips or Important Notes

Appear like this.

Get in touch

Feedback from our readers is always welcome.

General feedback: If you have questions about any aspect of this book, mention the book title in the subject of your message and email us at [email protected].

Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packtpub.com/support/errata, selecting your book, clicking on the Errata Submission Form link, and entering the details.

Piracy: If you come across any illegal copies of our works in any form on the internet, we would be grateful if you would provide us with the location address or website name. Please contact us at [email protected] with a link to the material.

If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.

Share Your Thoughts

Once you've read Getting Started with CockroachDB, we'd love to hear your thoughts! Please click here to go straight to the Amazon review page for this book and share your feedback.

Your review is important to us and the tech community and will help us make sure we're delivering excellent quality content.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset