Chain’s enterprise blockchain networks rely on etcd an Postgres for storage. We use Postgres to store blockchain data, and rely on Postgres’s replication features to ensure that clients can always access their assets and create transactions. I wrote a service that manages Postgres replicas. This service was heavily inspired by Joyent’s Manatee project, but uses different technology; namely, Go and etcd instead of Node and Zookeeper.
In this talk, I’ll introduce blockchains and a couple of different consensus algorithms before covering how we use etcd to coordinate replicas in our high-availability management system. I’ll talk about how we configured both etcd and Postgres, walk through the high-level design as well as some code, demonstrate failover, and show how blockchain services communicate with this system.