I am presently building a Spring Boot backend with REST APIs, which is backed by Neo4j Database. So, while going through the official documentations of Spring Data Neo4j I have observed the usage of ReactiveNeo4jRepository
and Neo4jRepository
as data repositories for interacting with Database through our program.
But even going through the limited documentation many times I am unable to figure out how to distinguish among them? Kindly help me make this distinction.
Linear programming and reactive programming are two different concepts both in their operating logic as well as in the libraries with which the data that is returned from the database is worked with.
In neo4j the reactive interface works with two functions, one to return a single piece of data and another for when the return of a list of data is expected, since they are operated differently.
It is also always advised while technically not prohibited, it is not recommended mixing imperative and reactive database access in the same application. Regards
This is the library for the import:
Imperative
Neo4jRepository
org.springframework.data.repository.Repository org.springframework.data.repository.CrudRepository
Reactive
ReactiveNeo4jRepository
org.springframework.data.repository.reactive.ReactiveCrudRepository org.springframework.data.repository.reactive.ReactiveSortingRepository
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.