Data Access:
Data access becomes much more complex when you move to a microservices architecture. Because in microservices we encapsulate the data to ensures that the microservices are loosely coupled and can evolve independently of one another. The data owned by each microservice is private to that microservice and can only be accessed via its microservice API.
Challenges are :
Boundaries:
How to define the boundaries of each microservice?
We know that we have to define multiple fine grained services but how do we define responsibilities of each service? How do we know their logical boundaries?
For Solution refer to: Identifying Boundaries
Retrieve data between multiple microservices:
How to create queries that retrieve data from several microservices?
Challenging part is we want to avoid chatty communication to the microservices from remote client apps. And not only that, we want to improve the efficiency in the communications of your system.
Solutions are:
Consistency across multiple microservices
How to achieve consistency across multiple microservices?
Challenge is the data owned by each microservice is private to that microservice and can only be accessed using its microservice API. Therefore, a challenge presented is how to implement end-to-end business processes while keeping consistency across multiple microservices?
A good solution for this problem is to use eventual consistency between microservices articulated through event-driven communication and a publish-and-subscribe system.
Communication across microservice
How to design communication across microservice boundaries?
In a distributed system like a microservices-based application, with so many artifacts moving around and with distributed services across many servers or hosts, components will eventually fail. Partial failure and even larger outages will occur, so you need to design your microservices and the communication across them considering the common risks in this type of distributed system.
Solution can be found at: Communication in Microservices