Building Stateless Vonage Cloud Runtime Applications Building Stateless Vonage Cloud Runtime Applications

Building Stateless Vonage Cloud Runtime Applications

Junaid Mollah

Objective

Update your Vonage Cloud Runtime (VCR) applications to use stateless architecture and the VCR State SDK for any state management needs before September 24, 2026. This is required because VCR now scales applications from 0 to 2 replicas on startup. Applications that store state in-memory rather than the VCR State SDK may experience unexpected behaviour when running across multiple simultaneous instances.

Applies To

  • Vonage Cloud Runtime (VCR)
  • VCR State SDK
  • All VCR applications currently using in-memory state storage

Procedure

Why this matters?

VCR now automatically starts two replicas instead of one when your application scales up from zero. This improves platform resilience; if one node goes offline, the other replica remains available. However, if your application stores data in-memory (for example, in a variable or local cache), that data is not shared between replicas. This can cause inconsistent behaviour, such as requests being handled by a replica that does not have the expected state.

Step 1 - Audit Your Application for In-Memory State

1.1 Review your application code to identify any variables, caches, queues, or data structures that store state in-memory at the process or instance level.
1.2 Determine whether any of this in-memory state is relied upon across requests or sessions. Intentional in-memory state that is scoped to a single request is acceptable.

Step 2 - Migrate State to the VCR State SDK

2.1 For any application state that must persist or be shared across requests, replace in-memory storage with the VCR State SDK. 
2.2 Follow the Stateless Architecture Guide for full technical guidance on refactoring your application.

Step 3 - Test With Multiple Replicas

3.1 Deploy your updated application to a staging environment and test it under conditions that simulate multiple concurrent replicas.
3.2 Verify that state is consistent across requests regardless of which replica handles them.

Step 4 - Deploy to Production

4.1 Deploy your updated application to production before September 24, 2026.

Note: If your application intentionally uses in-memory state and you understand the behaviour under multi-replica scaling, no change is required. However, review the expected behaviour carefully to confirm it aligns with your use case.

Additional Information