There are some technical advantages of Spring Data over Spring + JPA, which in a clean SQL environment, I think, give Spring Data an advantage:
- Spring Data uses the same CrudRepository interface for all implementations, so you will have less effort to switch between JPA and MongoDB.
- Spring Data saves re-writing the same methods. You just add a method to the interface and it will generate it for you (e.g. UserRepository.findByUsername ())
- You can save the template for implementing REST for JPA, MongoDB and others (see http://projects.spring.io/spring-data-rest/ )
- If you want to experiment with other persistence or indexing services, there are Spring Data implementations for both mature and new technologies, such as Neo4j, Hadoop, Solr, ElasticSearch, fuzzydb.
Given that you are using MySQL and MongoDB, I think Spring Data is a strong candidate, as it allows developers to code one Data Access API (Spring Data) instead of two (JPA and MongoDB Java Client).
As for the existing architecture, it sounds as if your manager level implements either a Rich Domain template or an Active Record.
Spring Data, in my opinion, is very well suited for Rich Domain in combination with the implementation of services using Spring @Configurable.
Finally, I would say that Spring Data also provides a significant advantage when you need to implement services for things like Spring Security and Spring Social that use MongoDB or others, rather than SQL.
We did this in the webapp fuzzydb example, which can be found here here . (Disclaimer: I am the only recent fuzzydb committer and have not touched it for several months, but we have a live service based on this code)
source share