Thursday, September 13, 2018

AWS - Elastic Cache



Amazon ElastiCache is a fully managed in-memory data store and cache service by Amazon Web Services (AWS). The service improves the performance of web applications by retrieving information from managed in-memory caches, instead of relying entirely on slower disk-based databases. ElastiCache supports two open-source in-memory caching engines: Memcached and Redis (also called “ElastiCache for Redis”).[1]

1)  Memcached  :   Memcached is a general-purpose distributed memory caching system. It is often used to speed up dynamic database-driven websites by caching data and objects in RAM to reduce the number of times an external data source must be read. Memcached is free and open-source software, licensed under the Revised BSD license. Memcached runs on Unix-like operating systems and on Microsoft Windows. It depends on the libevent library.

Select Memcached if you have these requirements:
  • You want the simplest model possible.
  • You need to run large nodeswith multiple cores or threads.
  • You need the ability to scale out/in,
  • Adding and removing nodes as demand on your system increases and decreases.
  • You want to partition your data across multiple shards.
  • You need to cache objects, such as a database.


2)  Redis   :    Redis, RE-dis is an open-source in-memory data structure project implementing a distributed, in-memory key-value database with optional durability.
 Redis supports different kinds of abstract data structures,
                        such as strings,
                        lists,
                        maps,
                       sets, sorted sets,
                       hyperloglogs,
                       bitmaps and spatial indexes.

The project is mainly developed by Salvatore Sanfilippo and is currently sponsored by Redis Labs.


Select Redis if you have these requirements:

  • You need complex data types, such as strings, hashes, lists, and sets.
  • You need to sort or rank in-memory data-sets.
  • You want persistence of your key store.
  • You want to replicate your data from the primary to one or more read replicas for read intensive applications.
  • You need automatic failover if your primary node fails.
  • You want publish and subscribe (pub/sub) capabilities—to inform clients about events on the server.
  • You want backup and restore capabilities.


Redis issues :


  • 1)  used_memory exceeds maxmemory configuration problem
  • redis-cluster on Kubernetes to be used externally
  • Redis Performance Debugging
  • Redis key stats hit/miss
  • redis-slave picking other masters
  • How to invalidate multiple keys in single time ?
  • Priority queue + filters ?
  • How to discover  keys having TTL vs those Not having a TTL ?
  • Redis  - Manual failover works Automatic doesn't
  • Add constraints for redis data value
  • Replica migration in Redis cluster with cascaded slave node not possible
  • Redis streams partitioning.

Scenario :

to push 0.6 million key/value pair data to Redis and use it is as cache storage.
Can you guys help me to have code sample to insert data in redis in batches usinf Node Js and AWS Lambda 

Also let me know what would be latency and IOPS for Redis.becuase we have to insert in redis in within 5 minutes


Very good reference  -  https://redis.io/topics/mass-insert




No comments:

Post a Comment

Hyderabad Trip - Best Places to visit

 Best Places to Visit  in Hyderabad 1.        1. Golconda Fort Maps Link :   https://www.google.com/maps/dir/Aparna+Serene+Park,+Masj...