Recap

Last week, we explored the microservices architecture and the communication patterns between services within a system.

Figure 8.1 Monolithic architecture and microservice architecture.

Figure 8.1 Monolithic architecture and microservice architecture.

In our previous discussion, we also addressed the challenges associated with managing data in distributed systems, but we left off with an important question. To answer this, we will look at a sample project based on the microservice architecture.

The project we will be referring to is provided in the .zip below:

Lab4Codes.zip

Microservice Design

In our sample project, there are four microservices:

  1. FrontEnd: Responsible to provide GUI for the project, retrieve information from other services, check the login and apply authentication mechanisms.
  2. SearchBooks: Responsible for searching over books based on book title, and book authors.
  3. BorrowBook: Responsible to provide information about books that have been borrowed by a user, also perform borrowing and returning books.
  4. HoldBook: Responsible for retrieving data on whether a book is on hold, and also perform holding a book for a user.

Each microservice is its own independent project with their own database schema.

Figure 8.2 NetBeans project panel.

Figure 8.2 NetBeans project panel.