DEV Community

Discussion on: Why does writing code for DynamoDb get my spidey senses tingling?

conorw profile image
Conor Woods Author

Very interested to understand the Postgres bit and how it works Max.
How do you keep the keys updated and what does querying looks like?

rimutaka profile image
Max • Edited on
  • Reads if ID is known Vue - Appsyn - DDB
  • Reads if ID is not known or related IDs are required: Vue - Appsync - Lambda - get IDs from Postgres - Lambda - DDB batch read - pack it up for Appsync - back to Vue.
  • Search by IDs, relations, dates, numeric, order - same as above
  • Search by text or complex relations: add ElasticSearch to the pic
  • Writes / deletes: Vue - Appsync - Lambda - full record incl IDs into DDB - IDs only into PG

You need to denormalize and partition your data.

This architecture does not work well for anything transactional, but then I would not use DDB for anything transactional either.

You may be better off using Postgres alone if your project is within the size of a single DB server.

Feel free to message me if you want to know more.