August 2023
Beginner to intermediate
706 pages
17h 34m
English
In this chapter, we will learn how to persist data that a microservice is using. As already mentioned in Chapter 2, Introduction to Spring Boot, we will use the Spring Data project to persist data to MongoDB and MySQL databases.
The product and recommendation microservices will use Spring Data for MongoDB and the review microservice will use Spring Data for the Java Persistence API (JPA) to access a MySQL database. We will add operations to the RESTful APIs to be able to create and delete data in the databases. The existing APIs for reading data will be updated to access the databases. We will run the databases as Docker containers, managed by Docker Compose, that is, in the same way as we run our microservices.
The following ...