2013 05-18-building distributed systems-php day

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

Upload: juozas-kaziukenas

Post on 18-Nov-2014

397 views

Category:

Technology


1 download

DESCRIPTION

 

TRANSCRIPT

Page 2: 2013 05-18-building distributed systems-php day

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

/ 3000 nodes = 1.1 sec. per product

Page 3: 2013 05-18-building distributed systems-php day

BUICNOSCNLKSANCLAS

Page 4: 2013 05-18-building distributed systems-php day
Page 5: 2013 05-18-building distributed systems-php day

Juozas Kaziukėnas, Lithuanian

You can call me Joe

More info http://juokaz.com

Page 6: 2013 05-18-building distributed systems-php day

ONE SERVER IS NOT ENOUGH

Page 7: 2013 05-18-building distributed systems-php day

SCALING TO MULTIPLE SERVERS

Page 8: 2013 05-18-building distributed systems-php day

INDEPENDENT NODES

Page 9: 2013 05-18-building distributed systems-php day

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

Page 10: 2013 05-18-building distributed systems-php day

TWO GENERALS PROBLEM

Page 11: 2013 05-18-building distributed systems-php day

LOCKING... LOL

Page 12: 2013 05-18-building distributed systems-php day

MYSQL TRANSACTIONS

Page 13: 2013 05-18-building distributed systems-php day

STATELESS

Page 14: 2013 05-18-building distributed systems-php day

USE TIMEOUTS

Page 15: 2013 05-18-building distributed systems-php day

ASYNCHRONOUS PROCESSING

Page 16: 2013 05-18-building distributed systems-php day

MESSAGING AND QUEUES

Page 17: 2013 05-18-building distributed systems-php day

COMMUNICATION BETWEEN PROCESSES

Page 18: 2013 05-18-building distributed systems-php day

MESSAGE SIZE

Page 19: 2013 05-18-building distributed systems-php day

GEARMAN

Page 20: 2013 05-18-building distributed systems-php day

NO RUNNING ORDER OR RELIABILITY

Page 21: 2013 05-18-building distributed systems-php day

DATA

Page 22: 2013 05-18-building distributed systems-php day

LOCATION

Page 23: 2013 05-18-building distributed systems-php day

DE-NORMALIZATION

Page 24: 2013 05-18-building distributed systems-php day

CAP THEOREM

Page 25: 2013 05-18-building distributed systems-php day

EVENTUAL CONSISTENCY

Page 26: 2013 05-18-building distributed systems-php day

ATOMIC OPERATIONS

Page 27: 2013 05-18-building distributed systems-php day

CACHE

Page 28: 2013 05-18-building distributed systems-php day

SETTING SERVERS UP

Page 29: 2013 05-18-building distributed systems-php day

CONFIGURATION

Page 30: 2013 05-18-building distributed systems-php day

PUPPET FOR SERVERS MANAGEMENT

Page 31: 2013 05-18-building distributed systems-php day

DYNAMIC SCALING

Page 32: 2013 05-18-building distributed systems-php day

SELF DISCOVERY

Page 33: 2013 05-18-building distributed systems-php day

AMAZON EC2 SPOT INSTANCES

10x cheaper than normal on-demand instances

Page 34: 2013 05-18-building distributed systems-php day
Page 35: 2013 05-18-building distributed systems-php day

24’000 CORE CLUSTER = $300/H

Page 36: 2013 05-18-building distributed systems-php day

PROTOTYPING

Page 37: 2013 05-18-building distributed systems-php day

START SMALL

Page 38: 2013 05-18-building distributed systems-php day

VAGRANT FOR VMS MANAGEMENT

Page 39: 2013 05-18-building distributed systems-php day

WHAT IS GOING ON?

Page 40: 2013 05-18-building distributed systems-php day

HARD

Page 41: 2013 05-18-building distributed systems-php day

DEBUGGING DISTRIBUTED SYSTEMS IS HARD

Page 42: 2013 05-18-building distributed systems-php day

ALL STACK LEVELS FAIL

Page 43: 2013 05-18-building distributed systems-php day

MONITORING

Page 44: 2013 05-18-building distributed systems-php day

COUNT EVERYTHING

Page 45: 2013 05-18-building distributed systems-php day

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

SYSCTL ETC...

Page 46: 2013 05-18-building distributed systems-php day

THANKS!Juozas Kaziukėnas

@juokaz