The Fluid

Architecture
Your Host Tonight

Image source: my 6 yo daughter
Alex FernándezDeveloper with 15+ years of experience
What We will cover
How to Flow
Flow with Requirements
Flow with Operational Constraints
Don't Stop Flowing
How to Flow

Turbulent Flow is Irreversible

It can be fun, but we don't want that kind of fun
Laminar Flow is Reversible
And we like when things flow smoothly!
Flow with Requirements
Circumstances Change

And you should adapt to them
Fashion in ARchitecture
80s: minicomputers & terminals
90s: client-server
00s: three tiers
10s: NoSQL
The Perfect Architecture

Does not exist
Modern Architecture

Or so we thought
Slightly More modern architecture

Spot the seven differences
Flow With Constraints

Flow with capacity planning

From 4 to 132 krps in two years
Flow for Operational Stability
From 38 to 112 krps in one day
Flow to Lower Costs
How Fast Can You Migrate…
… to a new cloud provider?
… to a new hosting company?
… to your own datacenter?
It matters because costs escalate quickly
Database migrations

are painful efforts
but shouldn't be
How to Migrate Your Database
Build a compatibility layer
Avoid downtime at all costs
Treat access and data separately
Have a reverse migration strategy…
… but try not to use it
Case Studies
Warning: may not apply to your situation
MediaSmart Mobile
Migration to Amazon virtual private cloud
Tried on 2015-03-03
Reversed on 2015-03-05
Due to an unrelated failure (!)
Tried again on 2015-03-11
Migrated EU on Friday the 13th
because who's afraid of superstitions?
Migrated from AWS to Facebook datacenters
Year-long effort, from 2013-03 to ~2014-03
Had to go through AWS VPC first
Neti — a dynamic iptables manipulation daemon in Python
Three weeks into VPC, two weeks to FB
Bare minimum approach (!)
Mr X
Also migrating datacenters
Will start sending 10% of traffic
from new datacenter
Inter-datacenter latencies
Don't Stop Flowing
How to Migrate Anything
Build a compatibility layer
Avoid downtime at all costs
Have a reverse migration strategy…
Unstable Equilibrium

The only way to fly supersonic fighters
Living with Unstabilities
Use safe defaults
Fail safely
Always monitor
There Will Be Mistakes
Get over it
Move Fast, Break Things

Or stay put and never break anything

Or anything in between
Thanks!

The Fluid Architecture
By Alex Fernández
The Fluid Architecture
Charla para MadridJS, 2015-03-26
- 2,985