| title | Is serverless dead? | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| excerpt | TBD | ||||||||
| layout | single | ||||||||
| comments | true | ||||||||
| read_time | true | ||||||||
| share | true | ||||||||
| related | true | ||||||||
| tags |
|
||||||||
| header |
|
There's been lots of talk recently about something I've been talking about for years, serverless architecture vs monolithic architecture, this conversation was sparked by this blog written by Marcin Kolny describing how the Prime Video team re-architected their audio/video monitoring service from using serverless components to a monolith.
The arguments presented following the publishing of this blog can mostly be summarised as;
Serverless is dead and was a terrible idea in the first place
First we have to turn to some definitions, what is serverless?
Serverless computing is a cloud computing execution model in which the cloud provider allocates machine resources on demand, taking care of the servers on behalf of their customers.
So serverless is an execution model and has nothing directly to say about how we organise functionality. However, most serverless architectures tend to encourage separating functionality into small independently deployable execution units that communicate with calls across a network (synchronous or asynchronous).
How about a monolith?
a monolithic application is a single unified software application which is self-contained and independent from other applications...
So a monolith is a pattern of organising functionality into a single deployment/execution unit which doesn't need other 'applications' to carry out it's function.
These definitions are terms of art. For example, unless your application is completely self contained on your device and has no requirement to connect to any other device then is it really a 'self-contained'? What does self-contained mean? All high level applications rely on the underlying services of an operating system and most rely on some data store, does that mean they're not a monolith? Almost all modern applications consist of a client/server architecture, does this mean they're not a monolith?
So for the purposes of this discussion I'll use some somewhat subjective definitions.
A serverless application is one where the functionality not directly involved in the user interface is divided into multiple deployment units (excluding any generic datastore) that are allocated on demand by a cloud provider.
and
A monolithic application is one where the functionality not directly involved in the user interface is consolidated in one deployment unit (excluding any generic datastore).
Note, I've used the term 'deployment unit' and not 'execution unit' as I want to draw the distinction between run time organisation and build/deployment time organisation. An application can be monolithic even if there are multiple instances running provided each instance is a copy of the same deployment unit.
People more steeped in the technologies than me have discussed the benefits of serverless architecture so I will summarise my 'take' on the reasons for using it:
- Respond to requests on demand especially when they are intermittent and 'peaky'
- (Arguably) reduce the time spent on maintaining infrastructure
- Code can run closer to the user, decreasing network latency