spring-projects / spring-projects/spring-data-redis
Add support for external/custom marshalling/unmarshaling implementations
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.9k
- Forks
- 1.3k
- PR merge metrics
- No merged PRs in 30d
Description
Problems with the current state:
Currently, Spring Data Redis allows marshalling (serializing) POJOs using Redis Hashes with @RedisHash annotation. This approach doesn’t allow efficiently store and querying nested objects like discussed here. Also, the selection of the proper serializer for POJOs is confusing for the developers.
Proposed solution:
Introduce a new API that allows extending Spring Data Redis with external/custom marshalling/unmarshaling implementations.
For example, it will allow us to build JSON-based serialization to store POJOs as JSON documents in Redis. JSON.GET allows to retrieve and update embedded data efficiently with JSONPath, which can be used to significantly improve the performance of retrieving nested objects.
An example of a JSON-based serialization can be found here https://github.com/redis/redis-om-spring/blob/main/demos/roms-documents/src/main/java/com/redis/om/documents/domain/Company.java#L27
This can be combined with https://github.com/spring-projects/spring-data-redis/issues/2546 to allow indexing JSON documents in addition to Hashes.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the proposed JSON-based serialization example in Company.java and the related spring-data-redis issue 2546. Define the external marshalling and unmarshalling API boundaries and how they interact with Redis JSON documents and existing Hash-based storage; done means the design supports the stated nested-object use case and its indexing integration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, redis, spring
- Domain
- api, database
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100