Is sharing database with multiple serverless functions good practice?
Like in a CRUD application, normally the Create, Update, Delete and Read are different operations sharing the same database. If we migrate that idea on serverless, is that still ideal? All of those operations accessing the same database.
My hesitation comes from the idea of sharing databases between different microservices. Since that increases coupling and makes things more fragile.
Serverless applications usually consist of multiple Lambda functions. Each Lambda function can use only one runtime but you can use multiple runtimes across multiple functions. This enables you to choose the best runtime for the task of the function.
Loss of control: configuration An obvious limitation of Serverless is a loss of absolute control over configuration. For example, in the AWS Lambda FaaS platform, there are a very limited number of configuration parameters available, and no control whatsoever over JVM or operating system runtime parameters.
The answer to this question is dependent on the circumstances of both the database and the operations.
These concerns can be boiled down to the following characteristics of the database:
In most cases, the first two bullets are most important, since limitations normally are not reached except for a few rare cases.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With