0

I gonna create

  1. Spring Boot MVC / JPA / Data CRUD project - simple REST service. Put in container
  2. Store some data in mysql DB. Put in a separate container
  3. use docker compose to up 1 & 2 together
  4. Use a circuit breaker pattern (Hystrix?): @Retry & fallback methods while store to DB
  5. Gonna use Spring Initializr

For that purpose I need to use:

  1. Spring Web
  2. Spring Data JPA

Options in Spring Initializr.

The question is: do a I need to use MySQL Driver: MySQL JDBC and R2DBC driver. option? Or mysql in separate container will be ok?

J.J. Beam
  • 2,612
  • 2
  • 26
  • 55
  • 1
    Either you use MySQL in same environment or MySQL in a different Docker container, your application should communicate with the DBMS. That's why you need the 'MySQL Driver' in the application classpath. So, your application must have MySQL driver dependency wherever the MySQL server is running. This applies to all the DBMS and each of the DBMS has their own driver with specific configuration set only to connect that particular DBMS. – Sachith Dickwella Feb 05 '20 at 03:56

1 Answers1

0

As this was explained in a comment, this entry has "Driver" in its name to indicate that this component is the "client part" to make sure your app can communicate with a MySQL server (be it in a separate container, a local instance on your machine or wherever).

start.spring.io is not providing services in any form. When it embeds something in the app itself, the entry has "Embedded" in its name to indicate that.

Stephane Nicoll
  • 31,977
  • 9
  • 97
  • 89