O'Reilly logo

Practical Microservices by Umesh Ram Sharma

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Table structure

The user service will use two tables. One to record the personal data of a user, such as their name, unique ID number, date of birth, gender, and so on and the second table to store the address of the user. To create a schema and table, we will use the following SQL file and flywaydb. Flyway is an open source database migration tool. It has Maven plugins that work well with the Spring Boot. To use the Flyway in Spring Boot, you will have to add the following dependency in the POM file:

<dependency> 
    <groupId>org.flywaydb</groupId> 
    <artifactId>flyway-core</artifactId> 
    <version>4.0.3</version> 
</dependency> 

Flyway DB works on convention, so for any migration to happen, it will look for the file at the src/main/resources/db/migration ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required