- We have developed an API for an app (iOS/Android).
- Web servers (IIS), behind a load balancer, scale automatically.
- 1 DB server (SQL Server).
The DB server is an AWS t2.large instance which performs fine (7% CPU average). However we are concerned about its scalability because upgrading the hardware has a limit. So we implemented transactional replication by launching another DB instance. Writes are performed in the Publisher and reads in the Subscriber.
Consider this typical scenario:
- A user posts an item in the app.
- API writes it in the Publisher
- App requests all items
- API reads items in the Subscriber
- The user does not receive the posted item
The problem is the latency (3-4 seconds) it takes to propagate a write from Publisher to Subscriber. How can we solve this? Obviously we pretend to avoid reads in the Publisher.