SlideShare a Scribd company logo
Feature Flagging
to Reduce Risk in
Database Migrations
By Patrick Kaeding
Lead Engineer at LaunchDarkly
@pkaeding @launchdarkly
About Me & LaunchDarkly
• Current: Lead Engineer at LaunchDarkly
• Past: Engineer at Atlassian
• LaunchDarkly is a cloud-based feature flag management
platform
• Separate deploying code from releasing features
• Manage risk of releasing features
• Measure impact (both KPI and Ops performance)
@pkaeding @launchdarkly
Database Migrations
• Sooner or later, it is inevitable
• Schema changes
• Moving to larger database cluster
• Moving from one kind of DB to another
@pkaeding @launchdarkly
Maintenance window
Database Migrations (Bad Old Days)
Application Old Database
@pkaeding @launchdarkly
Database Migrations (Bad Old Days)
Old Database New Database
Migrate
Maintenance window (application offline)
@pkaeding @launchdarkly
Maintenance window
Database Migrations (Bad Old Days)
Application New Database
@pkaeding @launchdarkly
Maintenance Window Approach
• Pros
 Simplicity
 Can always be used (since both code paths don’t need to
work at the same time)
• Cons
 Downtime
 If there is a problem, redeploy old code and restore from
backup
 All or nothing
@pkaeding @launchdarkly
Zero-Downtime Approach
Database Migrations (The Less Bad Days)
Application Old Database
Write
Read
@pkaeding @launchdarkly
Zero-Downtime Approach
Database Migrations (The Less Bad Days)
Application Old Database
Write
Read
New Database
@pkaeding @launchdarkly
Zero-Downtime Approach
Database Migrations (The Less Bad Days)
Application New Database
Write
Read
@pkaeding @launchdarkly
Zero-Downtime Approach
• Pros
 No downtime
 If there is a problem, you can keep running from the old
database/schema
• Cons
 All or nothing
 Need to write a reverse migration if you want to roll back
@pkaeding @launchdarkly
The Feature-Flagged Approach
Database Migrations (Modern Times)
Application Old Database
Write
Read
@pkaeding @launchdarkly
Feature-Flagged Approach
Database Migrations (Modern Times)
Application Old Database
Write 100%
Read 100%
New Database
@pkaeding @launchdarkly
Feature-Flagged Approach
Database Migrations (Modern Times)
Application Old Database
Write 100%
Read 100%
New Database
@pkaeding @launchdarkly
Feature-Flagged Approach
Database Migrations (Modern Times)
Application Old Database
Write 100%
Read 100%
New Database
@pkaeding @launchdarkly
Feature-Flagged Approach
Database Migrations (Modern Times)
Application Old Database
Write 100%
Read 100%
New Database
@pkaeding @launchdarkly
The Feature-Flagged Approach
Database Migrations (Modern Times)
Application New Database
Write
Read
@pkaeding @launchdarkly
Feature-Flagged Approach
• Pros
 No downtime
 Gradual rollout allows you to monitor
 You can roll back just as easily (or partially roll back)
 Compare results with live data
• Cons
 Longer period for both databases to be operational
@pkaeding @launchdarkly
Demonstration
@pkaeding @launchdarkly
This demo is based on a true story…
• LD Events & user data were stored in Mongo
 Events drive A/B test results, feature status indicators, auto-
complete widgets, and more
• Unsharded replica set couldn’t handle the load
• Start sharding, or move on to Dynamo
• Integrity checks found issues with null/empty values in our
dynamo code
@pkaeding @launchdarkly
What about…
• Schema changes? New fields? Restructured data?
• Which users get the new DB?
• Open source alternatives?
@pkaeding @launchdarkly
Questions
• pkaeding@launchdarkly.com
• @pkaeding
• @launchdarkly
• https://launchdarkly.com
• Blog article: http://kaed.in/db-blog
• Demo code: http://kaed.in/dbcode
@pkaeding @launchdarkly

More Related Content

What's hot (20)

PPTX
Save Azure Cost
Karthikeyan VK
 
