Spanner - Google distributed database

24
Google’s globally distributed database SPANNER

Transcript of Spanner - Google distributed database

Page 1: Spanner - Google distributed database

Google’s globally distributed database

SPANNER

Page 2: Spanner - Google distributed database

INTRODUCTION.

Page 3: Spanner - Google distributed database

• Built and Deployed at Google• Scalable• Multi-version• Globally distributed• Synchronously-replicated

INTRODUCTION

Page 4: Spanner - Google distributed database

• General Purpose Transactions (ACID)• Directory Placement• SQL query language• Schematized tables, Semi-relational data model

OVERVIEW

Page 5: Spanner - Google distributed database

• Lock-free distributed read transactions• External consistency of distributed transactions• Integration of concurrency control, replication,

and 2PC• Interval-based global time – TrueTime – GPS and

atomic clock powered• More control to applications

SPECIAL FEATURES

Page 6: Spanner - Google distributed database

EXAMPLE – SOCIAL NETWORK

Page 7: Spanner - Google distributed database

SINGLE MACHINE

Page 8: Spanner - Google distributed database

MULTIPLE MACHINES

Page 9: Spanner - Google distributed database

MULTIPLE DATACENTERS

Page 10: Spanner - Google distributed database

IMPLEMENTATION.

Page 11: Spanner - Google distributed database

SERVER ORGANISATION

Page 12: Spanner - Google distributed database

TRUETIME & CONCURRENCYSynchronizing Snapshots

Page 13: Spanner - Google distributed database

GLOBAL CONSISTENCY

‘As a distributed-systems developer, you’re taught from — I want to say childhood —

not to trust time. What we did is find a way that we could trust time — and understand

what it meant to trust time.’‘We wanted something that we were

confident in. It’s a time reference that’s owned by Google.’

— Andrew Fikes

Page 14: Spanner - Google distributed database

IMPLEMENTATION

• Set of time master machines per data center• A time slave daemon per machine• Most masters have GPS, Armageddon masters

have atomic clocks

Page 15: Spanner - Google distributed database

GLOBAL CONSISTENCY

• Global wall-clock time == External Consistency• Commit order respects global wall-time order• Timestamp order respects global wall-time order• Given that timestamp order == commit order

Page 16: Spanner - Google distributed database

TIMESTAMPS – GLOBAL CLOCK

Page 17: Spanner - Google distributed database

TIMESTAMP INVARIANTS

Page 18: Spanner - Google distributed database

TRUETIME

Page 19: Spanner - Google distributed database

TIMESTAMPS & TRUETIME

Page 20: Spanner - Google distributed database

COMMIT WAIT & REPLICATION

Page 21: Spanner - Google distributed database

• Used in situations requiring durability (replicating a file or database)

• Makes progress even during periods of partial unresponsiveness

• Roles : Client, Acceptor (Voters), Proposer, Learner, Leader

PAXOS PROTOCOL

Page 22: Spanner - Google distributed database

EVALUATION.

Page 23: Spanner - Google distributed database

WHAT I THINK OF THE SYSTEM

Page 24: Spanner - Google distributed database

THE END