Skip to Content

AWS ElastiCache with Redis Part-1

Posted on October 27, 2022 by

Categories: AWS

Tags:

  • You can easily set up, operate, and grow well-known open-source compatible in-memory data storage in the cloud using Amazon ElastiCache.
  • By obtaining information from high throughput and low latency in-memory data stores, you may create data-intensive apps or improve the performance of your current databases.
  • For real-time use cases like Caching and Session Stores, Amazon ElastiCache is a well-liked option.
  • Amazon ElastiCache offers safe, lightning-fast performance by employing an end-to-end optimized stack operating on customer-dedicated nodes.
  • ElastiCache keeps an eye on your clusters to keep your workloads running and free up your time to work on higher-value application development.
  • Amazon ElastiCache has three scaling options for changing application demand: out, in, and up. Sharding supports write and memory scalability. Read scaling is offered by replicas.

caching hit and miss

  • When material from your website is successfully provided from the cache, this is known as a cache hit.
  • When the data is located and read, it is regarded as a cache hit since the tags are quickly sought in the memory.
  • Another way to characterize a cache hit is chilly, warm, or hot.
  • Each of them gives a description of the data reading speed.
  • Hot cache memory as quickly as feasible. When the data is retrieved from L1, this occurs.
  • Although data is read as slowly as possible in the cold cache, it is still booming and is thus still regarded as a cache hit.
  • Just down in the memory structure, at L3 or lower, is where the data may be found.
  • Data is discovered in L2 or L3 caches that are warm. Even though it is slower than a hot cache, it is still quicker than a cold cache.
  • A cache is typically described as warm to indicate that it is slower than a hot cache and is more comparable to a cold cache.
  • When the memory is searched, and the data cannot be located, this is referred to as a cache miss.
  • The information is then sent and written into the cache when this occurs.

Redis

  • An in-memory data storage system is Redis.
  • Key-value pairs are used to store data in various forms.
  • The remote dictionary server is referred to as Redis.
  • We can preserve our data on a disc with a temporal snapshot to facilitate recovery.
  • Replicas can be made in large numbers.
  • Because transactions are supported, atomicity is ensured.
  • It supports Pub/Sub.
  • Scripts can be used to carry out transactions.
  • There is no multi-threading.
  • Redis authentication, TLS, and At-Rest encryption are offered for security.

Slow loading

  • When data is loaded slowly, it is only taken from the cache if it is already there or not.
  • If a cache miss occurs, the database will be accessed, and the outcome will be saved in the cache.

Through Writing and TTL (Time to Live)

  • Because the data in the cache is the most recent, WriteThrough always adds or updates it whenever the database is changed.
  • Because every time the database is updated, two operations are carried out: a write on the database and a write on the cache.
  • The TTL specifies when a key will stop working.
  • A new entry will be made for it and referred to as a cache miss if an expired key is used.
  • TTL can be measured in milliseconds or seconds.
  • Stale data is prevented through write-through.
  • TTL aids in clearing the cache of obsolete info.

Advantages

  • When exceptional performance is necessary, ElasitCache is quite helpful.
  • In-memory data storage enables rapid speed.
  • Auto Scaling aids in managing the product’s scalability.
  • There are no security risks because user-based authentication is offered.
  • The service is fully managed.
  • Redis and ElastiCache are compatible.
  • It is straightforward to use because of its high availability and reliability.
  • Scaling ElastiCache is pretty simple.
  • Analytics and real-time transactions are simple to perform.

Use-Cases

  • Caching
  • Text and Video Chat
  • Geospatial
  • a leaderboard for games
  • Learning Machines
  • Streaming of media
  • Queues
  • Analytics in real time
  • Session Memory

Businesses Using Redis and ElastiCache

  • Airbnb
  • Duolingo
  • Hulu
  • Adobe
  • Dream11
  • Tinder
  • LG
  • Mcdonalds
  • Amazon
  • Expedia

Conclusion

The fundamentals of ElastiCache utilizing Redis have been addressed in this section; the implementation and demonstration will be presented in the following section.