AWS ElastiCache Overview

AWS ElastiCache are in memory databases with very high performance and low latency. They designed to reduce the load on databases for high levels of reads. They allow your application to be stateless by placing the placing the current state of the data into ElastiCache. AWS takes care of OS maintenance, optimization, setup, configuration, monitoring, recovery and backup of the ElastiCache making it transparent to customer. Normally you have to perform a lot of code changes for existing application to use the ElastiCache option.

The architecture to use ElastiCache for RDS interaction:

  • Application query the ElastiCache
  • If ElastiCache has required data it returns to Application
  • If ElastiCache does not have required data it queries the RDS and returns it to Application (storing internally for next use).
  • This helps reduce the frequency of access to RDS proper
  • The application has to have a ElastiCache validation method to ensure data is most up to date.

The architecture to use ElastiCache for User Session Store:

  • User logon to application
  • Application writes user session data to ElastiCache
  • User hits a different application instance and their user session data is still valid.
  • Thus reducing the number of logins required by end user.

Compare Redis vs Memcached:

Redis:

  • Multi AZ with auto-failover
  • Provides read replicas to scale reads and give you high availability
  • Provides backup and restore
  • Support sets and sorted sets

Memcached:

  • Multi-node for partitioning of data providing sharding
  • Does not provide read replica
  • It is not persistent
  • provides backup and restore only with serverless version
  • provides multi-threaded architecture which increases performance.

Leave a Reply