Muutke küpsiste eelistusi

CockroachDB: The Definitive Guide: Distributed Data at Scale [Pehme köide]

  • Formaat: Paperback / softback, 500 pages, kõrgus x laius: 233x178 mm
  • Ilmumisaeg: 30-Apr-2022
  • Kirjastus: O'Reilly Media
  • ISBN-10: 1098100247
  • ISBN-13: 9781098100247
Teised raamatud teemal:
  • Formaat: Paperback / softback, 500 pages, kõrgus x laius: 233x178 mm
  • Ilmumisaeg: 30-Apr-2022
  • Kirjastus: O'Reilly Media
  • ISBN-10: 1098100247
  • ISBN-13: 9781098100247
Teised raamatud teemal:
Get the lowdown on CockroachDB, the distributed SQL database built to handle the demands of today's data-driven cloud applications. In this hands-on guide, software developers, architects, and DevOps/SRE teams will learn how to use CockroachDB to create applications that scale elastically and provide seamless delivery for end users while remaining indestructible. Teams will also learn how to migrate existing applications to CockroachDB's performant, cloud native data architecture.

If you're familiar with distributed systems, you'll quickly discover the benefits of strong data correctness and consistency guarantees as well as optimizations for delivering ultra low latencies to globally distributed end users.

You'll learn how to:

