dragonflydb / dragonfly

A modern replacement for Redis and Memcached
https://www.dragonflydb.io/
Other
25.65k stars 943 forks source link

support for JSON commands #104

Closed romange closed 1 year ago

romange commented 2 years ago

AWS Elasticache recently released JSON support as part of their service.

We should implement a compatible API. See https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/json-list-commands.html

for command reference.

romange commented 2 years ago

https://github.com/danielaparker/jsoncons/tree/master/include/jsoncons is a good candidate for supporting jsonpath.

ryanrussell commented 2 years ago

Equivalent RedisJSON command set for reference: RedisJSON Commands

image

romange commented 2 years ago

@iko1 pls take a look at this issue. You can continue working on Json branch - https://github.com/dragonflydb/dragonfly/tree/Json .

The initial milestone would be to add json_familyXX files that implement JSON.GET command. The syntax is json.get <key> <path>. See elasticache documentation for that. the command should work on string types. it should try and parse the string into json. if it succeeds, apply the "path" query on the json object. The command should handle properly states like wrong type or "not a json" and output the error response accordingly.

romange commented 2 years ago

Due to #238 we must introduce internally a dedicated type for json. That means we must support JSON_TAG inside compact_object and make json type a first-class citizen. Still, I want relaxed semantics for READONLY json commands. For example, JSON.GET should work on both strings and json types. JSON.SET should produce json types only.

iko1 commented 1 year ago

@romange, I assume you can close this issue after all JSON commands were merged into the main branch.

romange commented 1 year ago

Thanks @iko1 . I still consider #238 unfinished. The team will continue from here (add "scan", "type" integration. add rdb support etc).

iko1 commented 1 year ago

@romange, The basic JSON support is done with some exceptions like what you mentioned. Can you elaborate on the missing things that should be implemented when I have a spare time can I take them on myself?

romange commented 1 year ago

You already did huge part of this effort. I would like to finish the rest internally 🙏

On Sat, Nov 26, 2022, 20:19 iko1 @.***> wrote:

@romange https://github.com/romange, The basic JSON support is done with some exceptions like what you mentioned. Can you elaborate on the missing things that should be implemented when I have a spare time can I take them on myself?

— Reply to this email directly, view it on GitHub https://github.com/dragonflydb/dragonfly/issues/104#issuecomment-1328092130, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA4BFCGOAPLYO5LIOJXNG33WKJIBJANCNFSM5X6IZLOA . You are receiving this because you were mentioned.Message ID: @.***>

romange commented 1 year ago

Closing as finished, will open a new task for the missing features.