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
由Spanner來看Google資料庫的前世今生
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Szu-Kai Hsu (brucehsu)
November 07, 2012
Technology
4
300
由Spanner來看Google資料庫的前世今生
2012年秋,網際網路資料庫 @ 國立中正大學資工所
Szu-Kai Hsu (brucehsu)
November 07, 2012
Tweet
Share
More Decks by Szu-Kai Hsu (brucehsu)
See All by Szu-Kai Hsu (brucehsu)
Running Life Lean
brucehsu
0
180
Core Unleashed Part II: Introduction to GobiesVM (and STM) @ RubyKaigi 2014
brucehsu
0
2.1k
[RubyConf.tw 2014] Cores unleashed - Exploiting Parallelism in Ruby with STM
brucehsu
0
2.3k
用 Go 打造程式語言執行環境:實例剖析 [OSDC.tw 2014]
brucehsu
3
2.4k
pickbox @ OSDC.tw 2013 Lightning Talk
brucehsu
0
65
Building Web 2.0 APIs
brucehsu
1
150
Rapid Web Development by Example
brucehsu
3
3.1k
TechWed@CCU #0
brucehsu
2
530
Chromium OS
brucehsu
2
210
Other Decks in Technology
See All in Technology
Amazon Bedrock AgentCore 認証・認可入門
hironobuiga
2
500
ClickHouseはどのように大規模データを活用したAIエージェントを全社展開しているのか
mikimatsumoto
0
190
月間数億レコードのアクセスログ基盤を無停止・低コストでAWS移行せよ!アプリケーションエンジニアのSREチャレンジ💪
miyamu
0
790
FinTech SREのAWSサービス活用/Leveraging AWS Services in FinTech SRE
maaaato
0
120
顧客との商談議事録をみんなで読んで顧客解像度を上げよう
shibayu36
0
150
Meshy Proプラン課金した
henjin0
0
240
茨城の思い出を振り返る ~CDKのセキュリティを添えて~ / 20260201 Mitsutoshi Matsuo
shift_evolve
PRO
1
180
We Built for Predictability; The Workloads Didn’t Care
stahnma
0
130
What happened to RubyGems and what can we learn?
mikemcquaid
0
240
Amazon S3 Vectorsを使って資格勉強用AIエージェントを構築してみた
usanchuu
3
430
Embedded SREの終わりを設計する 「なんとなく」から計画的な自立支援へ
sansantech
PRO
3
2.1k
なぜ今、コスト最適化(倹約)が必要なのか? ~AWSでのコスト最適化の進め方「目的編」~
htan
1
110
Featured
See All Featured
Designing Experiences People Love
moore
144
24k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
180
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
9.8k
Unsuck your backbone
ammeep
671
58k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
359
30k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
110
Ethics towards AI in product and experience design
skipperchong
2
190
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
200
Building AI with AI
inesmontani
PRO
1
680
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
3.6k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
320
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.1k
Transcript
由 Spanner來看 Google資料庫 的 前世今⽣生 Szu-Kai Hsu (brucehsu)
Spanner is a scalable multi-version globally-distributed synchronously-replicated database
BigTable
Handling
Handling really
Handling really BIG DATA
key-value
key-value { “CCU”: “123”, “NCTU”: “113”, “NTU”: “112” }; key
key-value { “CCU”: “123”, “NCTU”: “113”, “NTU”: “112” }; value
distributed
Lack of transaction, think of our first project.
CAP
C A P
Consistency A P
Consistency Availability P
Consistency Availability Partition tolerance
Consistency Availability Partition tolerance Consistency
Megastore
NoSQL datastores are highly scalable, but their limited API and
loose consistency models complicate application development. “ “
In Megastore, data model is declared in a strong-typed schema
strong-typed schema CREATE TABLE User { required int64 user_id; required string name; } PRIMARY KEY(user_id), ENTITY GROUP ROOT;
Based on BigTable BigTable
PRIMARY user_id PRIMARY user_id, nyan_id
Local and Global Indexes are introduced: Local Index Find corresponding
data in entity group Global Index Find corresponding data in external groups Local Index Global Index
(user_id, born,nyan_id) For local index CREATE LOCAL INDEX NyanByBorn ON
Nyan(user_id, born); CREATE LOCAL INDEX NyanByBorn ON Nyan(user_id, born);
Consistency achieved via Paxos algorithm Paxos 2 Replicas 1 Witness
At least
Replica consists of Replication server and Coordinator Replication server Coordinator
write oversee
Witness’ Replication server only writes logs logs
Average Latency: 100-400ms Poor write throughput 100-400ms
Spanner ,finally.
We believe it is better to have application programmers deal
with performance problems due to overuse of transactions as bottlenecks arise, rather than always coding around the lack of transactions. “ “
Data model is almost identical to Megastore almost identical Basic
unit defined as Directory Directory
Data model is almost identical to Megastore almost identical Basic
unit defined as Directory Directory Same prefix key, therefore adjacent
Data model is almost identical to Megastore almost identical Basic
unit defined as Directory Directory Same prefix key, therefore adjacent Fine-grained mapping
Data model is almost identical to Megastore almost identical Basic
unit defined as Directory Directory Same prefix key, therefore adjacent Fine-grained mapping Interleaved rows gain performance
Two-phase commit for distributed transactions Two-phase commit 1Vote Coordinator Participants
Two-phase commit for distributed transactions Two-phase commit 2Commit Coordinator Participants
Locking remains a big issue Locking Especially when someone went
down, causing deadlock, literally.
Paxos is here to rescue, again Paxos will make sure
ALL logs are copied to every replicas. ALL logs
Real Innovation lies in time TrueTime API utilizes atomic clock
& GPS to determine the order of each transactions atomic clock GPS
NewSQL is the new NoSQL and Spanner is the best
example so far.