Model: 4 data access patterns (in microservice architecture)

July 28th, 2022

Model: Data access patterns (in microservice architecture)

 

no description for image available

(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)

no description for image availableno description for image available

 

latency

  • network 60-300 ms

  • security

    • secure endpoint

    • re-authorize if expired

  • data

    1. query own db

    2. query other db

 

no description for image available

 


 

(2) Pattern: data schema replication(data access in microservices)

no description for image available

keep them in sync: synchronous / asyncronous

transaction?

no description for image available

solves all problems of option (1)

custom change-data-capture framework

communication sync / async?

 


 

(3) Pattern: in-memory replicated cache(data access in microservices)

no description for image available

tools to keep cache in sync (hazelcast, coherence, ignite, infinispan, gemfire)

 

no description for image available

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)

no description for image availableno description for image available

always ask: why are these services separate?

broader bounded context -> data change issues

max 2-6 services sharing the data domain