Details
-
Task
-
Resolution: Won't Do
-
Major
-
None
-
None
-
None
Description
note the feasability feasibility and effort required to solve that issue is still under review
To provide facilities for normalization of documents through the SDK. That is to say, give the possibility to somehow save an object graph as multiple JSON documents in couchbase rather than a single one.
Note the main aim is to offer this in Spring Data Couchbase, via something as simple as an annotation on an entity class. But this ticket will be used to track if something would need to be added to the SDK in order to achieve that goal.
The tricky aspect is that the SDK has no real notion of an object graph and object references (apart from the early experimental repository feature which is out of scope since it isn't used by Spring Data). So a pure SDK implementation is unlikely.
This is not as straightforward to implement in Spring Data Couchbase as it is in Spring Data JPA and Spring Data Mongo, because the later simply rely on native support in their corresponding store:
- JPA is arguably built to take an object graph and normalize it into a database (using relational annotations like @ManyToOne...)
- MongoDB has native DBRef support that serves this purpose, but it is helped by the fact that Mongo's Collections are associated to a type, and a DBRef will most often reference an object from another Collection, of which the type is known.
Since Spring Data Couchbase doesn't have any such native feature to exploit, it implies that a pure Spring Data solution might have to work its way around the framework.
Spring Data Redis has the concept of a BulkMapper that looks close to what we would need so that's an option to explore.
The other option is to introduce some kind of support in the SDK to bridge any missing gap with Spring Data and enable that feature.