From the beginning of software development, there has been a problem that falls on the developer, but it has nothing to do with the code, but rather with the way to keep the necessary architecture for the application updated.
For this, it is necessary to know which version of the language you are working on, have the dependencies up to date and, most importantly, how to maintain them over time, together with other applications and more up-to-date versions of the languages and dependencies.
Fortunately, technologies came to the rescue that help us solve this problem. Among them are containers and serverless services, but blessed problem! We went from having no options to having very different options.
Now, what I want to share with you is a little information about each one. What are the common points, their differences and some recommendations on when it may be more beneficial to opt for one of them, so let's get started.
Containers allow the installation and configuration of the environment (source code and dependencies) to be executed independently of the host system, regardless of its configurations. Some of its advantages are:
- Easy migration route
Serverless services provide the ability to execute source code from an associated event. The service provider takes care of everything else, ensuring that features are always available and usable, but they only charge for the time they run. Some of its advantages are:
- Zero administration
- Pay per execution
- Zero cost for downtime or inactivity
Broadly speaking, this is the generality of each one of the cases, and as we can see, it is required to carry out the configuration only once, with this it will continue working.
With both worlds we achieve independence from the physical conditions and technical configurations of the host system, even to the point of being completely unaware of them.
Inevitably, we come to questioning. Which one should I use? Which one should I opt for?
And like everything in the world of software development, it is answered with a depends. But there are some conditions that can give clues as to where to tip the balance.
You should opt for containers when:
- You need flexibility to install and use software with specific versions. With containers, you can choose the underlying operating system and have complete control of the installed programming language and runtime version.
- You need to migrate an old system.
- You need to have control over the configuration and be able to perform maintenance on it.
- You want to break a monolithic application into separate microservices, which need to be delivered as individual groups of containers, which means using tools that allow all containers to talk to each other.
You should use serverless services when:
- You want to quickly scale your application, even being able to shut down completely by not requiring any operation.
- You can get rid of the architecture necessary for the operation of your source code.
- They require faster iterations and production.
Well, that's all I can share with you at the moment, but as I always say: don't believe everything, go find out and consult about what is exposed here. I will always be open to debate if you do not agree with something that I exposed.