Skip to content
AppDues
Log in
Contact salesSign up

How an in-app purchase service stays reliable when systems fail

Reliability for a subscription platform has two separate jobs. Prevention lowers the chance that something breaks. Mitigation limits harm after a failure, including failures outside the platform's control such as poor mobile connectivity, a cloud provider outage, or an app-store outage. Perfect reliability is not realistic in a distributed system, so both layers need deliberate investment.

Prevention: reducing the chance and severity of incidents

Prevention covers the practices that make incidents less likely and less severe. Examples include automated tests, code review, staging environments, gradual canary releases, straightforward rollbacks, monitoring, deployment tooling, performance work, and simplification of the system. A dedicated infrastructure group can own these concerns, while a mature on-call rotation and collaborative incident channel help teams make urgent decisions without depending on one person. Post-incident reviews should produce tracked actions, with priority given to fixes that stop a failure from recurring. A maintained reliability roadmap can sequence storage-access refactors, database and cache migrations, and monitoring improvements. Security and organisational hygiene work, such as preparation for a SOC 2 audit, can also reduce the chance of a catastrophic incident. Even with these measures, a single database or provider can remain a single point of failure until it is replaced.

Mitigation: keeping subscribers working offline

Mitigation starts from the reality that a mobile API may be unreachable because of device connectivity, a service incident, or deliberate blocking. The SDK therefore keeps a local copy of the most recent entitlement response. For current subscribers, that cached response can preserve access during an outage, including when a subscription period would otherwise appear to have ended while the API is unavailable.

Mitigation: the two new-purchase cases

New purchases split into two cases. Without cached offerings, the device has no product mapping, so the paywall may fail to load and no purchase can be made. With cached offerings, the paywall can load and the underlying store can process the transaction, but the receipt cannot yet be sent for verification. The SDK stores that receipt and keeps retrying; once service returns, the receipt is delivered and entitlement is granted retroactively. A possible future approach is a server-controlled mode that defers verification, but that design must be weighed against exploitation risk. Serving cached offerings from an edge layer during database trouble is another possibility, although it has limited value unless the deferred-verification problem is also solved. Load shedding less important requests first is a shorter-term way to reduce impact.

Mitigation: dashboards, events and store outages

Secondary systems should be prioritised below the purchase and entitlement path. During a database outage, new receipt ingestion may stop, although some receipts may be recovered from logs and SDK retries can deliver receipts later. The dashboard may be inaccessible because it shares the central service, without data loss. Events and webhooks are typically delayed rather than lost, so consumers need logic for late delivery. Charts, customer lists and ETL output may lag slightly. Server-to-server callers need explicit error handling for unreachable APIs. Downstream systems that are directly controlled can be designed to degrade gracefully, and streaming data from the primary database can be migrated to a more reliable method after a pipeline failure. When an app store itself is unavailable, manual promotional entitlements can provide a temporary response, with automation as a longer-term improvement.

Checklist for developers who call the API directly

Direct API users should not assume SDK protections apply. For every network call, decide what the app should do if the request fails. For every event or webhook, decide what happens if delivery is delayed. A practical checklist is: cache the last known entitlement where appropriate, preserve receipts for retry, show a clear paywall error when offerings are unavailable, make webhook handling idempotent and late-tolerant, add retries and timeouts to server calls, and prioritise entitlement continuity over dashboards and reporting during an incident.

Frequently asked questions

What happens to existing subscribers when the API cannot be reached?

Existing subscribers usually keep access because the SDK stores the latest entitlement response locally and uses its timing to judge expiry. New buyers are the group most likely to be affected, especially if their device has never loaded product information.

Can a purchase complete while verification is unavailable?

If offerings were loaded before, the paywall can appear and the store transaction can proceed, but receipt verification is delayed. The SDK retains the receipt and retries delivery, so entitlement can be applied after connectivity returns.

Are analytics and webhooks lost during an outage?

Events are generally delayed rather than lost, while charts, customer lists and exports may lag. The dashboard can be unavailable during a central-service incident without implying that stored data has disappeared.

Does direct API use provide the same protection as the SDK?

Direct API callers do not receive the SDK's caching and retry behaviour automatically. They need their own handling for unreachable endpoints and delayed events.