Skip to Content
Cloud Native Go, 2nd Edition
book

Cloud Native Go, 2nd Edition

by Matthew A. Titmus
October 2024
Intermediate to advanced
542 pages
13h 36m
English
O'Reilly Media, Inc.
Audio summary available
Content preview from Cloud Native Go, 2nd Edition

Chapter 13. Distributed State

A distributed system is one in which the failure of a computer you didn’t even know about can render your own computer unusable.1

Leslie Lamport, DEC SRC Bulletin Board (May 1987)

Distributed state is at the heart of cloud computing. Well-designed distributed systems can provide higher levels of fault tolerance and availability and can more easily scale horizontally to handle larger volumes of data and better share the load. However, distributed state is an advanced subject, so up until now, we’ve pretty much avoided the topic altogether.

You might recall that in Chapters 5 and 7 I discussed the problem of “state” in distributed computing, discussing at some length why state is the enemy of scalability. At the time, I suggested externalizing any shared state to a database, or even simply eliminating it altogether. That isn’t necessarily helpful advice because it isn’t always possible (or desirable).

This chapter seeks to remedy this injustice by directly addressing the difficult problem of “state” in cloud native systems. In this chapter, I’ll introduce the CAP theorem and its implications and offer some practical advice about how best to approach distributed state based on the performance priorities of your application. Finally, I’ll cover a few of the more common algorithms, and I’ll use one of those—Raft—to enhance our key-value store.

Distributed State Is Hard

It’s generally well-understood that implementing and managing distributed state can ...

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.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Kubernetes: Up and Running, 3rd Edition

Kubernetes: Up and Running, 3rd Edition

Brendan Burns, Joe Beda, Kelsey Hightower, Lachlan Evenson
System Design on AWS

System Design on AWS

Jayanth Kumar, Mandeep Singh
Docker: Up & Running, 3rd Edition

Docker: Up & Running, 3rd Edition

Sean P. Kane, Karl Matthias

Publisher Resources

ISBN: 9781098156411Errata Page