46
BUILDING DISTRIBUTED SYSTEMS Juozas Kaziukėnas // juokaz.com // @juokaz

Building distributed systems - PhpDay 2013

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 2: Building distributed systems - PhpDay 2013

300’000’000 products/ 24 hours = 12’500’00 products/ 3600 seconds = 3’472 products

/ 3000 nodes = 1.1 sec. per product

Page 3: Building distributed systems - PhpDay 2013

BUICNOSCNLKSANCLAS

Page 4: Building distributed systems - PhpDay 2013
Page 5: Building distributed systems - PhpDay 2013

Juozas Kaziukėnas, Lithuanian

You can call me Joe

More info http://juokaz.com

Page 6: Building distributed systems - PhpDay 2013

ONE SERVER IS NOT ENOUGH

Page 7: Building distributed systems - PhpDay 2013

SCALING TO MULTIPLE SERVERS

Page 8: Building distributed systems - PhpDay 2013

INDEPENDENT NODES

Page 9: Building distributed systems - PhpDay 2013

1 TO 2 SERVERS = HARD2 TO 100 SERVERS = EASY .

Page 10: Building distributed systems - PhpDay 2013

TWO GENERALS PROBLEM

Page 11: Building distributed systems - PhpDay 2013

LOCKING... LOL

Page 12: Building distributed systems - PhpDay 2013

MYSQL TRANSACTIONS

Page 13: Building distributed systems - PhpDay 2013

STATELESS

Page 14: Building distributed systems - PhpDay 2013

USE TIMEOUTS

Page 15: Building distributed systems - PhpDay 2013

ASYNCHRONOUS PROCESSING

Page 16: Building distributed systems - PhpDay 2013

MESSAGING AND QUEUES

Page 17: Building distributed systems - PhpDay 2013

COMMUNICATION BETWEEN PROCESSES

Page 18: Building distributed systems - PhpDay 2013

MESSAGE SIZE

Page 19: Building distributed systems - PhpDay 2013

GEARMAN

Page 20: Building distributed systems - PhpDay 2013

NO RUNNING ORDER OR RELIABILITY

Page 21: Building distributed systems - PhpDay 2013

DATA

Page 22: Building distributed systems - PhpDay 2013

LOCATION

Page 23: Building distributed systems - PhpDay 2013

DE-NORMALIZATION

Page 24: Building distributed systems - PhpDay 2013

CAP THEOREM

Page 25: Building distributed systems - PhpDay 2013

EVENTUAL CONSISTENCY

Page 26: Building distributed systems - PhpDay 2013

ATOMIC OPERATIONS

Page 27: Building distributed systems - PhpDay 2013

CACHE

Page 28: Building distributed systems - PhpDay 2013

SETTING SERVERS UP

Page 29: Building distributed systems - PhpDay 2013

CONFIGURATION

Page 30: Building distributed systems - PhpDay 2013

PUPPET FOR SERVERS MANAGEMENT

Page 31: Building distributed systems - PhpDay 2013

DYNAMIC SCALING

Page 32: Building distributed systems - PhpDay 2013

SELF DISCOVERY

Page 33: Building distributed systems - PhpDay 2013

AMAZON EC2 SPOT INSTANCES

10x cheaper than normal on-demand instances

Page 34: Building distributed systems - PhpDay 2013
Page 35: Building distributed systems - PhpDay 2013

24’000 CORE CLUSTER = $300/H

Page 36: Building distributed systems - PhpDay 2013

PROTOTYPING

Page 37: Building distributed systems - PhpDay 2013

START SMALL

Page 38: Building distributed systems - PhpDay 2013

VAGRANT FOR VMS MANAGEMENT

Page 39: Building distributed systems - PhpDay 2013

WHAT IS GOING ON?

Page 40: Building distributed systems - PhpDay 2013

HARD

Page 41: Building distributed systems - PhpDay 2013

DEBUGGING DISTRIBUTED SYSTEMS IS HARD

Page 42: Building distributed systems - PhpDay 2013

ALL STACK LEVELS FAIL

Page 43: Building distributed systems - PhpDay 2013

MONITORING

Page 44: Building distributed systems - PhpDay 2013

COUNT EVERYTHING

Page 45: Building distributed systems - PhpDay 2013

UPTIME, VMSTAT, NETSTAT, IOSTAT, MPSTAT, TCPDUMP, GDB, VALGRIND, ULIMIT,

SYSCTL ETC...

Page 46: Building distributed systems - PhpDay 2013

THANKS!Juozas Kaziukėnas

@juokaz