Chapter 5: Accessing Data in Microservice Architecture
In this chapter, we will focus on accessing the database by using the Ballerina language with respect to monolithic 3-tier architecture-based applications. In the 3-tier architecture model, application logic is contained in the application layer. Single-database access for the entire system and database transaction queries are implemented in the application layer. Building an application that runs in a single database is simpler since we can join tables to query results. A microservice architecture, however, forces developers to have a database for each service. Therefore, we need to come up with a more scalable solution to handle problems related to data consistency in database per service architecture.
Here, we will explore various design patterns and how we can use them to implement the order management system that we discussed in the first chapter. Understanding these concepts and design patterns makes the system much simpler...