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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Szu-Kai Hsu (brucehsu)
November 07, 2012
Technology
330
4
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
由Spanner來看Google資料庫的前世今生
2012年秋,網際網路資料庫 @ 國立中正大學資工所
Szu-Kai Hsu (brucehsu)
November 07, 2012
More Decks by Szu-Kai Hsu (brucehsu)
See All by Szu-Kai Hsu (brucehsu)
Running Life Lean
brucehsu
0
190
Core Unleashed Part II: Introduction to GobiesVM (and STM) @ RubyKaigi 2014
brucehsu
0
2.2k
[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
91
Building Web 2.0 APIs
brucehsu
1
160
Rapid Web Development by Example
brucehsu
3
3.2k
TechWed@CCU #0
brucehsu
2
560
Chromium OS
brucehsu
2
240
Other Decks in Technology
See All in Technology
41歳でAWSが好きすぎてITエンジニアになったおっさんの話
yama3133
1
740
Playwright × AI Agent でE2Eテストはどう変わるか AI駆動テストの可能性と実用検証の結果
taiga7543
2
810
キャリアLT会#3
beli68
2
240
AI、CDK と協働する Full TypeScript アプリケーション開発 / Full TypeScript Application with AI and CDK
geekplus_tech
2
480
SoccerMaster: A Vision Foundation Model for Soccer Understanding
kzykmyzw
0
170
CDKで書くECSのベストプラクティス、 改めて考え直す2026 #cdkconf2026
makies
3
940
『モデル + ハーネス』で読み解く AIエージェント入門
oracle4engineer
PRO
2
170
SRENEXT_2026_Chairs__Talks_in_Tamachi.sre.pdf
srenext
1
150
kaonavi Tech Night#1
kaonavi
0
160
人とエージェントが高め合う協業設計
kintotechdev
0
760
20260720_クラウド女子会×PyLadiesTokyoコラボ Amazon Bedrock ハンズオン用資料
yuuka51
1
110
Alphaモジュール使っていいのかい!?いけないのかい!?どっちなんだいっ!?
watany
1
320
Featured
See All Featured
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.6k
Darren the Foodie - Storyboard
khoart
PRO
3
3.5k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
410
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.1k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
72
40k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.6k
Git: the NoSQL Database
bkeepers
PRO
432
67k
GitHub's CSS Performance
jonrohan
1033
470k
Side Projects
sachag
455
43k
Being A Developer After 40
akosma
91
590k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
640
Build your cross-platform service in a week with App Engine
jlugia
234
18k
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.