Model: Data access patterns (in microservice architecture)

./resources/model-4-data-access-patterns-in-microservice-archi.resources/229062aa-68bd-49cb-a564-e899c40b3152.png (1) Pattern: interservice communication (2) Pattern: data schema replication (3) Pattern: in-memory replicated cache (4) Pattern: data domain


(1) Pattern: interservice communication (data access in microservices) ./resources/model-4-data-access-patterns-in-microservice-archi.resources/unknown_filename.png ./resources/model-4-data-access-patterns-in-microservice-archi.resources/unknown_filename.1.png

latency

  • network 60-300 ms
  • security
    • secure endpoint
    • re-authorize if expired
  • data
    1. query own db
    2. query other db

./resources/model-4-data-access-patterns-in-microservice-archi.resources/unknown_filename.2.png


(2) Pattern: data schema replication (data access in microservices) ./resources/model-4-data-access-patterns-in-microservice-archi.resources/unknown_filename.3.png keep them in sync: synchronous / asyncronous transaction? ./resources/model-4-data-access-patterns-in-microservice-archi.resources/unknown_filename.4.png solves all problems of option (1) custom change-data-capture framework communication sync / async?


(3) Pattern: in-memory replicated cache (data access in microservices) ./resources/model-4-data-access-patterns-in-microservice-archi.resources/unknown_filename.5.png tools to keep cache in sync (hazelcast, coherence, ignite, infinispan, gemfire)

./resources/model-4-data-access-patterns-in-microservice-archi.resources/unknown_filename.6.png in-memory: 10 GB of product descriptions… when < 100 MB, don’t worry when > 100 MG, start counting how many instances you can have


(4) Pattern: data domain (data access in microservices) ./resources/model-4-data-access-patterns-in-microservice-archi.resources/unknown_filename.7.png ./resources/model-4-data-access-patterns-in-microservice-archi.resources/unknown_filename.8.png always ask: why are these services separate? broader bounded context -> data change issues max 2-6 services sharing the data domain