DEV Community

Hakatana's Hacks
Hakatana's Hacks

Posted on

What are Microservices?

If you're a computer programmer or software developer, you're no stranger to the ~trendy lingo~ and ~catchy keywords~ used in the industry. Whether it's machine learning, artificial intelligence, neural networks, web components, Web 3.0, or whatever else, trendy lingo in the software industry is like water in swimming - you pretty much can't have one without the other.

One big trend that's come up as of late has been that of microservice architecture. It's a variant of service-oriented architecture which basically splits an application into a collection of loosely coupled services. This allows for greater scalability as well as faster development and deployment: one process in the microservice can be updated and restarted much more easily than the entire service together.

Here's some differences between the monolith and microservice architectures and why you would use each.

Monoliths

Monolith server architecture is the traditional way of deploying a service to the internet: hosting a single process as a single service and having it handle every part of that application's processing. It's very heavy, oftentimes resource intensive, and difficult to develop and update at scale. Additionally, if one part of the code crashed, the entire application would crash, resulting in the need to restart everything all over again.

Microservices

As mentioned above, microservices are much more versatile and scalable. Instead of treating an application as a single service and only using one process to handle everything being thrown at it, microservices partition an application into many... micro-services. Each major task being split into its own service results in the overall application being much less prone to failure and much more easy to update and develop on, and makes it much easier to scale into clusters when it grows too big to live on just one machine. However, microservices tend to be a lot more resource-intensive and frustrating to manage than monoliths because of the need to juggle many services at once, and so, they are usually only used when the application is at a scale where it would make sense to make that trade off for the sake of a better experience for everyone.

image

Both types of server architecture have their own uses: most beginner programmers, for example, will stick to monoliths and only use them until they begin working with large-scale infrastructure due to the lack of need of microservice-based architecture. There is a lot of merit to each, and both of them offer different benefits, but overall, both will continue as the two major types of server architecture going forward.

Watch my video on it here:

https://youtu.be/U54BmiOmDnU

Top comments (0)