How Jackson Used DevCycle and OpenFeature to Achieve a Zero-Downtime Migration

How Jackson Used DevCycle and OpenFeature to Achieve a Zero-Downtime Migration

Today's DevCycle Spotlight features Jackson Kasi, a developer who won the OpenFeature Aficionado prize for our first ever DevCycle Feature Flag Challenge on Dev.to where we challenged developers to build a fun or creative project using DevCycle!


Jackson won the OpenFeature Aficionado prize for the most innovative use of a DevCycle OpenFeature provider with his Zero-Downtime PostgreSQL Migration project. Judges were impressed by how Jackson utilized DevCycle feature flags to migrate a high-transaction database without any downtime, a creative solution to a real-life problem.

Using DevCycle to Enable a Zero-Downtime Migration

Jackson's project looked to migrate a PostgreSQL database that processed thousands of transactions every minute to a new environment. The challenge was to do this without taking the system offline or risking data integrity. Not an easy task!

Jackson needed a strategy that would allow him to:

  • Write to both old and new databases simultaneously during the migration.
  • Gradually switch read operations from the old database to the new one for specific user groups.
  • Ensure zero downtime and maintain data consistency throughout the migration process.

DevCycle allowed him to dynamically control which database the application interacted with, based on user contexts and feature flags.

How Jackson Used DevCycle Features to Create a Winning Project:

  1. Jackson first set up feature flags on DevCycle:
  • write: Controls write operations to the new database.
  • read: Controls read operations from the new database.
  1. Then defined the conditions to target specific user groups:
  • Testing Group:
    • Users with IDs 123 or 456.
    • Served the Testing Groups variant.
  • Customer Group:
    • All other users.
    • Served the User Groups variant.
  1. Next up was implementing dual write and conditional read in code. In the server code, he evaluated feature flags based on user context:
  • Write Operations:
    • If writeToNewDB is true, write to both databases.
    • If false, write only to the old database.
  • Read Operations:
    • If readFromNewDB is true, read from the new database.
    • If false, read from the old database.

This logic helped ensure data consistency and allowed for controlled testing.

  1. Jackson then automated the data sync with PostgreSQL's Publish-Subscribe and built Docker containers and scripts.
  2. He utilized DevCycle's Management API for dynamic control which allowed him to:
  • Update feature flags programmatically
  • Control rollout phases
  • Quickly switch read/write operations as needed.
  1. He conducted testing by enabling the new database for specific real users by targeting users from countries like India and the United States and users with a Pro subscription. This allowed him to:
  • Validate the new database under real-world conditions
  • Gather feedback and address any issues
  • Ensure performance met standards
  1. Finally, after successful testing, Jackson was ready for the final rollout! He confirmed data integrity and application performance and gradually enabled the new database for all users and completed the migration by disabling the old database.

DevCycle Features That Stood Out

We asked Jackson to share his experience using DevCycle to build his winning project:

[DevCycle is] super easy to understand. I didn't have to spend lots of time figuring out the feature management - it just let me focus on the logic. - Jackson Kasi

He also highlighted:

More about Jackson Kasi

Jackson has been working at Peacock India for the past 3 years, a services-based company where he handles the technical aspects of client's projects, while leading his team and takes immense pride in helping his customers find solutions.

His winning DevCycle project was actually inspired by a real-life situation where a client was looking to migrate their database from a self-hosted server to the cloud. This led him to build his own open-source project for handling manual and automatic back and restore operations, which he hopes will help others.

One of Jackson's current projects is a Figma plugin that helps handle asset relations operations and he's hoping it will be helpful to both developers and designers.