The problem

A move to the cloud is a design decision, not a copy

Rented rackcontract ends in 6 monthsFirewallWeb 1Web 2AppDatabase200 GBNAS500 GB filesThe booking app20,000 bookings a day500 GB of files (photos, PDFs), 200 GB databaseWanted: 99.9% availableAsked: what will it cost a month?A move to the cloud is a design decision, not a copy. Start from what the app needs.A booking app runs on four servers and a file store in a rented rack, and the contract ends in six months. It takes 20,000 bookings aday, keeps 500 GB of files and a 200 GB database, and the business wants it up 99.9% of the time. The question from the finance team is short:what will it cost each month? Answering it needs an estimate first, then a design, then a price for that design.

Four servers and a NAS in a rack whose contract ends. 20,000 bookings a day, 99.9% availability wanted.

The estimate

Size from the numbers, not from the old hardware

Requests20,000 bookings × 30 requests each ÷ 86,400 s = 6.9 a second on average× 3.5 at the evening peak = about 24 a second: two small web servers, with roomFiles500 GB today, growing 15 GB a month: 680 GB in a year, 1040 GB in threeDatabase200 GB; the server peaks at 15% of 4 cores, so 2 cores are enoughDowntime99.9% of a 730-hour month allows 43.8 minutes downSize from the numbers, not from the old hardware: the old servers were bought for growth that never came.About 24 requests a second at peak is a light load for two small machines. The files will pass 1040 GB in three years, so they belong onstorage that grows by itself. The database server has 4 cores and uses 15% of them. And 99.9% leaves 43.8 minutes of downtime amonth, which is the number every design choice is checked against.

About 24 requests a second at peak; files grow 15 GB a month; the database needs 2 cores; 99.9% allows 43.8 minutes down.

Lift and shift

Lift and shift: the same machines, rented by the hour

One zonefour VMs, as in the rackWebWebAppDatabasefiles on a 500 GB disk on the app VMA month, example list prices3 VMs, web and app (m5.large)$2101 VM, database (m5.xlarge)$140Disks: 3 × 50 GB + 250 GB + 500 GB of files$72Data out, 600 GB$45Total$467Lift and shift is the fastest move: the same four machines, rented by the hour, for about $467 a month.Each server becomes a virtual machine of a similar size in one zone, and the files move to a large disk. It can be done in weeks andnothing in the app changes. At example AWS list prices it costs about $467 a month, which finance likes. Before agreeing, check itagainst the estimate: does it give 99.9%, and is the money going where the work is?

Four VMs in one zone and a big disk: about $467 a month at example list prices.

The cause

Lift and shift moved the rack, with every weakness of the rack

One zone: a single place to failone VM is promised 99.5%: 219 min down a month, above the 43.8 min allowedThe database VM is still yourspatching, backups, failover: the same night work as in the rackFiles on a diska fixed size to grow by hand, and lost with the VM if not backed upMachines run all nightat about 5% load, billed for every hourLift and shift moved the rack, and with it every weakness of the rack.AWS promises 99.5% for a single instance, which allows 219 minutes down a month against 43.8 allowed. Across two or morezones the promise is 99.99%. The database still needs someone to patch it, back it up and fail it over. The file disk must be grown by hand.And four machines sized for the peak run at a few percent all night. The bill was low because the design kept the old risks.

One VM is promised 99.5%, below the 99.9% target. The database is still yours to run, and machines idle all night.

The redesign

Two zones and managed parts meet the target, and cost more

CDNLoad balancerZone AWebAppMySQLZone BWebAppStandbyObject storage500 GB filesA monthBefore $467After $718Spread over two zones with managed parts, the app meets 99.9%, and the bill rises to about $718.Web servers sit in two zones behind a load balancer and scale between 2 and 4. The database becomes managed MySQL with a standby in theother zone that takes over in a minute or two, with backups included; at 15% use it drops to 2 cores. Files move to object storage, whichgrows by itself, and a CDN serves them near users. More parts are running, so it costs more: about $718 against $467.

A load balancer over two zones, managed MySQL with a standby, files in object storage, a CDN: about $718 a month.

The trade-off

Pay for what the target needs, then commit to the floor

Lift and shift$467 one zone, your databaseRedesigned, on-demand$718 two zones, managedRedesigned, 1-year commitment$559 30% off the always-on partChosen: the redesign with a 1-year commitment on the floor (4 VMs and the database) and on-demand above it: $559 a month.Pay for what the target needs, then commit to the part that never switches off.The managed database costs more than a VM, but nobody patches it, backs it up or fails it over at night. Committing for a year to the floorthat always runs, $530 a month on-demand, takes about 30% off it, at the price of paying even if the app shrinks. The extra web servers stayon-demand because they come and go. The result is $92 a month more than lift and shift, for an app that meets its target.

A one-year commitment on the always-on part brings the redesign to about $559 a month.

The design

The same design on every provider; only the names change

PartAWSAzureGoogle CloudLessonCDNCloudFrontAzure Front DoorCloud CDNLesson 3Load balancerApplication Load BalancerApplication GatewayCloud Load BalancingLesson 6VMs that scaleEC2 Auto ScalingVM Scale SetsManaged instance groupsLesson 4Managed MySQL, standbyRDS Multi-AZAzure Database for MySQLCloud SQL, high availabilityLesson 7FilesS3Blob StorageCloud StorageLesson 5Who may do whatIAM rolesManaged identitiesService accountsLesson 8The billSavings PlansReservationsCommitted use discountsLesson 9The design is the same on every provider. Only the names change.Each part of the redesign exists on AWS, Azure and Google Cloud, under its own name. Design with the ideas first, then pick the provideron what the company already knows, where its users are, and price. Each row opens the lesson that teaches that part. Prices on thispage are example AWS list prices; the same design on Azure or Google Cloud lands in the same range.

CDN, load balancer, scaling VMs, managed MySQL, file storage, identity and commitments, on AWS, Azure and Google Cloud.

A real case

Netflix rebuilt for the cloud rather than copying

August 2008a database corruptionstops DVD shipping for 3 daysSeven years, rebuiltnot a forklift: most systemsrewritten for the cloud, on AWSJanuary 2016last data centre parts ofstreaming shut downSince 20088 times the streaming members; viewing up about a thousand timesAvailabilityrising steadily, nearing the goal of four ninesCostnot the reason; cost per streaming start became a fraction of the data centre’sNetflix moved to the cloud to remove single points of failure, and chose to rebuild rather than copy.After a database corruption stopped DVD shipping for three days in 2008, Netflix decided to move from one large database in its owndata centre to distributed systems in the cloud. It chose not to forklift its systems unchanged, because that would carry the datacentre’s limits with them. The move took seven years. Our booking app made the same choice at a small scale: redesign, not copy.

After a 2008 database failure stopped DVD shipping for three days, Netflix spent seven years rebuilding on AWS.

Lesson complete

You finished “Moving a booking app to the cloud”

Nicely done.

Open in a new tab