Spanner - Google distributed database

Post on 25-May-2015

1,070 views 6 download

Tags:

transcript

Google’s globally distributed database

SPANNER

INTRODUCTION.

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

INTRODUCTION

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

OVERVIEW

• 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

EXAMPLE – SOCIAL NETWORK

SINGLE MACHINE

MULTIPLE MACHINES

MULTIPLE DATACENTERS

IMPLEMENTATION.

SERVER ORGANISATION

TRUETIME & CONCURRENCYSynchronizing Snapshots

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

IMPLEMENTATION

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

have atomic clocks

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

TIMESTAMPS – GLOBAL CLOCK

TIMESTAMP INVARIANTS

TRUETIME

TIMESTAMPS & TRUETIME

COMMIT WAIT & REPLICATION

• 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

EVALUATION.

WHAT I THINK OF THE SYSTEM

THE END