Damian Wysocki
Ride the lightning
Ride the lightning
LP
CD
Ride the lightning
LP
CD
US
Ride the lightning
LP
CD
US
Ride the lightning
LP
CD
US
Ride the lightning
LP
CD
GB
Ride the lightning
LP
CD
US
Ride the lightning
LP
CD
GB
Ride the lightning
LP
CD
EU
Ride the lightning
LP
CD
US
Ride the lightning
LP
CD
GB
Ride the lightning
LP
CD
EU
Product Type US
Product Type GB
Product Type EU
Ride the lightning
LP
CD
US
Ride the lightning
LP
CD
GB
Ride the lightning
LP
CD
EU
LP US
CD US
Ride the lightning
LP GB
CD GB
LP EU
CD EU
Migrate over 300k of products in a timeframe
After a failure, start with the last added product
Monitor the progress of the migration
Tasks are independent of each other
Able to scale
Fast and easy rollback
Zero downtime migration strategy
After a failure, start with the last added product
Monitor the progress of the migration
Tasks are independent of each other
Able to scale
Monitor errors and react to them
Fast and easy rollback
Zero downtime migration strategy
After a failure, start with the last added product
Monitor the progress of the migration
Tasks are independent of each other
Able to scale
Monitor errors and react to them
Fast and easy rollback
Zero downtime migration strategy
After a failure, start with the last added product
Monitor the progress of the migration
Tasks are independent of each other
Able to scale
Fast and easy rollback
Zero downtime migration strategy
postgres=#postgres=# select count(status), status from tasks group by status;postgres=# select count(status), status from tasks group by status;
count | status
--------+-------------
24519 | COMPLETED
2132 | DEAD
28 | ERROR
9 | IN_PROGRESS
163532 | READY
(5 rows)After a failure, start with the last added product
Monitor the progress of the migration
Tasks are independent of each other
Able to scale
Monitor errors and react to them
Fast and easy rollback
Zero downtime migration strategy
After a failure, start with the last added product
Monitor the progress of the migration
Tasks are independent of each other
Able to scale
Fast and easy rollback
Zero downtime migration strategy
total time = X + Y + Z
total time = 500ms + V + Y + Z
total time = 500ms V + Y + Z
additional ~40h
def lambda_function():
product_data = get_product_data_from_database()
response = save_product_to_saleor(product_data)
update_task_status(response)def lambda_function():
product_data = get_product_data_from_database()
response = save_product_to_saleor(product_data)
update_task_status(response)def lambda_function():
product_data = get_product_data_from_database()
response = save_product_to_saleor(product_data)
update_task_status(response)def lambda_function():
product_data = get_product_data_from_database()
response = save_product_to_saleor(product_data)
update_task_status(response)def lambda_function():
product_data = get_product_data_from_database()
response = save_product_to_saleor(product_data)
update_task_status(response)def lambda_function():
product_data = get_product_data_from_saleor()
transformed_data = transform_data(product_data)
response = save_product_to_saleor(transformed_data)
update_task_status(response)total time = X + Y + Z
total time = X + V + Y + Z
def lambda_function():
product_data = get_product_data_from_database()
response = save_product_to_saleor(product_data)
update_task_status(response)def lambda_function():
product_data = get_product_data_from_saleor()
transformed_data = transform_data(product_data)
response = save_product_to_saleor(transformed_data)
update_task_status(response)total time = X + Y + Z
total time = X + V + Y + Z
def lambda_function():
product_data = get_product_data_from_database()
response = save_product_to_saleor(product_data)
update_task_status(response)def lambda_function():
product_data = get_product_data_from_saleor()
transformed_data = transform_data(product_data)
response = save_product_to_saleor(transformed_data)
update_task_status(response)additional ~40h
send event to lambda
get product data
return product data
save product
return success message
update task status
save product
return error message
update task status
Products V1
Products V1
Products V1
Products V1
storefront.com
Products V1
storefront.com
Products V1
storefront.com
Products V1
Products V2
storefront.com
Products V1
Products V2
storefront.com
Products V1
Products V2
Products V1
Products V2
storefront.com
test.storefront.com
Products V1
Products V2
storefront.com
Products V1
Products V2
storefront.com
Products V1
Products V2
storefront.com
Products V1
Products V2
storefront.com
Products V2
storefront.com
After a failure, start with the last added product
Monitor the progress of the migration
Tasks are independent of each other
Able to scale
Monitor errors and react to them
Fast and easy rollback
Zero downtime migration strategy
After a failure, start with the last added product
Monitor the progress of the migration
Tasks are independent of each other
Able to scale
Fast and easy rollback
Zero downtime migration strategy