• ElastiCache is a web service
  • Used to set up, manage, and scale distributed in-memory cache environments in AWS.
  • Provides a high performance, resizable, and cost-effective in-memory cache
  • Removes complexity associated with deploying and managing a distributed cache environment.
  • Works with the Redis and Memcached engines
  • By default, the AWS SDKs, AWS CLI, ElastiCache API, and ElastiCache console reference the US-West (Oregon) region.

ElastiCache Node

  • Node is the smallest building block in Elasticache
  • Node can exist in isolation from
  • Node can be in some relationship to other nodes.
  • It is a fixed-size chunk of secure, network-attached RAM.
  • Each node runs an instance of the engine and version that was chosen during cluster creation.
  • Scale the nodes in a cluster up or down to a different instance type.

ElastiCache operations for clusters:

  • Creating a cluster
  • Modifying a cluster
  • Taking snapshots of a cluster (all versions of Redis)
  • Deleting a cluster
  • Viewing the elements in a cluster
  • Adding or removing cost allocation tags to and from a cluster

Redis

Redis, expands to Remote Dictionary Server

  • It is a fast, open-source, in-memory key-value data store
  • Can be used as
    • a database
    • cache
    • message broker
    • queue
  • The project started by Salvatore Sanfilippo, to improve scalability of his Italian startup.
  • Redis delivers sub-millisecond response times
  • Enables millions of requests per second
  • Good for real-time applications in
    • Gaming
    • Ad-Tech
    • Financial Services
    • Healthcare
    • IoT
  • Popular choice for
    • Caching
    • session management
    • gaming
    • leaderboards
    • real-time analytics
    • geospatial
    • ride-hailing
    • chat/messaging
    • media streaming
    • pub/sub apps.

Redis in Brief

  • All Redis data resides in-memory
  • Hence, Redis avoid seek time delays
  • Can access data in microseconds.
  • Redis features
    • versatile data structures
    • high availability
    • geospatial
    • Lua scripting
    • Transactions
    • on-disk persistence
    • cluster support
    • simpler to build real-time internet scale apps.

Redis data types

  • Strings – text or binary data up to 512MB in size
  • Lists – a collection of Strings in the order they were added
  • Sets – an unordered collection of strings with the ability to intersect, union, and diff other Set types
  • Sorted Sets – Sets ordered by a value
  • Hashes – a data structure for storing a list of fields and values
  • Bitmaps – a data type that offers bit level operations
  • HyperLogLogs – a probabilistic data structure to estimate the unique items in a data set

Redis Cluster and Shard

  • A Redis shard (or a node group in the API and CLI) is a grouping of 1 to 6 related nodes.
  • A Redis (cluster mode disabled) cluster always has one shard.
  • A Redis (cluster mode enabled) cluster can have 1–90 shards.
  • A multiple node shard implements replication by have one read/write primary node and 1–5 replica nodes.
  • A Redis cluster is a logical grouping of one or more ElastiCache for Redis Shards.
  • Data is partitioned across the shards in a Redis (cluster mode enabled) cluster.

AWS and Memcached

  • Node is the smallest building block in Elasticache
  • Each node runs an instance of Memcached.
  • Can scale the nodes in a cluster up or down to a different instance type.
  • The Memcached engine supports Auto Discovery, in which, client programs automatically identify all nodes in cache cluster, initiate and maintain connections to all of these nodes. No manual configuration.
  • Client application connects to a configuration endpoint having DNS entry with CNAME entries for each of the cache node endpoints.
  • Memcached is available in multiple AWS Regions around the world.

Choose Memcached if

  • You need the simplest model possible.
  • You need to run large nodes with multiple cores or threads.
  • You need the ability to scale out and in, adding and removing nodes as demand on system increases and decreases.
  • You need to cache objects, such as a database.
Menu