PPTX
Successfully migrating existing databases to Azure
Red Gate Software
 
PPTX
Rapid Prototyping for Big Data with AWS
SoftServe
 
PPTX
CONDG April 23 2020 - Baskar Rao - GraphQL
Matthew Groves
 
PPTX
Quick prototyping with VulcanJS
Melek Hakim
 
PDF
JOSA TechTalk - Lambda architecture and real-time processing
Mahmoud Jalajel
 
PDF
An open source, scalable queuing solution on top of apache kafka 2019
Yaniv Bronhaim
 
PDF
Using Redgate, AKS and Azure to bring DevOps to your Database
Red Gate Software
 
PDF
Reactive Streams
Fehmi Can SAĞLAM
 
PDF
Unreal Engine 4 Blueprints: Odio e amore Roberto De Ioris - Codemotion Rome 2017
Codemotion
 
PDF
Rounds analytics pipeline
Aviv Laufer
 
PDF
DevOps in the Amazon Cloud – Learn from the pioneersNetflix suro
Gaurav "GP" Pal
 
PPTX
Dr. Elephant – Achieving Quicker, Easier, and Cost-Effective Big Data Analyti...
Akshay Rai
 
PPTX
Strategies in continuous delivery
Aviran Mordo
 
PDF
Migrating to Cassandra
Instaclustr
 
PPTX
From Grid to Cloud
gojkoadzic
 
PDF
The future of DevOps: fully left-shifted deployments with version control and...
Red Gate Software
 
PPTX
Serverless and AI: Orit Nissan-Messing, Iguazio, Serverless NYC 2018
iguazio
 
