AWS ElastiCache : Is it possible Redis compatible Elasticache to store Json Files
Asked Answered
H

3

5

Is it possible to store json Files in Amazon Web Services Redis compatible Elasticache?If possible what is the best method to accomplish the same?

Hubey answered 9/1, 2017 at 11:31 Comment(0)
T
8

**Edited - The answer below is now outdated. Seems AWS began to support it around post 2021. WOOHOO!

reJson is a module add-on in the Redis ecosystem. It can store JSON directly into Redis cache. However modules are not supported in AWS elastic cache due to licensing issues.

TLDR - Amazon is profiting from open source and not contributing back. https://techcrunch.com/2019/02/21/redis-labs-changes-its-open-source-license-again/

So if you like to store JSON directly, you'd need to spin up your own cluster of EC2, install Redis with reJSON.

Alternative route is to see if you can store "Hash" data type or "string" in Elastic cache based on your use cases...

In the case of going with the route of storing a JSONified string into redis as a value per key, your application would have to parse it back to JSON after it retrieves the data from Redis.

Same goes for Hash, though for the case of Hash, you can access specific fields instead of the entire JSON.

If you envision your application to add more fields in the future, but you need some fields in most cases, go with Hash. Otherwise for simplicity sake, go with String.

https://redis.io/topics/data-types-intro

Thornberry answered 6/3, 2020 at 3:44 Comment(0)
A
2

There is now native support for working with JSON in Amazon ElastiCache for Redis and Amazon MemoryDB for Redis.

From the release announcement on May 25th, 2022 (emphasis mine): https://aws.amazon.com/about-aws/whats-new/2022/05/json-support-amazon-elasticache-redis-amazon-memorydb-redis/

Amazon ElastiCache for Redis and Amazon MemoryDB for Redis now support natively storing and accessing data in the JavaScript Object Notation (JSON) format. With this launch, application developers can effortlessly store, fetch, and update their JSON data inside Redis without needing to manage custom code for serialization and deserialization.

Along with the announcement, AWS also published a blog post which describe how the new JSON support works and give examples of how to use it: https://aws.amazon.com/blogs/database/unlocking-json-workloads-with-elasticache-and-memorydb/

Aborn answered 27/5, 2022 at 6:10 Comment(0)
H
0

The Redis JSON module is available with Redis Enterprise which is offered as a managed service on the major cloud providers (AWS, GCP, Azure).

It also works with the Redis Search module giving you the ability to do more complex SQL-like queries against your JSON data.

https://developer.redis.com/howtos/redisjson/getting-started/

The Redis Insight tool has some great tutorials walking you through Search+JSON.

https://redis.com/redis-enterprise/redis-insight/

Herdsman answered 8/7, 2022 at 22:11 Comment(1)
wow that is nice. Glad things eventually changed over at aws to support this.Thornberry

© 2022 - 2024 — McMap. All rights reserved.