Make a custom Spring Data module

Jordan Lefébure
21 min readAug 7, 2019

Originally publish at https://jlefebure.com/blog/make-a-custom-spring-data-module

Spring Data is a must have for any Spring developer. Its main asset is the extremely fast writing of the DAO layer of a business application, as well as the unification of the repository declaration which makes it possible to limit development impacts in the event of a DBMS change.

So yes, the main question that we can ask is in the first place “why would I do that?”. Well, there are many cases to think about it.

First, simply if you want to use a DBMS that does not have a Spring Data module already written. That’s my case, there is no Spring Data module for proprietary databases, which seems logical for an open source project.

Then, multiple use cases can lead to the inspiration of Spring Data as it is a rather elegant way of interacting with a persistence system. For example, if I want to interrogate a Minio instance, one could imagine a functioning (purely hypothetical) like this.

--

--

Jordan Lefébure

Software architect and lead developer @SFR. Java, Scala, JS developer.