The Drawbacks of Serverless Architecture
Serverless architecture brings plenty of advantages, but it's not right for everything. Not only are you locked into a vendor, your integration testing becomes tougher.
Join the DZone community and get the full member experience.Join For Free
serverless architectures refer to applications that significantly depend on third-party services (knows as backend as a service or “baas”) or on custom code that’s run in ephemeral containers (function as a service or “faas”), the best-known vendor host of which currently is aws lambda.
despite the name, it does not actually involve running code without servers. the name “serverless computing” is used because the business or person that owns the system does not have to purchase, rent, or provision servers or virtual machines for the back-end code to run on.
a serverless solution explained in the blog "the comprehensive guide to serverless architecture" consists of an api gateway, faas layer (aws lambda), object storage (s3), user authentication, and database.
the serverless code can be used in conjunction with code written in traditional server style, such as microservices. for example, part of a web application could be written as microservices and another part could be written as a serverless code. alternatively, an application could be written that uses no provisioned servers at all, being completely serverless.
faas provides a platform allowing the developers to execute code in response to events without the complexity of building and maintaining the infrastructure. the third-party apps or services would manage the server-side logic and state.
drawbacks of serverless computing
1. problems due to third-party api systems
vendor control, multitenancy problems, vendor lock-in, and security concerns are some of the problems due to the use of third-party apis. giving up system control while implementing apis can lead to system downtime, forced api upgrades, loss of functionality, unexpected limits, and cost changes. the multitenancy problem is also seen in other cloud computing frameworks. salesforce (paas) imposes governor limits due to its multitenant cloud structure and developers have to avoid some mistakes while using salesforce. multitenant solutions can have problems with security, robustness, and performance.
2. lack of operational tools
the developers are dependent on vendors for debugging and monitoring tools. debugging distributed systems is difficult and usually requires access to a significant amount of relevant metrics to identify the root cause.
3. architectural complexity
decisions about how small (granular) the function should be, takes time to assess, implement and test. there should be a balance between the number of functions should an application call. it gets cumbersome to manage too many functions, and ignoring granularity will end up creating mini-monoliths.
aws lambda, for now, limits you to how many concurrent executions you can be running of all your lambdas. the problem here is that this limit is across your whole aws account. some organizations use the same aws account for both production and testing. that means if someone, somewhere in your organization does a new type of load test and starts trying to execute 1,000 concurrent lambda functions, you’ll accidentally denial of service (dos) your production applications.
4. implementation drawbacks
integration testing of serverless apps is tough. the units of integration with serverless faas (i.e. each function) are a lot smaller than with other architectures and therefore we rely on integration testing a lot more than we may do with other architectural styles. problems related to deployment, versioning, and packaging also exist. you may need to deploy a faas artifact separately for every function in your entire logical application. it also means you can’t atomically deploy a group of functions and there’s no concept of versioned applications so atomic rollback isn’t an option. you may need to turn off whatever event source is triggering the functions, deploy the whole group, and then turn the event source back on.
Opinions expressed by DZone contributors are their own.