What is Amazon ElastiCache?
Who uses Amazon ElastiCache?
Why developers like Amazon ElastiCache?
Here are some stack decisions, common use cases and reviews by companies and developers who chose Amazon ElastiCache in their tech stack.
Back in 2014, I was given an opportunity to re-architect SmartZip Analytics platform, and flagship product: SmartTargeting. This is a SaaS software helping real estate professionals keeping up with their prospects and leads in a given neighborhood/territory, finding out (thanks to predictive analytics) who's the most likely to list/sell their home, and running cross-channel marketing automation against them: direct mail, online ads, email... The company also does provide Data APIs to Enterprise customers.
I had inherited years and years of technical debt and I knew things had to change radically. The first enabler to this was to make use of the cloud and go with AWS, so we would stop re-inventing the wheel, and build around managed/scalable services.
For the SaaS product, we kept on working with Rails as this was what my team had the most knowledge in. We've however broken up the monolith and decoupled the front-end application from the backend thanks to the use of Rails API so we'd get independently scalable micro-services from now on.
Our various applications could now be deployed using AWS Elastic Beanstalk so we wouldn't waste any more efforts writing time-consuming Capistrano deployment scripts for instance. Combined with Docker so our application would run within its own container, independently from the underlying host configuration.
Storage-wise, we went with Amazon S3 and ditched any pre-existing local or network storage people used to deal with in our legacy systems. On the database side: Amazon RDS / MySQL initially. Ultimately migrated to Amazon RDS for Aurora / MySQL when it got released. Once again, here you need a managed service your cloud provider handles for you.
Future improvements / technology decisions included:
Caching: Amazon ElastiCache / Memcached CDN: Amazon CloudFront Systems Integration: Segment / Zapier Data-warehousing: Amazon Redshift BI: Amazon Quicksight / Superset Search: Elasticsearch / Amazon Elasticsearch Service / Algolia Monitoring: New Relic
As our usage grows, patterns changed, and/or our business needs evolved, my role as Engineering Manager then Director of Engineering was also to ensure my team kept on learning and innovating, while delivering on business value.
One of these innovations was to get ourselves into Serverless : Adopting AWS Lambda was a big step forward. At the time, only available for Node.js (Not Ruby ) but a great way to handle cost efficiency, unpredictable traffic, sudden bursts of traffic... Ultimately you want the whole chain of services involved in a call to be serverless, and that's when we've started leveraging Amazon DynamoDB on these projects so they'd be fully scalable.
As we've evolved or added additional infrastructure to our stack, we've biased towards managed services. Most new backing stores are Amazon RDS instances now. We do use self-managed PostgreSQL with TimescaleDB for time-series data—this is made HA with the use of Patroni and Consul.
We also use managed Amazon ElastiCache instances instead of spinning up Amazon EC2 instances to run Redis workloads, as well as shifting to Amazon Kinesis instead of Kafka.
We decided to use MemCachier as our Memcached provider because we were seeing some serious PostgreSQL performance issues with query-heavy pages on the site. We use MemCachier for all Rails caching and pretty aggressively too for the logged out experience (fully cached pages for the most part). We really need to move to Amazon ElastiCache as soon as possible so we can stop paying so much. The only reason we're not moving is because there are some restrictions on the network side due to our main app being hosted on Heroku.
We send over 20 billion emails a month on behalf of our customers. As a result, we manage hundreds of millions of "suppression" records that track when an email address is invalid as well as when a user unsubscribes or flags an email as spam. This way we can help ensure our customers are only sending email that their recipients want, which boosts overall delivery rates and engagement. We need to support two primary use cases: (1) fast and reliable real-time lookup against the list when sending email and (2) allow customers to search, edit, and bulk upload/download their list via API and in the UI. A single enterprise customer's list can be well over 100 million. Over the years as the size of this data started small and has grown increasingly we have tried multiple things that didn't scale very well. In the recent past we used Amazon DynamoDB for the system of record as well as a cache in Amazon ElastiCache (Redis) for the fast lookups and Amazon CloudSearch for the search function. This architecture was overly complicated and expensive. We were able to eliminate the use of Redis, replacing it with direct lookups against DynamoDB, fronted with a stripped down Node.js API that performs consistently around 10ms. The new dynamic bursting of DynamoDB has helped ensure reliable and consistent performance for real-time lookups. We also moved off the clunky and expensive CloudSearch to Amazon Elasticsearch Service for the search functionality. Beyond the high price tag for CloudSearch it also had severe limits streaming updates from DynamoDB, which forced us to batch them - adding extra complexity and CX challenges. We love the fact that DynamoDB can stream directly to ElasticSearch and believe using these two technologies together will handle our scaling needs in an economical way for the foreseeable future.
We initially started out with Heroku as our PaaS provider due to a desire to use it by our original developer for our Ruby on Rails application/website at the time. We were finding response times slow, it was painfully slow, sometimes taking 10 seconds to start loading the main page. Moving up to the next "compute" level was going to be very expensive.
We moved our site over to AWS Elastic Beanstalk , not only did response times on the site practically become instant, our cloud bill for the application was cut in half.
In database world we are currently using Amazon RDS for PostgreSQL also, we have both MariaDB and Microsoft SQL Server both hosted on Amazon RDS. The plan is to migrate to AWS Aurora Serverless for all 3 of those database systems.
Additional services we use for our public applications: AWS Lambda, Python, Redis, Memcached, AWS Elastic Load Balancing (ELB), Amazon Elasticsearch Service, Amazon ElastiCache
Our base infrastructure is composed of Debian based servers running in Amazon EC2 , asset storage with Amazon S3 , and Amazon RDS for Aurora and Redis under Amazon ElastiCache for data storage.
We are starting to work in automated provisioning and management with Terraform , Packer , and Ansible .
Amazon ElastiCache's Features
- Support for two engines: Memcached and Redis
- Ease of management via the AWS Management Console. With a few clicks you can configure and launch instances for the engine you wish to use.
- Compatibility with the specific engine protocol. This means most of the client libraries will work with the respective engines they were built for - no additional changes or tweaking required.
- Detailed monitoring statistics for the engine nodes at no extra cost via Amazon CloudWatch
- Pay only for the resources you consume based on node hours used