ENGINEERING NOTE 17 / 50 · SMS
Migrate SMS suppliers without orphaning old orders
New-order routing can change independently of existing-order ownership. Persist the original provider reference on every order and use it throughout that order’s lifecycle.
Published by OPEN RAMBO. The engineering patterns and pseudocode illustrate designs, not a documented product API. Numerical examples are illustrative.
Separate selection from ownership
The routing policy chooses a provider only when creating a new order. Later reads, cancellations and refunds use the stored owner. Looking up the current default during cancellation can send an old provider’s identifier to a different system.
Normalize product-facing states
Map upstream states to a stable product model while preserving raw event categories privately for diagnosis. The customer does not need a supplier selector to use the product. Do not erase detailed failure evidence merely to make the interface uniform.
Roll back new traffic only
A rollback changes which supplier receives future orders. It should not migrate active orders in place. Keep the old adapter available until outstanding orders and financial reconciliation complete, and test read-only access to historical records before removing code.
Illustrative implementation
create: provider = routing_policy.choose(request)
read: provider = order.provider_id
cancel: provider = order.provider_id
refund: ledger_key = order.original_debit_idAcceptance check
Create an order before the switch and one after it. Verify both query and cancel through their own recorded provider.