Updated on 2025-05-07 GMT+08:00

Cutover with Writes Stopped but Reads Continued

For some applications, browsing services may remain available during cutover to ensure a smooth user experience, while write operations are temporarily halted to ensure data consistency. This is useful, for example, for some e-commerce apps. During such a cutover, customers can still browse the website but cannot place orders. If they do play an order, a friendly reminder is displayed telling them the system is upgrading and will recover at 4:00 a.m., for instance.

  1. Comparing different ways of cutover with writes stopped but reads continued

Four options are available:

Table 1 Four ways of cutting over a system with writes stopped but reads continued

Solution

Description

Scenarios

Operation Complexity

Changes Required

Gateway blocking

The service gateway blocks write requests but allow read requests at the access layer.

A unified gateway blocks write requests and returns friendly reminders for write requests.

Easy to use

No changes required

Blocking writes while allowing read requests

Shut down the write service or the corresponding interface, but keep the read service or the corresponding interface alive.

Read/write splitting is enabled for applications, so that each service allows only read or write operations.

Easy to use

No changes required

Enable read/write splitting for applications first

Modify the application code to enable read/write splitting.

Read/write splitting is not enabled for applications.

Complex

Heavy workload

Revoke write permissions at the middleware and data layers

Revoke the write permissions for related accounts at the middleware and data layers.

When write permissions are revoked, the application system will report errors. Minor changes are needed to handle the error.

Easy to use

Minor changes required

  • Gateway blocking
    The service gateway (such as Gatekeeper, Zuul, and Kong) blocks write requests while allowing read requests. For example, the Gatekeeper gateway can block POST requests and allow only GET requests to pass through. This can be achieved by setting packet handling rules on Gatekeeper.
    Figure 1 Gateway blocking
  • Disabling the write service

    If read/write splitting is enabled, shut down the write service or the corresponding interface, but keep the read service or the corresponding interface alive. This makes applications read-only.

    Figure 2 Shutting down the write service
  • App refactoring

    Modify the application code to enable read/write splitting. Then use the solution above to enable read-only service.

    Figure 3 Application refactoring
  • Configure read-only at the middleware and data layers

    Revoke the write permissions for related accounts at the middleware and data layers.

    Figure 4 Configuring read-only at the middleware and data layers