PDF
Visualizing AutoTrader Traffic in Near Real-Time with Spark Streaming-(Jon Gr...
Spark Summit
 
PDF
Extending JIRA to Enable High Volume KPI Benchmarking - Keyur Patel
Atlassian
 
Save Azure Cost
Karthikeyan VK
 
Successfully migrating existing databases to Azure
Red Gate Software
 
Rapid Prototyping for Big Data with AWS
SoftServe
 
CONDG April 23 2020 - Baskar Rao - GraphQL
Matthew Groves
 
Quick prototyping with VulcanJS
Melek Hakim
 
JOSA TechTalk - Lambda architecture and real-time processing
Mahmoud Jalajel
 
An open source, scalable queuing solution on top of apache kafka 2019
Yaniv Bronhaim
 
Using Redgate, AKS and Azure to bring DevOps to your Database
Red Gate Software
 
Reactive Streams
Fehmi Can SAĞLAM
 
Unreal Engine 4 Blueprints: Odio e amore Roberto De Ioris - Codemotion Rome 2017
Codemotion
 
Rounds analytics pipeline
Aviv Laufer
 
DevOps in the Amazon Cloud – Learn from the pioneersNetflix suro
Gaurav "GP" Pal
 
Dr. Elephant – Achieving Quicker, Easier, and Cost-Effective Big Data Analyti...
Akshay Rai
 
Strategies in continuous delivery
Aviran Mordo
 
Migrating to Cassandra
Instaclustr
 
From Grid to Cloud
gojkoadzic
 
The future of DevOps: fully left-shifted deployments with version control and...
Red Gate Software
 
Serverless and AI: Orit Nissan-Messing, Iguazio, Serverless NYC 2018
iguazio
 
Visualizing AutoTrader Traffic in Near Real-Time with Spark Streaming-(Jon Gr...
Spark Summit
 
Extending JIRA to Enable High Volume KPI Benchmarking - Keyur Patel
Atlassian
 

Viewers also liked (10)

PDF
The Staging Server is Dead! Long Live the Staging Server!
LaunchDarkly
 
PDF
Faster & Less Risky Releases with Feature Flags
LaunchDarkly
 
PPTX
Feature Flagging to Reduce Risk in Database Migrations
LaunchDarkly
 
PDF
Feature flags to speed up & de risk development
LaunchDarkly
 
PPTX
Waffle: A feature switch/flag/toggle application for Django
tobych
 
PPTX
TAO Refresh - Automation of Data Spike Flagging Quality
Sathishkumar Samiappan
 
PPT
ImplementingChangeTrackingAndFlagging
Suite Solutions
 
PDF
Feature flagsareflawed
Stephen Young
 
PDF
The Cultural Changes of Feature Flagging
LaunchDarkly
 
PDF
Continuous Delivery and Feature Flagging
LaunchDarkly
 
The Staging Server is Dead! Long Live the Staging Server!
LaunchDarkly
 
Faster & Less Risky Releases with Feature Flags
LaunchDarkly
 
Feature Flagging to Reduce Risk in Database Migrations
LaunchDarkly
 
Feature flags to speed up & de risk development
LaunchDarkly
 
Waffle: A feature switch/flag/toggle application for Django
tobych
 
TAO Refresh - Automation of Data Spike Flagging Quality
Sathishkumar Samiappan
 
ImplementingChangeTrackingAndFlagging
Suite Solutions
 
Feature flagsareflawed
Stephen Young
 
The Cultural Changes of Feature Flagging
LaunchDarkly
 
Continuous Delivery and Feature Flagging
LaunchDarkly
 
Ad

Similar to Feature Flagging to Reduce Risk in Database Migrations (20)

PDF
How to Migrate Without Downtime
Envision Technology Advisors
 
PPTX
Migrating Millions of Users with Debezium, Apache Kafka, and an Acyclic Synch...
MD Sayem Ahmed
 
PDF
Zero Downtime Migrations at Scale
Aysylu Greenberg
 
PDF
App Migration Services for Modern Businesses
Shiv Technolabs Pvt. Ltd.
 
PPTX
Come Fly With Me: Database Migration Patterns with Flyway
Joris Kuipers
 
PDF
Zero-downtime Deployment on Kubernetes
All Things Open
 
PPTX
Webinar: Migrating from RDBMS to MongoDB (June 2015)
MongoDB
 
PDF
Application Migration for Business Growth
Shiv Technolabs Pvt. Ltd.
 
PDF
Geek Sync | Planning a SQL Server to Azure Migration in 2021 - Brent Ozar
IDERA Software
 
PPTX
Flyway (33rd Degree)
Axel Fontaine
 
PPTX
Checklist for Upgrades and Migrations
Markus Flechtner
 
PDF
webinarcloudmigration-6181903.pdf
ankitDhebar
 
PDF
Cloud Migration: Moving Data and Infrastructure to the Cloud
Safe Software
 
PDF
Are You Ready for 12c? Data Migration and Upgrade Best Practices
Performance Tuning Corporation
 
PDF
[DevDay2018] Automate database migration using flyway framework - By Karthick...
DevDay Da Nang
 
PPTX
Flyway: The agile database migration framework for Java
Axel Fontaine
 
PDF
Migrating from RDBMS to MongoDB
MongoDB
 
PPTX
PMI Presentation2
Vincent B. Goldsmith, PMP, CSM
 
PPTX
Everything You Need to Know About Migrating Applications
OutSystems
 
PPTX
Seminar - JBoss Migration
Xebia IT Architects
 
How to Migrate Without Downtime
Envision Technology Advisors
 
Migrating Millions of Users with Debezium, Apache Kafka, and an Acyclic Synch...
MD Sayem Ahmed
 
Zero Downtime Migrations at Scale
Aysylu Greenberg
 
App Migration Services for Modern Businesses
Shiv Technolabs Pvt. Ltd.
 
Come Fly With Me: Database Migration Patterns with Flyway
Joris Kuipers
 
Zero-downtime Deployment on Kubernetes
All Things Open
 
Webinar: Migrating from RDBMS to MongoDB (June 2015)
MongoDB
 
Application Migration for Business Growth
Shiv Technolabs Pvt. Ltd.
 
Geek Sync | Planning a SQL Server to Azure Migration in 2021 - Brent Ozar
IDERA Software
 
Flyway (33rd Degree)
Axel Fontaine
 
Checklist for Upgrades and Migrations
Markus Flechtner
 
webinarcloudmigration-6181903.pdf
ankitDhebar
 
Cloud Migration: Moving Data and Infrastructure to the Cloud
Safe Software
 
Are You Ready for 12c? Data Migration and Upgrade Best Practices
Performance Tuning Corporation
 
[DevDay2018] Automate database migration using flyway framework - By Karthick...
DevDay Da Nang
 
Flyway: The agile database migration framework for Java
Axel Fontaine
 
Migrating from RDBMS to MongoDB
MongoDB
 
Everything You Need to Know About Migrating Applications
OutSystems
 
Seminar - JBoss Migration
Xebia IT Architects
 
Ad

Recently uploaded (20)

PPTX
Element 11. ELECTRICITY safety and hazards
merrandomohandas
 
PPTX
Introduction to Basic Renewable Energy.pptx
examcoordinatormesu
 
PPTX
Introduction to Design of Machine Elements
PradeepKumarS27
 
PDF
Design Thinking basics for Engineers.pdf
CMR University
 
PDF
International Journal of Information Technology Convergence and services (IJI...
ijitcsjournal4
 
PDF
MAD Unit - 2 Activity and Fragment Management in Android (Diploma IT)
JappanMavani
 
PPTX
The Role of Information Technology in Environmental Protectio....pptx
nallamillisriram
 
PPTX
Heart Bleed Bug - A case study (Course: Cryptography and Network Security)
Adri Jovin
 
PDF
Pressure Measurement training for engineers and Technicians
AIESOLUTIONS
 
PDF
Halide Perovskites’ Multifunctional Properties: Coordination Engineering, Coo...
TaameBerhe2
 
PDF
Biomechanics of Gait: Engineering Solutions for Rehabilitation (www.kiu.ac.ug)
publication11
 
PDF
Introduction to Productivity and Quality
মোঃ ফুরকান উদ্দিন জুয়েল
 
PPTX
Mechanical Design of shell and tube heat exchangers as per ASME Sec VIII Divi...
shahveer210504
 
PPTX
Solar Thermal Energy System Seminar.pptx
Gpc Purapuza
 
PDF
smart lot access control system with eye
rasabzahra
 
PPTX
Knowledge Representation : Semantic Networks
Amity University, Patna
 
PPTX
GitOps_Without_K8s_Training_detailed git repository
DanialHabibi2
 
PDF
Electrical Engineer operation Supervisor
ssaruntatapower143
 
DOC
MRRS Strength and Durability of Concrete
CivilMythili
 
PDF
Basic_Concepts_in_Clinical_Biochemistry_2018كيمياء_عملي.pdf
AdelLoin
 
Element 11. ELECTRICITY safety and hazards
merrandomohandas
 
Introduction to Basic Renewable Energy.pptx
examcoordinatormesu
 
Introduction to Design of Machine Elements
PradeepKumarS27
 
Design Thinking basics for Engineers.pdf
CMR University
 
International Journal of Information Technology Convergence and services (IJI...
ijitcsjournal4
 
MAD Unit - 2 Activity and Fragment Management in Android (Diploma IT)
JappanMavani
 
The Role of Information Technology in Environmental Protectio....pptx
nallamillisriram
 
Heart Bleed Bug - A case study (Course: Cryptography and Network Security)
Adri Jovin
 
Pressure Measurement training for engineers and Technicians
AIESOLUTIONS
 
Halide Perovskites’ Multifunctional Properties: Coordination Engineering, Coo...
TaameBerhe2
 
Biomechanics of Gait: Engineering Solutions for Rehabilitation (www.kiu.ac.ug)
publication11
 
Introduction to Productivity and Quality
মোঃ ফুরকান উদ্দিন জুয়েল
 
Mechanical Design of shell and tube heat exchangers as per ASME Sec VIII Divi...
shahveer210504
 
Solar Thermal Energy System Seminar.pptx
Gpc Purapuza
 
smart lot access control system with eye
rasabzahra
 
Knowledge Representation : Semantic Networks
Amity University, Patna
 
GitOps_Without_K8s_Training_detailed git repository
DanialHabibi2
 
Electrical Engineer operation Supervisor
ssaruntatapower143
 
MRRS Strength and Durability of Concrete
CivilMythili
 
Basic_Concepts_in_Clinical_Biochemistry_2018كيمياء_عملي.pdf
AdelLoin
 

Feature Flagging to Reduce Risk in Database Migrations

  • 1. Feature Flagging to Reduce Risk in Database Migrations By Patrick Kaeding Lead Engineer at LaunchDarkly @pkaeding @launchdarkly
  • 2. About Me & LaunchDarkly • Current: Lead Engineer at LaunchDarkly • Past: Engineer at Atlassian • LaunchDarkly is a cloud-based feature flag management platform • Separate deploying code from releasing features • Manage risk of releasing features • Measure impact (both KPI and Ops performance) @pkaeding @launchdarkly
  • 3. Database Migrations • Sooner or later, it is inevitable • Schema changes • Moving to larger database cluster • Moving from one kind of DB to another @pkaeding @launchdarkly
  • 4. Maintenance window Database Migrations (Bad Old Days) Application Old Database @pkaeding @launchdarkly
  • 5. Database Migrations (Bad Old Days) Old Database New Database Migrate Maintenance window (application offline) @pkaeding @launchdarkly
  • 6. Maintenance window Database Migrations (Bad Old Days) Application New Database @pkaeding @launchdarkly
  • 7. Maintenance Window Approach • Pros  Simplicity  Can always be used (since both code paths don’t need to work at the same time) • Cons  Downtime  If there is a problem, redeploy old code and restore from backup  All or nothing @pkaeding @launchdarkly
  • 8. Zero-Downtime Approach Database Migrations (The Less Bad Days) Application Old Database Write Read @pkaeding @launchdarkly
  • 9. Zero-Downtime Approach Database Migrations (The Less Bad Days) Application Old Database Write Read New Database @pkaeding @launchdarkly
  • 10. Zero-Downtime Approach Database Migrations (The Less Bad Days) Application New Database Write Read @pkaeding @launchdarkly
  • 11. Zero-Downtime Approach • Pros  No downtime  If there is a problem, you can keep running from the old database/schema • Cons  All or nothing  Need to write a reverse migration if you want to roll back @pkaeding @launchdarkly
  • 12. The Feature-Flagged Approach Database Migrations (Modern Times) Application Old Database Write Read @pkaeding @launchdarkly
  • 13. Feature-Flagged Approach Database Migrations (Modern Times) Application Old Database Write 100% Read 100% New Database @pkaeding @launchdarkly
  • 14. Feature-Flagged Approach Database Migrations (Modern Times) Application Old Database Write 100% Read 100% New Database @pkaeding @launchdarkly
  • 15. Feature-Flagged Approach Database Migrations (Modern Times) Application Old Database Write 100% Read 100% New Database @pkaeding @launchdarkly
  • 16. Feature-Flagged Approach Database Migrations (Modern Times) Application Old Database Write 100% Read 100% New Database @pkaeding @launchdarkly
  • 17. The Feature-Flagged Approach Database Migrations (Modern Times) Application New Database Write Read @pkaeding @launchdarkly
  • 18. Feature-Flagged Approach • Pros  No downtime  Gradual rollout allows you to monitor  You can roll back just as easily (or partially roll back)  Compare results with live data • Cons  Longer period for both databases to be operational @pkaeding @launchdarkly
  • 20. This demo is based on a true story… • LD Events & user data were stored in Mongo  Events drive A/B test results, feature status indicators, auto- complete widgets, and more • Unsharded replica set couldn’t handle the load • Start sharding, or move on to Dynamo • Integrity checks found issues with null/empty values in our dynamo code @pkaeding @launchdarkly
  • 21. What about… • Schema changes? New fields? Restructured data? • Which users get the new DB? • Open source alternatives? @pkaeding @launchdarkly
  • 22. Questions • [email protected] • @pkaeding • @launchdarkly • https://launchdarkly.com • Blog article: http://kaed.in/db-blog • Demo code: http://kaed.in/dbcode @pkaeding @launchdarkly