Solution

A solution to this problem is to co-locate Microservice state with compute. This will reduce application's dependency on external data stores (such as cache) for frequently accessed data. Having the data stored on the same deployment instance as the consuming application also contributes positively to the system performance and negates the risk introduced by the data store being a single point of failure.

However, this introduces challenges around maintaining data consistency and synchronization across multiple instances of the same service. A reliable data store with the following characteristics can be used to persist state to address these problems:

  • Replicated: Data changes can be replicated across multiple instances
  • Persistence: Data is persisted on a secondary storage to ensure durability
  • Asynchronous: Supports asynchronous API model to ensure non-blocking calls
  • Transactional: Should support transactions

The following diagram illustrates a system using Reliable Data Store instead of a centralized data store:

Reliable Data Store (Solution)

Microsoft Azure Service Fabric recommends the use of Reliable Collections for persisting data across instances of a Microservice. Reliable Collection is a natural evolution of the System.Collections library with the added ability to abstract out the complexities of replication, persistence, synchronization, and transaction management from the client. It also offers different isolation levels (repeatable read and snapshot) for accommodating diverse transactional systems.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.217.29.234