Design and build applications for distributed infrastructure, including data modeling and schema design Migrate data into CockroachDB Read and write data and run ACID transactions across distributed infrastructure Plan a CockroachDB deployment for resiliency across single region and multi-region clusters Secure, monitor, and optimize your CockroachDB deployment
Preface xv
Part I Introduction to CockroachDB
1 Introduction to CockroachDB
3(16)
A Brief History of Databases
3(1)
Pre-Relational Databases
4(1)
The Relational Model
5(2)
Implementing the Relational Model
7(1)
Transactions
7(1)
The SQL Language
8(1)
The RDBMS Hegemony
8(1)
Enter the Internet
9(2)
The NoSQL Movement
11(1)
The Emergence of Distributed SQL
11(2)
The Advent of CockroachDB
13(1)
CockroachDB Design Goals
14(2)
CockroachDB Releases
16(1)
CockroachDB in Action
16(1)
CockroachDB at DevSisters
17(1)
CockroachDB at DoorDash
17(1)
CockroachDB at Bose
17(1)
Summary
18(1)
2 CockroachDB Architecture
19(32)
The CockroachDB Cluster Architecture
20(1)
Ranges and Replicas
21(1)
The CockroachDB Software Stack
22(1)
The CockroachDB SQL Layer
23(2)
From SQL to Key-Values
25(1)
Tables as Represented in the KV Store
25(1)
Column Families
26(1)
Indexes in the KV Store
27(1)
Inverted Indexes
28(1)
The STORING Clause
28(1)
Table Definitions and Schema Changes
29(1)
The CockroachDB Transaction Layer
30(1)
MVCC Principles
31(1)
Transaction Workflow
32(1)
Write Intents
33(1)
Parallel Commits
34(1)
Transaction Cleanup
35(1)
Overview of Transaction Flow
35(2)
Read/Write Conflicts
37(1)
Clock Synchronization and Clock Skew
38(1)
The CockroachDB Distribution Layer
39(1)
Meta Ranges
39(1)
Gossip
40(1)
Leaseholders
40(1)
Range Splits
41(1)
Multiregion Distribution
42(1)
The CockroachDB Replication Layer
43(1)
Raft
43(1)
Raft and Leaseholders
44(1)
Closed Timestamps and Follower Reads
44(1)
The CockroachDB Storage Layer
45(1)
Log-Structured Merge Trees
45(2)
SSTables and Bloom Filters
47(1)
Deletes and Updates
48(1)
MultiVersion Concurrency Control
48(1)
The Block Cache
48(1)
Summary
49(2)
3 Getting Started
51(28)
Installation
51(1)
Installing CockroachDB Software
51(4)
Creating a CockroachDB Serverless Instance
55(4)
Starting a Local Single-Node Server
59(2)
Starting Up CockroachDB in a Docker Container
61(1)
Starting Up a Secure Server
62(1)
Shutting Down the Server
63(1)
Remote Connection
64(1)
Creating a Kubernetes Cluster
64(2)
Using a GUI Client
66(1)
Exploring CockroachDB
67(1)
Adding Some Data
67(3)
Databases and Tables
70(1)
Issuing SQL
71(1)
The DB Console
72(1)
Working with Programming Languages
72(1)
Connecting to CockroachDB from Node.js
73(1)
Connecting to CockroachDB from Java
74(1)
Connecting to CockroachDB from Python
75(2)
Connecting to CockroachDB from Go
77(1)
Summary
78(1)
4 CockroachDB SQL
79(40)
SQL Language Compatibility
80(1)
Querying Data with SELECT
80(1)
The SELECT List
81(1)
The FROM Clause
81(1)
JOINS
82(1)
Anti-Joins
83(1)
Cross Joins
83(1)
Set Operations
83(1)
Group Operations
84(1)
Subqueries
85(1)
Correlated Subquery
85(1)
Lateral Subquery
85(1)
The WHERE Clause
86(1)
Common Table Expressions
86(1)
ORDER BY
87(1)
Window Functions
88(1)
Other SELECT Clauses
89(1)
CockroachDB Arrays
89(2)
Working with JSON
91(2)
Summary of SELECT
93(1)
Creating Tables and Indexes
93(2)
Column Definitions
95(1)
Computed Columns
95(1)
Data Types
96(1)
Primary Keys
97(1)
Constraints
98(1)
Indexes
98(3)
Create Table As Select
101(1)
Altering Tables
101(2)
Dropping Tables
103(1)
Views
103(1)
Inserting Data
104(2)
Update
106(1)
Upsert
107(1)
Delete
108(1)
Truncate
108(1)
Import/Import Into
108(1)
Transactional Statements
109(1)
Begin Transaction
109(1)
Savepoint
110(1)
Commit
110(1)
Rollback
110(1)
Select For Update
111(1)
As Of System Time
112(1)
Other Data Definition Language Targets
112(1)
Administrative Commands
113(1)
The Information Schema
114(1)
Summary
115(4)
Part II Developing Applications with CockroachDB
5 CockroachDB Schema Design
119(38)
Logical Data Modeling
120(1)
Normalization
121(1)
Don't Go Too Far
122(1)
Primary Key Choices
123(1)
Special-Purpose Designs
124(1)
Physical Design
124(1)
Entities to Tables
125(1)
Attributes to Columns
126(1)
Primary Key Design
127(5)
Foreign Key Constraints
132(1)
Denormalization
133(1)
Replicating Columns to Avoid Joins
133(2)
Summary Tables
135(1)
Vertical Partitioning
135(1)
Horizontal Partitioning
136(1)
Repeating Groups
137(1)
JSON Document Models
138(1)
JSON Document Antipatterns
139(1)
Indexing JSON Attributes
139(1)
Using JSON or Arrays to Avoid Joins
140(3)
Indexes
143(1)
Index Selectivity
143(1)
Index Break-Even Point
143(2)
Index Overhead
145(1)
Composite Indexes
146(1)
Covering Indexes
147(1)
Composite and Covering Index Performance
148(1)
Guidelines for Composite Indexes
149(1)
Indexes and Null Values
149(1)
Inverted Indexes
149(1)
Partial Indexes
150(1)
Sort-Optimizing Indexes
150(1)
Expression Indexes
151(1)
Spatial Indexes
151(1)
Hash-Sharded Indexes
152(1)
Measuring Index Effectiveness
153(1)
Summary
154(3)
6 Application Design and Implementation
157(36)
CockroachDB Programming
157(1)
Performing CRUD Operations
158(3)
Connection Pools
161(4)
Prepared and Parameterized Statements
165(2)
Batch Inserts
167(2)
Pagination of Results
169(4)
Projections
173(1)
Client-Side Caching
174(2)
Managing Transactions
176(1)
Transaction Retry Errors
177(1)
Implementing Transaction Retries
178(1)
Automatic Transaction Retries
179(1)
Avoiding Transaction Retry Errors with FOR UPDATE
180(2)
Reducing Contention by Eliminating Hot Rows
182(1)
Reducing Transaction Elapsed Time
183(1)
Reordering Statements
184(1)
Time Travel Queries
184(1)
Ambiguous Transactions Errors
185(1)
Deadlocks
186(1)
Transaction Priorities
187(1)
Working with ORM Frameworks
187(4)
Summary
191(2)
7 Application Migration and Integration
193(40)
Loading Data
193(1)
File Locations
194(2)
Importing Files
196(1)
Importing from Cloud Storage
197(2)
Import Performance
199(1)
Migrating from Another Database
199(1)
Extracting and Converting DDL
199(6)
General Considerations When Converting DDL
205(1)
Exporting Data
206(1)
Loading Data Into CockroachDB
207(1)
Directly Importing PostgreSQL or MySQL Dumps
208(1)
Synchronizing and Switching Over
209(4)
Updating Application Code
213(1)
Exporting CockroachDB Data
214(2)
Change Data Capture
216(1)
Core Change Data Capture
216(2)
Using the Changefeed Programmatically
218(2)
Enterprise Change Data Capture
220(5)
Change Data Capture to Kafka
225(1)
Change Data Capture to Snowflake
226(5)
Summary
231(2)
8 SQL Tuning
233(48)
Finding Slow SQL
233(3)
Explaining and Tracing SQL
236(4)
Explain Analyze
240(2)
Explain Options
242(3)
Explain DEBUG
245(1)
Changing SQL Execution
246(1)
Optimizing Table Lookups
247(10)
Optimizing Joins
257(1)
Join Methods
257(11)
Optimizing Sorting and Aggregation
268(5)
Optimizing DML
273(2)
Optimizing the Optimizer
275(1)
Optimizer Statistics
275(1)
Viewing Statistics
275(1)
Automatic Statistics
276(1)
Manually Collecting Statistics
277(1)
Summary
278(3)
Part III Deploying and Administering CockroachDB
9. Planning a Deployment
281(162)
Know Your Requirements
282(1)
Comparison of Deployment Options
283(2)
Serverless Deployments
285(3)
Single-Region Dedicated Deployments
288(1)
Common Planning Tasks--Dedicated Deployments
288(1)
Benchmarking and Capacity Planning
288(2)
CockroachDB Cloud Deployments
290(1)
Self-Hosted on a Cloud Platform
291(2)
Self-Hosted "Bare-Metal" On-Premise
293(1)
Other Self-Hosted Considerations
294(1)
Self-Hosted Kubernetes
295(1)
Configuring for Self-Hosted High Availability
296(1)
Disk Failure
297(1)
Node Failures
297(1)
Network Failure
298(1)
Zone and Region Topologies
298(2)
Summary
300(1)
10 Single-Region Deployment
301(22)
Deploying On-Premise or On-Cloud
301(1)
Firewall Configuration
302(1)
Operating System Configuration
302(1)
Clock Synchronization On-Premise
303(1)
Clock Synchronization on Cloud Platforms
304(2)
Creating Certificates
306(1)
Configuring the Nodes
307(2)
Creating a Ballast File
309(1)
Initializing the Cluster
309(1)
Creating the First User
310(2)
Installing a Load Balancer (On-Premise)
312(2)
Cloud Load Balancers
314(1)
Configuring Regions and Zones
315(1)
Deploying on Kubernetes
315(1)
Initializing the Operator
316(1)
Initializing the Cluster
317(2)
Creating a Client Pod
319(1)
Load Balancing
319(2)
Other Kubernetes Tasks
321(1)
Summary
322(1)
11 Multiregion Deployment
323(16)
Multiregion Concepts
323(1)
Regions and Zones
323(2)
Survival Goals
325(2)
Locality Rules
327(2)
Planning Your Mutliregion Deployment
329(1)
Deploying in Multiregion
329(3)
Converting to a Multiregion Database
332(1)
Configuring Regional by Row
333(3)
Setting Regional Survival Goal
336(1)
Placement Restricted Databases
337(1)
Summary
338(1)
12 Backup and Disaster Recovery
339(18)
Backups
340(1)
The BACKUP Command
341(1)
Backup Destinations
342(1)
Full Backup
343(1)
Table- and Database-Level Backups
343(1)
Incremental Backups
344(1)
As Of System Time Backup
344(1)
With Revision History
345(1)
Show Backup
345(2)
Managing Backup Jobs
347(1)
Scheduling Backups
348(2)
Locality-Aware Backups
350(1)
Restoring Data
351(2)
Exporting Data
353(1)
Disaster Recovery Best Practices
354(1)
Backup Scheduling and Configuration
354(1)
Recovering from Human Errors
355(1)
Summary
356(1)
13 Security
357(24)
Firewall Configuration
358(1)
IP Allowlist with CockroachDB Dedicated
358(1)
VPC Peering and PrivateLink with CockroachDB Dedicated
359(3)
Native Linux Firewall
362(2)
Configuring a Firewall in GCP
364(1)
Configuring a Firewall in AWS
365(1)
Configuring Ports for Microsoft Azure
366(1)
Encryption and Server Certificates
367(1)
Encryption at Rest
368(3)
Authentication Mechanisms
371(1)
Standard Authentication
371(1)
Advanced Authentication
372(1)
Authorization
372(1)
Managing Users
373(1)
Managing Privileges
374(1)
Fine-Grained Access Control with Views
375(1)
Logging and Auditing
376(3)
Security Best Practices
379(1)
Summary
380(1)
14 Administration and Troubleshooting
381(28)
Monitoring
381(1)
CockroachDB Dedicated Alerts
382(1)
CockroachDB Serverless Alerts
383(1)
Availability Monitoring
383(2)
The Cluster API
385(1)
Monitoring and Alerting with Prometheus
386(2)
Monitoring and Alerting with Datadog
388(1)
Log Configuration
389(2)
Log Channels
391(1)
Log Format
392(2)
Filter Levels
394(1)
Log Destinations
395(1)
Logging to Fluentd
395(1)
Redaction
396(1)
Logs in Cloud Deployments
396(1)
Cluster Management
397(1)
Upgrading the Cluster Version
397(2)
Adding Nodes to a Cluster
399(1)
Decommissioning Nodes
400(3)
Troubleshooting
403(1)
Clock Synchronization Errors
404(1)
Node Liveness
404(1)
Networking Issues
405(2)
Loss of Client Connectivity
407(1)
Running Out of Disk Space
407(1)
Working with CockroachDB Support Resources
407(1)
Summary
408(1)
15 Cluster Optimization
409(34)
Tuning Versus Firefighting
409(2)
Workload Optimization
411(1)
Detecting Problem Workloads
411(8)
Review of Workload Optimization Strategies
419(2)
Ad Hoc or Analytic Queries
421(1)
Cluster Balance
422(1)
Causes of Imbalance
423(1)
Hot Ranges
424(5)
Load Balancing
429(2)
Changes in Cluster Topology
431(1)
Admission Control
432(1)
Network
433(2)
Memory Optimization
435(1)
Key-Value Cache
436(1)
max-sql-memory
437(1)
Host Memory
438(1)
Disk I/O
438(3)
Scaling Out
441(1)
Summary
441(2)
Index 443