Design for Enabling/Disabling Sync

Flexible architecture for controlling sync ON/OFF via environment variables

sync controlenvironment variablesflag managementoperations
4 min read

About This Article

There are cases where you want different sync behavior between production and test environments, or temporarily stop sync. Therefore, we designed the system to control sync ON/OFF via environment variables.

Why Sync Control is Needed

Scenarios Requiring Control

Problems Without Control

  • Test data gets registered in production POS
  • All registrations fail during POS failure
  • Cannot do partial feature releases

Design for Environment Variable Control

Basic Concept

Environment-Specific Settings Example

Integration into Processing Flow

Conditional Branching Concept

Sync Processing Conditional Branching
Receive customer registration request

Receive data submitted from form

Shopify registration (always executed)

Highest priority registration as customer master

Check ENABLE_POS_SYNC

ON -> Execute POS sync / OFF -> Skip (log)

Check ENABLE_CRM_SYNC

ON -> Execute CRM sync / OFF -> Skip (log)

Registration complete

Return result to customer

Log Recording on Skip

Even when sync is skipped, leave logs for later tracking.

Can later track "why not synced to POS".

Operational Scenarios

Scenario 1: Phased Release

Phase 1: Shopify only

POS sync OFF, CRM sync OFF for production release. First verify basic functionality

Phase 2: Add POS

Change POS sync to ON. Batch sync Shopify-registered customers to POS

Phase 3: Add CRM

Change CRM sync to ON. Start marketing integration

Scenario 2: Isolation During Failure

Response When POS Failure Occurs
Normal operation

POS sync: ON, CRM sync: ON, All working normally

During failure response

POS sync: Change to OFF (immediate switch), CRM sync: ON (no impact), Customer registration continues

After recovery

POS sync: Return to ON, Batch sync registrations during failure, Return to normal operation

Scenario 3: Control in Test Environment

Design Considerations

Timing of Flag Check

Default Value Design

Benefits of This Design

For Development Team

  • Don't pollute production systems during testing
  • Enables phased releases
  • Can minimize failure impact

For Operations Team

  • Quick response possible during failures
  • Easy control during maintenance
  • Settings changeable without deployment

For Business

  • Minimized service downtime
  • Risk-reduced feature additions
  • Flexible operational structure achieved