Skip to content

cosminstn/spring-persistence-db-switcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

This demo app is designed to be able to switch between a MongoDB persistence layer and a SQL persistence layer. The database engine is determined automatically by the datasource configured in application.properties:

  1. If spring.data.mongodb.database is present in application.properties then we're dealing with a MongoDB engine
  2. Else if spring.datasource.url is present then we're dealing with a SQL engine.

TODOs:

  1. Currently the app is stoppping imediatelly after starting even with the Scheduled component being implemented
  2. It seems like no repositories are being registered (but maybe they don't have time to be registerered)
  3. Application starts correctly on Mongo DB
  4. Application starts correctly on SQL
  5. Write integration tests that save data in the repository
  6. Write code that performs db operations on startup to demo usability

Resources:

  1. https://www.baeldung.com/spring-component-scanning
  2. https://www.baeldung.com/the-persistence-layer-with-spring-and-jpa
  3. https://docs.spring.io/spring-boot/docs/current/reference/html/using-spring-boot.html#using-boot-using-springbootapplication-annotation

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages