Skip to content

Instantly share code, notes, and snippets.

@amlana21
Created January 13, 2023 23:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amlana21/df686172ac2ee195c56d34c28930a710 to your computer and use it in GitHub Desktop.
Save amlana21/df686172ac2ee195c56d34c28930a710 to your computer and use it in GitHub Desktop.
DDB Async architecture options
  • Introduce a caching layer.
    • Do a query to call a Lambda. That lambda calls another lambda in async mode and the 1st lambda responds a req id to caller
    • The 2nd lambda queries ddb and waits for result. On result received from ddb write results to a cache like Elasticache
    • From frontend keep querying cache with request id. WHen result gets available, read the results. This will be much faster than ddb
  • Use websocket
    • Implement a websocket service
    • Open a websocket connection from frontend
    • repeat above steps with 2 lambda (from caching option)
    • but instead of cache, 2nd lambda returns results to websocket and frontend gets result from socket connection
  • Use DAX to improve performance. This will improve DDB performance if you have large number of records
  • Use multiple DDB tables to categorize data. Query specific tables based on what you want to query. This may not apply on all scenarios and very use case specific
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment