[{"data":1,"prerenderedAt":227},["ShallowReactive",2],{"content-svc-dynamodb-guides-using-dynamodbto-build-webapps-09-dynamodb-app":3},{"markdown":4,"frontMatterAttributes":5,"bodyRaw":14,"menu":15,"menuType":223,"isCollapseableMenu":18,"nextDocItem":144,"previousDocItem":127,"contributorPaths":224,"contentName":226,"slug":143,"readingTime":70},"\u003Ch1>Code your application\u003C\u002Fh1>\n\u003Cp>Once you have the infrastructure ready, it&#39;s time to start coding your application to support the new access patterns. This section will guide you through six steps that you can follow when writing your application.\u003C\u002Fp>\n\u003Col>\n\u003Cli>\u003Cp>\u003Cstrong>Configure the AWS SDK in your application:\u003C\u002Fstrong> Set up the AWS SDK in your application to interact with DynamoDB. This includes providing your AWS credentials and configuring the SDK to connect to the correct AWS region.\u003C\u002Fp>\n\u003C\u002Fli>\n\u003Cli>\u003Cp>\u003Cstrong>Configure and pick your test library:\u003C\u002Fstrong> Choose a test library for your application and configure it to run tests against your DynamoDB infrastructure. This will allow you to test your application&#39;s interactions with the database.\u003C\u002Fp>\n\u003C\u002Fli>\n\u003Cli>\u003Cp>\u003Cstrong>Create models:\u003C\u002Fstrong> Define models for your application that map to the DynamoDB table and indexes. These models will help you work with data in a structured way and provide an abstraction layer between your application and the database.\u003C\u002Fp>\n\u003C\u002Fli>\n\u003Cli>\u003Cp>\u003Cstrong>Modify controllers:\u003C\u002Fstrong> Update your application&#39;s controllers to handle the new access patterns. This may involve making changes to the logic for retrieving, creating, updating, and deleting data based on the specific requirements of your application.\u003C\u002Fp>\n\u003C\u002Fli>\n\u003Cli>\u003Cp>\u003Cstrong>Check routes:\u003C\u002Fstrong> Review and update the routes in your application to ensure they align with the new access patterns. Verify that the routes are correctly handling requests and interacting with the DynamoDB table and indexes.\u003C\u002Fp>\n\u003C\u002Fli>\n\u003Cli>\u003Cp>\u003Cstrong>Ensure middleware is working:\u003C\u002Fstrong> Test and validate any middleware that you have in your application, such as authentication or request validation middleware. Make sure that the middleware is functioning correctly and properly integrating with your DynamoDB infrastructure.\u003C\u002Fp>\n\u003C\u002Fli>\n\u003C\u002Fol>\n\u003Cp>Additionally, in this section, you will learn about DynamoDB expressions, which are powerful tools for working with the database:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>\u003Cp>\u003Cstrong>Key condition expressions:\u003C\u002Fstrong> These expressions define the conditions for retrieving items based on the primary key attributes. You can use key condition expressions to perform operations like equality, comparison, and filtering on key attributes.\u003C\u002Fp>\n\u003C\u002Fli>\n\u003Cli>\u003Cp>\u003Cstrong>Filter expressions:\u003C\u002Fstrong> Filter expressions allow you to further refine the results of a query or scan operation. You can use filter expressions to apply additional conditions to the data retrieved from DynamoDB.\u003C\u002Fp>\n\u003C\u002Fli>\n\u003Cli>\u003Cp>\u003Cstrong>Condition expressions:\u003C\u002Fstrong> Condition expressions are used to ensure that specific conditions are met before performing write operations (e.g., put, update, delete). They enable you to add conditional logic to your write operations.\u003C\u002Fp>\n\u003C\u002Fli>\n\u003Cli>\u003Cp>\u003Cstrong>Update expressions:\u003C\u002Fstrong> Update expressions define how attributes of an item should be modified during an update operation. You can use update expressions to add, remove, or modify attributes of an item.\u003C\u002Fp>\n\u003C\u002Fli>\n\u003Cli>\u003Cp>\u003Cstrong>Projection expressions:\u003C\u002Fstrong> Projection expressions determine which attributes should be returned in the query or scan results. You can use projection expressions to specify the attributes you need and optimize the data retrieval process.\u003C\u002Fp>\n\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>By following these steps and understanding DynamoDB expressions, you can build an application that effectively interacts with your DynamoDB infrastructure and supports the desired access patterns.\u003C\u002Fp>\n",{"title":6,"order":7,"youtubeVideoID":8,"resources":9},"Code your application",10,"9ftDmRMEfDM",[10],{"link":11,"text":12,"type":13},"https:\u002F\u002Fgithub.com\u002Fmavi888\u002Fnodeexpress-backend-app","Get the code","code","# Code your application\n\nOnce you have the infrastructure ready, it's time to start coding your application to support the new access patterns. This section will guide you through six steps that you can follow when writing your application.\n\n1. **Configure the AWS SDK in your application:** Set up the AWS SDK in your application to interact with DynamoDB. This includes providing your AWS credentials and configuring the SDK to connect to the correct AWS region.\n\n2. **Configure and pick your test library:** Choose a test library for your application and configure it to run tests against your DynamoDB infrastructure. This will allow you to test your application's interactions with the database.\n\n3. **Create models:** Define models for your application that map to the DynamoDB table and indexes. These models will help you work with data in a structured way and provide an abstraction layer between your application and the database.\n\n4. **Modify controllers:** Update your application's controllers to handle the new access patterns. This may involve making changes to the logic for retrieving, creating, updating, and deleting data based on the specific requirements of your application.\n\n5. **Check routes:** Review and update the routes in your application to ensure they align with the new access patterns. Verify that the routes are correctly handling requests and interacting with the DynamoDB table and indexes.\n\n6. **Ensure middleware is working:** Test and validate any middleware that you have in your application, such as authentication or request validation middleware. Make sure that the middleware is functioning correctly and properly integrating with your DynamoDB infrastructure.\n\nAdditionally, in this section, you will learn about DynamoDB expressions, which are powerful tools for working with the database:\n\n- **Key condition expressions:** These expressions define the conditions for retrieving items based on the primary key attributes. You can use key condition expressions to perform operations like equality, comparison, and filtering on key attributes.\n\n- **Filter expressions:** Filter expressions allow you to further refine the results of a query or scan operation. You can use filter expressions to apply additional conditions to the data retrieved from DynamoDB.\n\n- **Condition expressions:** Condition expressions are used to ensure that specific conditions are met before performing write operations (e.g., put, update, delete). They enable you to add conditional logic to your write operations.\n\n- **Update expressions:** Update expressions define how attributes of an item should be modified during an update operation. You can use update expressions to add, remove, or modify attributes of an item.\n\n- **Projection expressions:** Projection expressions determine which attributes should be returned in the query or scan results. You can use projection expressions to specify the attributes you need and optimize the data retrieval process.\n\nBy following these steps and understanding DynamoDB expressions, you can build an application that effectively interacts with your DynamoDB infrastructure and supports the desired access patterns.\n",[16,27,55,89,124,177,215],{"title":17,"collapsible":18,"isCollapsed":19,"content":20},"Introduction",false,true,[21],{"title":17,"order":22,"time":23,"path":24,"id":25,"link":26},1,"2 min","introduction","introduction.md","\u002Fcontent\u002Fservice\u002Fdynamodb\u002Fguides\u002Fusing-dynamodbto-build-webapps\u002Fintroduction",{"title":28,"collapsible":18,"isCollapsed":19,"content":29},"1. Hosting Your Application with App Runner",[30,42],{"title":31,"order":32,"youtubeVideoID":33,"resources":34,"time":23,"path":39,"id":40,"link":41},"What is AWS App Runner?",2,"z-RywG7Xfk8",[35],{"link":36,"text":37,"type":38},"https:\u002F\u002Faws.amazon.com\u002FApp Runner\u002F","AWS App Runner","service","01-apprunnerintro","01-apprunnerintro.md","\u002Fcontent\u002Fservice\u002Fdynamodb\u002Fguides\u002Fusing-dynamodbto-build-webapps\u002F01-apprunnerintro",{"title":43,"order":44,"youtubeVideoID":45,"resources":46,"time":23,"path":52,"id":53,"link":54},"AWS AppRunner Demo",3,"jOwQdXbmHC4",[47,49],{"link":11,"text":48,"type":13},"NodeJS application code",{"link":50,"type":13,"text":51},"https:\u002F\u002Fgithub.com\u002Fmavi888\u002Fcdk-migrated-app-infra\u002Ftree\u002Fapprunner","AWS CDK infrastructure code","02-apprunnerdemo","02-apprunnerdemo.md","\u002Fcontent\u002Fservice\u002Fdynamodb\u002Fguides\u002Fusing-dynamodbto-build-webapps\u002F02-apprunnerdemo",{"title":56,"collapsible":18,"isCollapsed":19,"content":57},"2.Understanding DynamoDB Basics",[58,74],{"title":59,"order":60,"youtubeVideoID":61,"resources":62,"time":70,"path":71,"id":72,"link":73},"Amazon DynamoDB 101",4,"tkj2r7kFcpM",[63,66],{"link":64,"text":65,"type":38},"https:\u002F\u002Faws.amazon.com\u002Fdynamodb\u002F","Amazon DynamoDB service page",{"link":67,"type":68,"text":69},"https:\u002F\u002Faws.amazon.com\u002Fdynamodb\u002Fpricing\u002F","pricing","Amazon DynamoDB pricing","3 min","03-dynamodb-intro","03-dynamodb-intro.md","\u002Fcontent\u002Fservice\u002Fdynamodb\u002Fguides\u002Fusing-dynamodbto-build-webapps\u002F03-dynamodb-intro",{"title":75,"order":76,"youtubeVideoID":77,"resources":78,"time":23,"path":86,"id":87,"link":88},"Amazon DynamoDB under the hood",5,"ZhXqNcbR4n0",[79,83],{"link":80,"text":81,"type":82},"https:\u002F\u002Fwww.usenix.org\u002Fconference\u002Fatc22\u002Fpresentation\u002Felhemali","Amazon DynamoDB: A Scalable, Predictably Performant, and Fully Managed NoSQL Database Service","article",{"link":84,"type":82,"text":85},"https:\u002F\u002Fwww.theregister.com\u002F2022\u002F11\u002F14\u002Fmeet_the_database_that_supports\u002F","Meet the database that supports Amazon.com","04-dynamodb-underthehood","04-dynamodb-underthehood.md","\u002Fcontent\u002Fservice\u002Fdynamodb\u002Fguides\u002Fusing-dynamodbto-build-webapps\u002F04-dynamodb-underthehood",{"title":90,"collapsible":18,"isCollapsed":19,"content":91},"3.Designing Your DynamoDB Table",[92,103,115],{"title":93,"order":94,"youtubeVideoID":95,"resources":96,"time":70,"path":100,"id":101,"link":102},"Is DynamoDB the right database for you?",6,"TpeP3Cmz5PE",[97],{"link":98,"text":99,"type":82},"https:\u002F\u002Faws.amazon.com\u002Fblogs\u002Fdatabase\u002Fhow-to-determine-if-amazon-dynamodb-is-appropriate-for-your-needs-and-then-plan-your-migration\u002F","How to determine if Amazon DynamoDB is appropriate for your needs, and then plan your migration","05-dynamo-rightforyou","05-dynamo-rightforyou.md","\u002Fcontent\u002Fservice\u002Fdynamodb\u002Fguides\u002Fusing-dynamodbto-build-webapps\u002F05-dynamo-rightforyou",{"title":104,"order":105,"youtubeVideoID":106,"resources":107,"time":23,"path":112,"id":113,"link":114},"Introduction to Single Table Design",7,"lWCch8GEK4E",[108],{"link":109,"text":110,"type":111},"https:\u002F\u002Fyoutu.be\u002FQ6-qWdsa8a4","7 Common DynamoDB Patterns for Modeling and Building an App with Alex De Brie","video","06-dynamodb-singletable","06-dynamodb-singletable.md","\u002Fcontent\u002Fservice\u002Fdynamodb\u002Fguides\u002Fusing-dynamodbto-build-webapps\u002F06-dynamodb-singletable",{"title":116,"order":117,"youtubeVideoID":118,"resources":119,"time":23,"path":121,"id":122,"link":123},"Design a DynamoDB table with Single Table Design",8,"JLZOI8patlw",[120],{"link":109,"text":110,"type":111},"07-dynamodb-singletable-modeling","07-dynamodb-singletable-modeling.md","\u002Fcontent\u002Fservice\u002Fdynamodb\u002Fguides\u002Fusing-dynamodbto-build-webapps\u002F07-dynamodb-singletable-modeling",{"title":125,"collapsible":18,"isCollapsed":18,"content":126},"4.Implementing DynamoDB in Your Application",[127,138,144,163],{"title":128,"order":129,"youtubeVideoID":130,"resources":131,"time":23,"path":135,"id":136,"link":137},"Provision Amazon DynamoDB table and indexes with AWS CDK",9,"4o1KzB2AAk4",[132],{"link":133,"text":134,"type":13},"https:\u002F\u002Fgithub.com\u002Fmavi888\u002Fcdk-migrated-app-infra\u002Ftree\u002FdynamoDB\u002Flib","AWS CDK code","08-dynamo-cdkinfra","08-dynamo-cdkinfra.md","\u002Fcontent\u002Fservice\u002Fdynamodb\u002Fguides\u002Fusing-dynamodbto-build-webapps\u002F08-dynamo-cdkinfra",{"title":6,"order":7,"youtubeVideoID":8,"resources":139,"time":70,"path":141,"id":142,"link":143},[140],{"link":11,"text":12,"type":13},"09-dynamodb-app","09-dynamodb-app.md","\u002Fcontent\u002Fservice\u002Fdynamodb\u002Fguides\u002Fusing-dynamodbto-build-webapps\u002F09-dynamodb-app",{"title":145,"order":146,"youtubeVideoID":147,"resources":148,"time":70,"path":160,"id":161,"link":162},"How to Migrate Data to DynamoDB?",11,"qEQqL3KiOOc",[149,153,157],{"link":150,"text":151,"type":152},"https:\u002F\u002Fdocs.aws.amazon.com\u002Famazondynamodb\u002Flatest\u002Fdeveloperguide\u002FS3DataImport.HowItWorks.html","DynamoDB data import from Amazon S3: how it works","docs",{"link":154,"text":155,"type":156},"https:\u002F\u002Faws.amazon.com\u002Fblogs\u002Fdatabase\u002Fperforming-a-live-migration-from-a-mongodb-cluster-to-amazon-dynamodb\u002F","Performing a Live Migration from a MongoDB Cluster to Amazon DynamoDB","blog",{"link":158,"type":111,"text":159},"https:\u002F\u002Fyoutu.be\u002F_6ym3IRrRxo","🆕 Step functions Distributed map - Run 10k parallel serverless executions!","10-dynamodb-migrate","10-dynamodb-migrate.md","\u002Fcontent\u002Fservice\u002Fdynamodb\u002Fguides\u002Fusing-dynamodbto-build-webapps\u002F10-dynamodb-migrate",{"title":164,"order":165,"youtubeVideoID":33,"resources":166,"time":23,"path":174,"id":175,"link":176},"Deploy and Load Test",12,[167,168,171],{"link":133,"text":12,"type":13},{"link":169,"type":111,"text":170},"https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=B0pDPSQcAf4","Load test your serverless applications | Run Artillery in a Lambda function",{"link":172,"type":111,"text":173},"https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=0VNKHIcQ5wk","Building Amazon CloudWatch dashboards with AWS CDK","11-dynamodb-test","11-dynamodb-test.md","\u002Fcontent\u002Fservice\u002Fdynamodb\u002Fguides\u002Fusing-dynamodbto-build-webapps\u002F11-dynamodb-test",{"title":178,"collapsible":18,"isCollapsed":19,"content":179},"5.Adding Event-Driven Characteristics",[180,188,202],{"title":181,"order":182,"youtubeVideoID":183,"time":184,"path":185,"id":186,"link":187},"DynamoDB Streams",13,"M0GJzjsw5So","1 min","12-dynamo-streams","12-dynamo-streams.md","\u002Fcontent\u002Fservice\u002Fdynamodb\u002Fguides\u002Fusing-dynamodbto-build-webapps\u002F12-dynamo-streams",{"title":189,"order":190,"youtubeVideoID":191,"resources":192,"time":184,"path":199,"id":200,"link":201},"Acting on Stream Events",14,"RL0l2Wz3deQ",[193,196],{"link":194,"text":195,"type":13},"https:\u002F\u002Fgithub.com\u002Fmavi888\u002Fcdk-migrated-app-infra","Code Repository",{"link":197,"type":111,"text":198},"https:\u002F\u002Fyoutu.be\u002F8Yv_V4havbc","Unlock the Power of EventBridge Pipes: Integrate Across Platforms with Ease!","13-dynamodb-ebpipes","13-dynamodb-ebpipes.md","\u002Fcontent\u002Fservice\u002Fdynamodb\u002Fguides\u002Fusing-dynamodbto-build-webapps\u002F13-dynamodb-ebpipes",{"title":203,"order":204,"youtubeVideoID":205,"resources":206,"time":184,"path":212,"id":213,"link":214},"Filtering Subscription Messages",15,"36iMOJQUAuE",[207,210,211],{"link":208,"text":209,"type":156},"https:\u002F\u002Faws.amazon.com\u002Fblogs\u002Fcompute\u002Fintroducing-payload-based-message-filtering-for-amazon-sns\u002F","Introducing payload-based message filtering for Amazon SNS",{"link":194,"text":195,"type":13},{"link":197,"type":111,"text":198},"14-dynamodb-sns","14-dynamodb-sns.md","\u002Fcontent\u002Fservice\u002Fdynamodb\u002Fguides\u002Fusing-dynamodbto-build-webapps\u002F14-dynamodb-sns",{"title":216,"collapsible":18,"isCollapsed":19,"content":217},"Conclusion",[218],{"title":216,"order":219,"time":184,"path":220,"id":221,"link":222},16,"conclusion","conclusion.md","\u002Fcontent\u002Fservice\u002Fdynamodb\u002Fguides\u002Fusing-dynamodbto-build-webapps\u002Fconclusion","LIST",[225],"content\u002Fcontributors\u002Fmarcia-villalba.json","Using DynamoDB to build WebApps",1792578866968]