Breaking up the BookSwap monolith
The discussion in this chapter has been centered around discussing microservice architectures, as distributed systems have become the standard and you will most likely have to work on this kind of system in the near future. However, the BookSwap application is still a monolithic application.
Based on some of the practices we discussed in Chapter 7, Refactoring in Go, we can discuss how we might go splitting up the BookSwap monolith. Figure 8.7 depicts some of the microservices that we could create:
Figure 8.7 – The distributed BookSwap system
The distributed BookSwap
system has microservices with well-defined responsibilities:
SwapService
is the entry point to the system and is responsible for handling and routing all the incoming user requests of the system. It has direct dependencies onBookService
andUserService
, which own the data thatSwapService
relies on.UserService
is responsible for all the...