Skip to Content
Microservices with Spring Boot 3 and Spring Cloud - Third Edition
book

Microservices with Spring Boot 3 and Spring Cloud - Third Edition

by Magnus Larsson
August 2023
Beginner to intermediate
706 pages
17h 34m
English
Packt Publishing
Content preview from Microservices with Spring Boot 3 and Spring Cloud - Third Edition

6

Adding Persistence

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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Master Microservices with Spring Boot and Spring Cloud

Master Microservices with Spring Boot and Spring Cloud

In28Minutes Official

Publisher Resources

ISBN: 9781805128694Supplemental Content