Single comment thread
See full discussion

Thank you for such a wonderful answer, Max 👏

Can you answer the question about the app in which I mention the 6 steps aboveâť“
I think its good for Serverless but not sure. Up is very good & I maybe use that or use Serverless Framework.

Also, regarding Databases I read during my Engineering that if 2 people perform the write operation simultaneously then it will probably have a race condition with incorrect values. How to solve thatâť“ I don't think its a serverless problem but if you can answer that :)

Also, whats the harm in keeping the database open❓Does it have any cost if I keep it open❓

You can implement any service you want fully on serverless unless you need to use Websocket (then you'd need to combine serverless API with a traditional server). To avoid race conditions you can look into transaction locking (ex: in Postgres): stackoverflow.com/questions/4… or you can set flags with a Redis caching layer. The reason why you should always close your DB connections is that functions create a new connection on each invocation. Considering that it's infinitely scalable, we get a bottleneck at the DB level. So your database solution should be ready to handle thousands of connections at the same time.

Thank you 🙌

I have no doubts now & if I have any when I actually build it, I will ask you later on. Thanks Max :)

Home
Search
Messages
Notifications
More