serverless-application-model icon indicating copy to clipboard operation
serverless-application-model copied to clipboard

Add Dynamo Global table support

Open BigDataDaddy opened this issue 3 years ago • 3 comments

Describe your idea/feature/enhancement

Simple table is bit too simple to build an app that passes a Well Architected review. I'd suggest that adding Dynamo Global Table support would go a long way toward ticking of the boxes for a Well Architected review for at least some of the Resiliancy Pillar models like the "Pilot Light" warm standby model.

BigDataDaddy avatar Apr 07 '22 20:04 BigDataDaddy

Thanks for the idea!

I will tag this issue so that our PMs can take a look at it. Meanwhile, if you can provide more details about the resource that would be great for them when investigating this further.

mndeveci avatar Apr 13 '22 05:04 mndeveci

Hi mndeveci,

Not sure what you're asking for when you say " Meanwhile, if you can provide more details about the resource that would be great for them when investigating this further."?

In order to satisfy the Well Architected "Resiliency" pillar we need to create fault tolerant architectures. A Dynamo simple table is not fault tolerant to a single region outage because it's wholly contained within a single AWS region. Therefore, in order to be region outage tolerant the table would need to replicated across 2 or more AWS regions. That would be a best solved with a Dynamo global table which is what I'm asking for. I mention the "Pilot Light" warm standby resiliency model because it's the minimal model that replicates all the persistent data at rest data resources to another region to protect them from a regional outage where the recovery includes spinning up all the compute and other infrastructure in the failover region from IaC and connecting it to the replicated data resources. I suppose a cold backup resiliency model could also work as long as the backups are replicated to another region, but my business is choosing the "Pilot Light" warm standby resiliency model and hence we'd like SAM to support using it.

Does that satisfy your ask for further details?

BigDataDaddy avatar Apr 22 '22 20:04 BigDataDaddy

For what it's worth, an example global table can be created as such:

Resources:
  MyTable:
    Type: AWS::DynamoDB::GlobalTable
    Properties:
      BillingMode: PAY_PER_REQUEST
      StreamSpecification:
        StreamViewType: NEW_AND_OLD_IMAGES
      AttributeDefinitions:
        - AttributeName: id
          AttributeType: S
      KeySchema:
        - AttributeName: id
          KeyType: HASH 
      Replicas:
        - Region: us-west-2
        - Region: eu-west-1
        - Region: ap-northeast-1

hoffa avatar Dec 06 '22 02:12 hoffa