Already have a system that serves user traffic and it has become so popular that it's hitting scaling limitations? It's probably time to upgrade its architecture or move its data to a more scalable database. Learn how to do this upgrade with zero downtime and no user visible effects in my talk!
18. Considerations Before Migration
● Scale: O(100M) of users with 1B+ backups,
representing 1T+ objects
● No sharing, no search, no folders
19. Considerations Before Migration
● Scale: O(100M) of users with 1B+ backups,
representing 1T+ objects
● No sharing, no search, no folders
● Mainly write traffic, read traffic is rare and high
priority
20. Considerations Before Migration
● Scale: O(100M) of users with 1B+ backups,
representing 1T+ objects
● No sharing, no search, no folders
● Mainly write traffic, read traffic is rare and high
priority
● Spanner: global strong consistency, SQL
21. Considerations Before Migration
● Scale: O(100M) of users with 1B+ backups,
representing 1T+ objects
● No sharing, no search, no folders
● Mainly write traffic, read traffic is rare and high
priority
● Spanner: global strong consistency, SQL
● Backups can get large
22. Considerations Before Migration
● Scale: O(100M) of users with 1B+ backups,
representing 1T+ objects
● No sharing, no search, no folders
● Mainly write traffic, read traffic is rare and high
priority
● Spanner: global strong consistency, SQL
● Backups can get large
23. So how do you
migrate all this data?
Photo by Richard Evea / CC BY-SA 2.0
24. So how do you
migrate all this data?
copy/paste...
Photo by Richard Evea / CC BY-SA 2.0
26. Data migration
● Dual writes
Architecture migration
So how do you migrate all this data?
27. Data migration
● Dual writes
Architecture migration
So how do you migrate all this data?
Are we
storing data
correctly?
28. Data migration
● Dual writes
Architecture migration
● Dual writes
So how do you migrate all this data?
29. Data migration
● Dual writes
Architecture migration
● Dual writes
So how do you migrate all this data?
No effect on
latency and
error rates!
30. Data migration
● Dual writes
● Backfill data
Architecture migration
● Dual writes
So how do you migrate all this data?
31. Data migration
● Dual writes
● Backfill data
Architecture migration
● Dual writes
So how do you migrate all this data?
Do we
understand all
client behavior
and adapt the
data correctly?
32. Data migration
● Dual writes
● Backfill data
Architecture migration
● Dual writes
● Prove the stack
So how do you migrate all this data?
33. Data migration
● Dual writes
● Backfill data
Architecture migration
● Dual writes
● Prove the stack
So how do you migrate all this data?
Is the response
from the new
system same as
from the old?
34. Data migration
● Dual writes
● Backfill data
● Learn the new storage
Architecture migration
● Dual writes
● Prove the stack
So how do you migrate all this data?
35. Data migration
● Dual writes
● Backfill data
● Learn the new storage
Architecture migration
● Dual writes
● Prove the stack
So how do you migrate all this data?
New storage
mechanism or
schema?
36. Data migration
● Dual writes
● Backfill data
● Learn the new storage
Architecture migration
● Dual writes
● Prove the stack
● Harden the system
So how do you migrate all this data?
37. Data migration
● Dual writes
● Backfill data
● Learn the new storage
Architecture migration
● Dual writes
● Prove the stack
● Harden the system
So how do you migrate all this data?
How to get it to
production
readiness to
serve full load?
38. Data migration
● Dual writes
● Backfill data
● Learn the new storage
● Migrate slowly
Architecture migration
● Dual writes
● Prove the stack
● Harden the system
So how do you migrate all this data?
39. Data migration
● Dual writes
● Backfill data
● Learn the new storage
● Migrate slowly
Architecture migration
● Dual writes
● Prove the stack
● Harden the system
So how do you migrate all this data?
Validate, validate,
validate
Resource constraints?
Scale migration
40. Data migration
● Dual writes
● Backfill data
● Learn the new storage
● Migrate slowly
Architecture migration
● Dual writes
● Prove the stack
● Harden the system
● Roll out slowly
So how do you migrate all this data?
41. Data migration
● Dual writes
● Backfill data
● Learn the new storage
● Migrate slowly
Architecture migration
● Dual writes
● Prove the stack
● Harden the system
● Roll out slowly
So how do you migrate all this data?
Scale carefully
& proactively
43. Zero-Downtime Migrations at Scale
FOCUS ON INTERMEDIATE STATE
● Prepare to write code for intermediate state
>>> Quality of code corresponds to the expected lifetime
44. Zero-Downtime Migrations at Scale
FOCUS ON INTERMEDIATE STATE
● Prepare to write code for intermediate state
>>> Quality of code corresponds to the expected lifetime
● Migrate backends first
45. Zero-Downtime Migrations at Scale
FOCUS ON INTERMEDIATE STATE
● Prepare to write code for intermediate state
>>> Quality of code corresponds to the expected lifetime
● Migrate backends first
46. Zero-Downtime Migrations at Scale
FOCUS ON INTERMEDIATE STATE
● Prepare to write code for intermediate state
>>> Quality of code corresponds to the expected lifetime
● Migrate backends first
47. Zero-Downtime Migrations at Scale
FOCUS ON INTERMEDIATE STATE
● Prepare to write code for intermediate state
>>> Quality of code corresponds to the expected lifetime
● Migrate backends first
● Invest into visibility into system & migration state
49. Zero-Downtime Migrations at Scale
FOCUS ON INTERMEDIATE STATE
ROLL OUT INCREMENTALLY
● Validate scalability while affecting fewest users
50. Zero-Downtime Migrations at Scale
FOCUS ON INTERMEDIATE STATE
ROLL OUT INCREMENTALLY
● Validate scalability while affecting fewest users
● Decouple launch of services
51. Zero-Downtime Migrations at Scale
FOCUS ON INTERMEDIATE STATE
ROLL OUT INCREMENTALLY
● Validate scalability while affecting fewest users
● Decouple launch of services
52. Zero-Downtime Migrations at Scale
FOCUS ON INTERMEDIATE STATE
ROLL OUT INCREMENTALLY
● Validate scalability while affecting fewest users
● Decouple launch of services
53. Zero-Downtime Migrations at Scale
FOCUS ON INTERMEDIATE STATE
ROLL OUT INCREMENTALLY
VALIDATE & PRACTICE ROLLOUT