Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
etcd - mission-critical key-value store - OSCON...
Search
Brandon Philips
May 20, 2016
Programming
0
170
etcd - mission-critical key-value store - OSCON 2016
Brandon Philips
May 20, 2016
Tweet
Share
More Decks by Brandon Philips
See All by Brandon Philips
Node.js Workflow with Minikube and Skaffold
philips
0
240
Manage the App on Kubernetes
philips
0
320
Production Backbone Monitoring Containerized Apps
philips
0
130
KubeCon EU 2017: Dancing on the Edge of a Volcano
philips
1
650
rkt - KubeCon EU keynote - 2017
philips
1
240
FOSDEM_Keynote_2017-_.pdf
philips
0
100
Tectonic Summit Day 2 Keynote
philips
0
310
Kubernetes: Simple to Manage Anywhere (self-hosted, Tectonic upgrade demo)
philips
0
330
KubeCon Keynote 2016- Distributed Systems Simplified on Kubernetes
philips
2
530
Other Decks in Programming
See All in Programming
コンテナでLambdaをデプロイするときに知っておきたかったこと
_takahash
0
160
gen_statem - OTP's Unsung Hero
whatyouhide
1
180
海外のアプリで見かけたかっこいいTransitionを真似てみる
shogotakasaki
1
140
Signal-Based Data FetchingWith the New httpResource
manfredsteyer
PRO
0
120
php-fpm がリクエスト処理する仕組みを追う / Tracing-How-php-fpm-Handles-Requests
shin1x1
5
890
Go1.24で testing.B.Loopが爆誕
kuro_kurorrr
0
170
データベースエンジニアの仕事を楽にする。PgAssistantの紹介
nnaka2992
9
4.4k
AIコードエディタの基盤となるLLMのFlutter性能評価
alquist4121
0
180
小さく段階的リリースすることで深夜メンテを回避する
mkmk884
2
140
PHPによる"非"構造化プログラミング入門 -本当に熱いスパゲティコードを求めて- #phperkaigi
o0h
PRO
0
1.2k
ノーコードツールの裏側につきまとう「20分岐」との戦い
oguemon
0
110
snacks.nvim内のセットアップ不要なプラグインを紹介 / introduce_snacks_nvim
uhooi
0
370
Featured
See All Featured
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
7
620
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
4
490
Raft: Consensus for Rubyists
vanstee
137
6.9k
GraphQLとの向き合い方2022年版
quramy
45
14k
Designing for Performance
lara
606
69k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.5k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
49k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
Building an army of robots
kneath
304
45k
How to Ace a Technical Interview
jacobian
276
23k
Producing Creativity
orderedlist
PRO
344
40k
Transcript
Brandon Philips @BrandonPhilips |
[email protected]
etcd - mission-critical key-value store
Demos https://github.com/philips/2016-OSCON-etcd
Uncoordinated Upgrades
... ... ... ... ... ... Unavailable Uncoordinated Upgrades
Motivation CoreOS cluster reboot lock - Decrement a semaphore key
atomically - Reboot and wait... - After reboot increment the semaphore key
3 CoreOS updates coordination
CoreOS updates coordination 3
... CoreOS updates coordination 2
... ... ... CoreOS updates coordination 0
... ... ... CoreOS updates coordination 0
... ... CoreOS updates coordination 0
... ... CoreOS updates coordination 0
... ... CoreOS updates coordination 1
... ... ... CoreOS updates coordination 0
CoreOS updates coordination
Store Application Configuration config
config Start / Restart Start / Restart Store Application Configuration
config Update Store Application Configuration
config Unavailable Store Application Configuration
Requirements Strong Consistency - mutual exclusive at any time for
locking purpose Highly Available - resilient to single points of failure & network partitions Watchable - push configuration updates to application
Requirements CAP - We want CP - We want something
like Paxos
Common problem GFS Paxos Big Table Spanner CFS Chubby Google
- “All” infrastructure relies on Paxos
Common problem Amazon - Replicated log powers ec2 Microsoft -
Boxwood powers storage infrastructure Hadoop - ZooKeeper is the heart of the ecosystem
COMMON PROBLEM #GIFEE and Cloud Native Solution
10,000 Stars on Github 250 contributors Google, Red Hat, EMC,
Cisco, Huawei, Baidu, Alibaba...
THE HEART OF CLOUD NATIVE Kubernetes, Cloud Foundry Diego, Project
Calico, many others
ETCD KEY VALUE STORE Fully Replicated, Highly Available, Consistent
PUT(foo, bar), GET(foo), DELETE(foo) Watch(foo) CAS(foo, bar, bar1) Key-value Operations
DEMO play.etcd.io
Runtime Reconfiguration Point-in-time Backup Extensive Metrics etcd Operationality
ETCD v3 Successor of etcd v2
ETCD v3 Better Performance
ETCD v3 More Efficient APIs
Multi-Version Put(foo, bar) Put(foo, bar1) Put(foo, bar2) Get(foo) -> bar2
Multi-Version Put(foo, bar) Put(foo, bar1) Put(foo, bar2) Get(foo, 1) ->
bar
Tx.If( Compare(Value("foo"), ">", "bar"), Compare(Version("foo"), "=", 2), ... ).Then( Put("ok","true")...
).Else( Put("ok","false")... ).Commit() Mini-Transactions
l = CreateLease(15 * second) Put(foo, bar, l) l.KeepAlive() l.Revoke()
Leases
w = Watch(foo) for { r = w.Recv() print(r.Event) //
PUT print(r.KV) // foo,bar } Streaming Watch
Synchronization LoC
ETCD v2 machine coordination -> O(10k)
ETCD v3 app/container coordination -> O(1M)
Performance 1K keys
Performance Snapshot caused performance degradation etcd2 - 600K keys
Performance etcd2 - 600K keys Snapshot triggered elections
ZooKeeper Performance Non-blocking full snapshot Efficient memory management
Performance ZooKeeper default
Performance Snapshot triggered election ZooKeeper default
Performance Snapshot ZooKeeper default
Performance GC ZooKeeper snapshot disabled
Reliable Performance - Similar to ZooKeeper with snapshot disabled -
Incremental snapshot - No Garbage Collection Pauses - Off-heap storage
Performance etcd3 /ZooKeeper snapshot disabled
Performance etcd3 /ZooKeeper snapshot disabled
Memory 10GB 2.4GB 0.8GB 512MB data - 2M 256B keys
Reliability 99% at small scale is easy - Failure is
infrequent and human manageable 99% at large scale is not enough - Not manageable by humans 99.99% at large scale - Reliable systems at bottom layer
HOW DO WE ACHIEVE RELIABILITY WAL, Snapshots, Testing
Write Ahead Log Append only - Simple is good Rolling
CRC protected - Storage & OSes can be unreliable
Snapshots Torturing DBs for Fun and Profit (OSDI2014) - The
simpler database is safer - LMDB was the winner Boltdb an append only B+Tree - A simpler LMDB written in Go
Testing Clusters Failure Inject failures into running clusters White box
runtime checking - Hash state of the system - Progress of the system
Testing Cluster Health with Failures Issue lock operations across cluster
Ensure the correctness of client library
TESTING CLUSTER dash.etcd.io
etcd/raft Reliability Designed for testability and flexibility Used by large
scale db systems and others - Cockroachdb, TiKV, Dgraph
etcd vs others Do one thing
etcd vs others Only do the One Thing
etcd vs others Do it Really Well
etcd Reliability Do it Really Well
ETCD v3.0 BETA Efficient and Scalable
BETA AVAILABLE TODAY github.com/coreos/etcd
FUTURE WORK Proxy, Caching, Watch Coalescing, Secondary Index
GET INVOLVED github.com/coreos/etcd
The smartest way to run your container infrastructure. tectonic.com @tectonic
QUAY Secure hosting for private Docker repositories quay.io @quayio
Brandon Philips @BrandonPhilips |
[email protected]
etcd - mission-critical key-value store
Thank you!