Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Building Serverless application with DynamoDB a...

Building Serverless application with DynamoDB and Go

Abhishek Gupta

August 30, 2022
Tweet

More Decks by Abhishek Gupta

Other Decks in Technology

Transcript

  1. © 2022, Amazon Web Services, Inc. or its affiliates. ©

    2022, Amazon Web Services, Inc. or its affiliates. Amazon DynamoDB A bird’s eye view
  2. © 2022, Amazon Web Services, Inc. or its affiliates. Highly

    available and durable Consistently fast at any scale Fully managed Secure Integrates with AWS Lambda, Amazon Redshift, and more Amazon DynamoDB Cost-effective
  3. © 2022, Amazon Web Services, Inc. or its affiliates. Partition

    Key Mandatory Key-value access pattern Determines data distribution Optional Model 1:N relationships Enables rich query capabilities DynamoDB Table A1 (partition key) A2 (sort key) A3 A4 A7 A1 (partition key) A2 (sort key) A6 A4 A5 A1 (partition key) A2 (sort key) A1 (partition key) A2 (sort key) A3 A4 A5 Sort Key Table Items All items for key ==, <, >, >=, <= “begins with” “between” “contains” “in” sorted results counts top/bottom N values
  4. © 2022, Amazon Web Services, Inc. or its affiliates. Data

    types Type DynamoDB Type String String Integer, Float Number Timestamp Number or String Blob Binary Boolean Bool Null Null List List Set Set of String, Number, or Binary Map Map
  5. © 2022, Amazon Web Services, Inc. or its affiliates. ©

    2022, Amazon Web Services, Inc. or its affiliates. DynamoDB Go SDK (v2) Modules, packages, APIs
  6. © 2022, Amazon Web Services, Inc. or its affiliates. 7

    https://aws.amazon.com/sdk-for-go/ https://aws.github.io/aws-sdk-go-v2/docs/getting-started/ https://github.com/aws/aws-sdk-go-v2
  7. © 2022, Amazon Web Services, Inc. or its affiliates. service

    dynamodb types dynamodbstreams types feature dynamodb attributevalue expression dynamodbstreams attributevalue H T T P S : / / P K G . G O . D E V / G I T H U B . C O M / A W S / A W S - S D K - G O - V 2
  8. © 2022, Amazon Web Services, Inc. or its affiliates. Data

    plane Operations and APIs 9 Operation API Create PutItem BatchWriteItem Read GetItem BatchGetItem Query Scan Update UpdateItem Delete DeleteItem BatchWriteItem Transactions TransactWriteItems TransactGetItems PartiQL ExecuteStatement BatchExecuteStatement ExecuteTransaction
  9. © 2022, Amazon Web Services, Inc. or its affiliates. ©

    2022, Amazon Web Services, Inc. or its affiliates. DynamoDB in action 10
  10. © 2022, Amazon Web Services, Inc. or its affiliates. DynamoDB

    & Serverless: Patterns and Solutions 11 Pattern Solution Demo Microservices Web App/API URL shortener (Lambda/App Runner) Change Data Capture Materialized views, Replication DynamoDB Streams with Lambda Event Driven Architecture Data pipeline MSK -> Lambda/Fargate -> DynamoDB ETL (Extract, Transform, Load) Data migration/Export S3 to DynamoDB Orchestration Workflow apps Step Functions to DynamoDB
  11. © 2022, Amazon Web Services, Inc. or its affiliates. Microservice:

    Serverless URL Shortener 12 Blog posts - Lambda, App Runner
  12. © 2022, Amazon Web Services, Inc. or its affiliates. Data

    pipeline: MSK Serverless-> Lambda/Fargate -> DynamoDB 14 Blog post (coming soon)
  13. © 2022, Amazon Web Services, Inc. or its affiliates. Large

    scale data Migration/Import: S3 to DynamoDB 15 Documentation and Blog post
  14. © 2022, Amazon Web Services, Inc. or its affiliates. ©

    2022, Amazon Web Services, Inc. or its affiliates. Getting started resources
  15. © 2022, Amazon Web Services, Inc. or its affiliates. Make

    the best use of these resources… 18 DynamoDB hands-on labs NoSQL Workbench DynamoDB Local DynamoDB resources (AWS documentation) DynamoDB Best Practices