liveBook · Manning

Cache node type

As explained in Amazon Web Services in Action, Third Edition: An in-depth guide to AWS

An ElastiCache cache node type is a predefined configuration specifying the compute, memory, and network capacity of a cache node.

An ElastiCache cache node type specifies the compute, memory, and network capacity available to a cache node. Choosing a larger type scales the cache vertically. section 11.6 section 11.6.1

Select production capacity for concurrency, dataset size, growth, memory fragmentation, and network throughput rather than choosing only by price or current utilization. section 11.6.1 section 11.5.1

Use these sizing guidelines:

  • Choose at least 2 vCPUs for real production concurrency. section 11.6.1
  • Reserve roughly 20% more memory than the current dataset requires for growth and to reduce fragmentation risk. section 11.6.1
  • Prefer at least high network performance, especially when network usage contributes to cache bottlenecks. section 11.6 section 11.6.1
  • Move to a larger node when memory pressure or CPU demand persists; add shards when horizontal scaling is more appropriate. section 11.5.1 section 11.6

From Free Tier to production

cache.t2.micro provides one vCPU, approximately 0.6 GB of memory, and low-to-moderate network performance. cache.r6g.large provides 2 vCPUs, approximately 13 GB of memory, and up to 10 Gb of network performance, making it a possible small production starting point. section 11.6.1

Listing 11.1 Minimal CloudFormation template of an ElastiCache Redis single-node cluster
---
AWSTemplateFormatVersion: '2010-09-09'
Description: 'AWS in Action: chapter 11 (minimal)'
Parameters:                                           #1
  VPC:
    Type: 'AWS::EC2::VPC::Id'
  SubnetA:
    Type: 'AWS::EC2::Subnet::Id'
  SubnetB:
    Type: 'AWS::EC2::Subnet::Id'
Resources:
  CacheSecurityGroup:                                 #2
    Type: 'AWS::EC2::SecurityGroup'
    Properties:
      GroupDescription: cache
      VpcId: !Ref VPC
      SecurityGroupIngress:
      - IpProtocol: tcp                               #3
        FromPort: 6379
        ToPort: 6379
        CidrIp: '0.0.0.0/0'
  CacheSubnetGroup:                                   #4
    Type: 'AWS::ElastiCache::SubnetGroup'
    Properties:
      Description: cache
      SubnetIds:
      - Ref: SubnetA                                  #5
      - Ref: SubnetB
  Cache:
    Type: 'AWS::ElastiCache::CacheCluster'            #6
    Properties:
      CacheNodeType: 'cache.t2.micro'                 #7
      CacheSubnetGroupName: !Ref CacheSubnetGroup
      Engine: redis                                   #8
      NumCacheNodes: 1                                #9
      VpcSecurityGroupIds:
      - !Ref CacheSecurityGroup

Inspect the CloudFormation example to see CacheNodeType used as a required property of an ElastiCache cluster, alongside engine, node count, subnet, and security settings. section 11.1.1

How Amazon Web Services in Action, Third Edition: An in-depth guide to AWS covers it

How deep it goes
Explains resource trade-offs, sizing rules, and vertical scaling, while deferring an exhaustive catalog of available node types.
Examples
Compares cache.t2.micro and cache.r6g.large, and configures CacheNodeType in a minimal CloudFormation Redis cluster.
What it assumes
Assumes familiarity with cache utilization and introduces node types by comparing them with EC2 instance types.
What you can do after
Operate/configure ElastiCache by choosing a node type from CPU, memory, network, dataset growth, and scaling requirements.
How it connects
Connects cache node types with ElastiCache, vertical scaling, sharding, read replicas, CPU utilization, memory pressure, and network performance.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Amazon Web Services in Action, Third Edition: An in-depth guide to AWS. The section links point to the parts of the book it draws on.