High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

75
Eberhard Wolff - @ewolff High Availability and Scalability: Too Expensive!– Architectures for Future Enterprise Systems Eberhard WolFreelance Consultant / Trainer Head Technolocy Advisory Board adesso AG

description

High availability and scalability used to be solved in hardware - but that is quite expensive. This presentation shows how modern technologies like virtualization, cloud, NoSQL and new software architectures provide new and cheaper solutions - that are probably also even better than the traditional approaches.

Transcript of High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Page 1: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

High Availability and Scalability: Too Expensive!–

Architectures for Future Enterprise Systems

Eberhard Wolff Freelance Consultant / Trainer

Head Technolocy Advisory Board adesso AG

Page 2: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

The Dream

Foto: http://www.vaxman.de/

Page 3: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Page 4: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Page 5: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Page 6: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Where Are We?

Page 7: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Non-functional Requirements

Page 8: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Availability

Performance

Page 9: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Performance

Availability

Page 10: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Availability: Traditional Approach

Page 11: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

•  Buy highly reliable hardware

•  Built a small cluster •  2 machines

•  Maybe add a stand-by data center

Page 12: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

•  Eventually system will fail

•  …and you are in real trouble

Page 13: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

True Story •  “Machine rebooted over night.” •  “Several times.” •  “No idea how often.” •  “No idea why…”

Page 14: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Let’s look at an example

Page 15: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Page 16: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

•  Server fails •  Application fails •  No service to the customer

•  Can we do better?

Page 17: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Page 18: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

What You Have Just Seen

Page 19: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

•  Failing systems do not impact user •  Failing systems are just restarted •  Restarts happen automatically

•  System run in different data centers •  i.e. eu-west-1a / b / c

Page 20: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Elastic Load

Balancer

System EU West 1a

System EU West 1b

System EU West 1c

Page 21: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

What It Takes… •  Virtualization •  +API to start new servers

•  Watchdog to detect failed servers •  Redundant data centers if needed

Page 22: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Can be implemented in your datacenter!

I have none.

So I used the Amazon Cloud

Page 23: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Alternatives

Page 24: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Hardware •  As cheap as it gets

•  Not highly available

•  Availability in Software

Page 25: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Traditional Servers

Page 26: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Traditional Servers

Page 27: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Highly customized

Hard to reproduce

Page 28: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

•  Depends on details •  True story: •  Order of patch

installations matter

Page 29: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Stateful

Page 30: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Redundancy in Hardware

Page 31: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Traditional Servers

Page 32: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Phoenix Servers

Page 33: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Easy to create a new server

Page 34: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Reliably reproducible

Page 35: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Stateless

Page 36: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Stateless

•  No data is lost •  New server can take load

immediately

Page 37: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Redundancy in Software

Page 38: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Implementations •  Might use a VM image •  …or a PaaS •  …or provisioning tools

Page 39: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Provisioning Tools

Page 40: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

•  Easy to create test environments •  …with other software version

Page 41: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Chaos Monkey

•  Tool by Netflix •  Video streaming •  #1 in Internet usage in the US

Page 42: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Chaos Monkey

•  Kill random machines •  To ensure system survives

hardware failures

Page 43: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Would you rather rely on…

…highly available hardware

…or a Chaos Monkey tested system?

Page 44: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Resilience

Page 45: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Performance

Availability

Page 46: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Availability

Performance

Page 47: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Performance: Traditional Approach

Page 48: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

•  Estimate •  #Users •  Use Cases •  Data volume •  Etc.

•  Add a little bit

•  Order servers

Page 49: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Performance: Problems

Page 50: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Problem: Estimate & Scaling •  Performance hard to estimate •  Coarse grained scaling •  Backfires

Page 51: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

True Story •  Initial estimate wrong •  Just need a little more •  Cluster: two servers •  Add one •  About 50% higher costs •  Order / install server takes time •  Bad performance until server

delivered

Page 52: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Problem: Load Peak •  Business has load peaks •  i.e. events that people register for

•  Need to have enough hardware for load peaks

•  Costly

Page 53: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Problem: Testing •  Testing •  Need production-like infrastructure

•  Prohibitive costs •  Only needed during tests

Page 54: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Page 55: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Elastic Load

Balancer

System EU West 1b

System EU West 1c

System EU West 1c

System EU West 1c

Page 56: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

What You Have Just Seen •  System tunes itself depending on

load •  Same approach as for availability •  +Watchdog for load

Page 57: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Easy to create a new server

Reliably reproducible

Redundancy in Software

Stateless

?

Page 58: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Stateless •  Stateless web servers: best practice •  Some Java framework don’t follow

the approach

•  Can store HTTP session externally •  i.e. RDBMS, NoSQL, Cache

Page 59: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

What about Databases?

Page 60: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Databases •  Often assumed to be

just “fast and scalable” •  Large scale doable i.e.

Data Warehouse •  Often use traditional

approach •  Cluster with two nodes •  Highly available

hardware

Page 61: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Database: Problems •  Availability •  Highly available hardware

•  Performance •  Limited scaling

•  Costly

Page 62: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Databases •  New approaches

•  Used by NoSQL databases

•  But also i.e. MySQL •  …or in system architecture

Page 63: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Databases •  Replication •  Read performance •  Availability

•  Sharding •  Spread data across servers •  Write performance

Page 64: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Scaling MongoDB

Replica 1

Shard 1

Replica 2

Replica 3

Shard 2

Replica 1

Replica 2

Replica 3

Page 65: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Availability

Replica 1

Shard 1

Replica 2

Replica 3

Shard 2

Replica 1

Replica 2

Replica 3

Page 66: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Scaling MongoDB

Replica 1

Shard 1

Replica 2

Replica 3

Replica 1

Shard 2

Replica 2

Replica 3

Replica 1

Shard 3

Replica 2

Replica 3

Page 67: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Scaling MongoDB

Replica 1

Shard 1

Replica 2

Replica 3

Shard 2

Replica 1

Replica 2

Replica 3

?

Page 68: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Replicas & Shards •  Easy to understand

•  But: Coarse grained scaling

•  Adding another shard means •  Moving lots of data •  Add quite some servers

Page 69: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Amazon Dynamo Model Server A

Shard1 Shard3

Shard4

Server B Shard2 Shard1

Shard4

Server D Shard4 Shard2

Shard3

Server C Shard3 Shard2

Shard1

Page 70: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Amazon Dynamo Model Server A

Shard1 Shard3

Shard4

Server B Shard2 Shard1

Shard4

Server D Shard4 Shard2

Shard3

Server C Shard3 Shard2

Shard1

Page 71: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Amazon Dynamo Model Server A

Shard1 Shard3

Shard4

Server B Shard2 Shard1

Shard4

Server D Shard4 Shard2

Shard3

Server C Shard3 Shard2

Shard1

New Server

Page 72: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Amazon Dynamo Model •  Published in the Dynamo paper •  Implementations:

Riak, Cassandra etc

•  Fine grained scaling •  Can immediately write to new node

Page 73: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Hardware •  Not highly reliable

•  Scales by distributing load across servers

•  No NAS, SAN, RAID…

•  As cheap as it gets

Page 74: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Sum Up •  Virtualization •  + Phoenix server •  = Better availability •  = Better performance •  = Lower costs •  Stateless servers •  NoSQL

Page 75: High Availability and Scalability: Too Expensive! Architectures for Future Enterprise Systems

Eberhard Wolff - @ewolff

Thank You!