DEV Community

Gurudev Prasad Teketi
Gurudev Prasad Teketi

Posted on

Amazon ElastiCache for Microservices

In continuation to my last article where we talked about microservices on AWS, would like to introduce an in-memory caching service that is easy to deploy, operate, and scale in the cloud.

Amazon Elasticache is designed for improving the performance of applications by retrieving information from fast, fully managed, inmemory caches instead of relying on slower disk-based databases.

ElastiCache offers two in-memory engines that are compatible with popular opensource technologies

  1. Redis
  2. Memcached.
  • ElastiCache for Redis is a Redis-compatible in-memory service that delivers the easeof-use and power of Redis along with the availability, reliability, and performance suitable for the most demanding applications.
  • ElastiCache for Memcached is a Memcached-compatible caching service that works seamlessly with popular tools that you use with existing Memcached environments.

Both engines are widely used key-value stores.

High Availability with ElastiCache

  • Amazon ElastiCache for Redis provides high availability, with automated failover and recovery.
  • When a primary node fails, ElastiCache detects the failure and promotes a replica node to be the new primary.
  • This process usually takes less than 30 seconds.
  • The failed node is then replaced and returned to the cluster as a replica node.
  • For multi-AZ deployments, ElastiCache for Redis provides a 99.99% SLA for high availability.
  • Data loss is limited to the changes that were ‘in-flight’ just before the failure.
  • These are the changes that were made in the primary before the failure, but the failure prevented the outbound replication of these changes.
  • If zero data loss is a requirement, then Amazon MemoryDB for Redis, which is a durable in-memory database, is a better fit.

ElastiCache for Cost Optimization of Performance Improvements

  • ElastiCache for Redis supports a throughput of 1 million requests per second per node or 500 million requests per second per cluster with microsecond response time.
  • With ElastiCache serverless caches, you only pay for the resources you use, including the data stored and requests made against the cache.

Low-Latency Access to Operational Data

  • ElastiCache can significantly lighten the load on the database by servicing most of the requests for data.
  • With lazy loading, only the first instance of a request is subject to the performance of backend databases.
  • With the write-through pattern, each write is subject to the performance of backend databases after which each subsequent read request can be served by ElastiCache.
  • We can cache anything that can be queried where the underlying source of the data could be from relational databases or non-relational databases.
  • We can even cache data that can be accessed through an application programming interface (API).

Sample Architecture Diagram

Image description

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (0)

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay