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

Microservices with Spring Boot and Spring Cloud - Second Edition

by Magnus Larsson
July 2021
Beginner to intermediate content levelBeginner to intermediate
774 pages
16h 47m
English
Packt Publishing
Content preview from Microservices with Spring Boot and Spring Cloud - Second 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 JPA (short for the Java Persistence API) 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. ...

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

Hands-On Microservices with Spring Boot and Spring Cloud

Hands-On Microservices with Spring Boot and Spring Cloud

Magnus Larsson

Publisher Resources

ISBN: 9781801072977Supplemental Content