Hey Everyone, I have a question, its more related ...
# help
m
Hey Everyone, I have a question, its more related to design of the system than any syntax/expcetion issue, so not sure if this is the right channel to post. If its not, then i apologize and please guide me to the correct one. I have an idea that i am trying to implement using SST. Its going to be a mobile app which has some features similar to any "Forums" i.e., there will threads and then reply with in those threads. Its a typical relational model but i am implementing it using DynamoDB. Which brings its own challenges. One of the challenge is to figure out if there are any "new" posts since last visit. For this i'd have to create some DynamoDB trigger to kick off a lambda and update a separate table tracking last post time in a thread. If it was relational db, i could have just easily done using a query. I am not choosing relational model because it would cost me ~$15-$23 per month and i am not sure how long i'd need to impelenet my backend and then future app. So my questions 1. Should i stay with dynamoDB. It may save the cost of relationaldb, but it would require me to create extra lambdas + dynamodb stream. 2. How can i manage (create/build etc) lambdas which are not associated to rest endpoint and are associated to something else (Sqs, dynamodb stream etc) using SST stack?
r
You could maybe do what you need with posts since a specific time using a sort key or a secondary index, depending on what you have in your PK and SK already. I strongly recommend you read The DynamoDB Book by Alex DeBrie, it beautifully describes the design process for single table design using DDB. Regarding using lambdas as targets from DDB streams, you just register the lambda function as a consumer
d
@Muhammad Ali isn't aurora serverless pay as you go? ah but there's no free tier. if you want relational, i'd spin up a postgres server with supabase.io or mysql with planetscale. then connect your lambdas as such.
j
@Muhammad Ali agree with what Ross is saying here. SST should support most of the other Lambda triggers as well, if you run into any that we don’t, let us know.