Skip to content

Add support for external/custom marshalling/unmarshaling implementations #2547

Open
@uglide

Description

@uglide

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 #2546 to allow indexing JSON documents in addition to Hashes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions