Treinetic

Do You Really Need Microservices ?

As of 2020, the software development industry keeps changing more than any other industry. Programming languages keep changing. Old programming languages like Java, C++, PHP getting new language features and syntax. For example, within the last 2 years, Java had 4 major updates while it took 5 years to release Java 7 after version 6. We as software developers would like to try new technologies. That is what makes us exciting and keep moving. Especially start-up companies always try to keep up with the new technologies and try them. Because unlike corporates start-up does not huge organizational structure.

Do you really need microservices?

My personal experience is a lot of small startup companies trying to adopt microservices architecture to their project just because it is the “NEW TREND”. If you ever google the word “microservices” you would lot of diagrams like this.

According to this diagram each hexagon is small web service with their own database. This looks simple. But the reality is far different from this diagram.

This is the microservices architecture diagram of Netflix. It has around 700 microservices running.

When you start with microservices architecture. You might have a user service that is responsible for handling user registration, login, and other user account-related activities. Then you will have an order service to handle user’s orders. So user order services probably need to know about the user details. Then you need a way to get those details from the user service. To accommodate that you might add an endpoint to the user service return user details and then order service can invoke that endpoint. When you developing in your local development environment you might run these 2 services in 2 different ports. So you know how to access each other. But in the cloud, you might run these services in 2 different instances. They have to discover each in the cloud environment. There are a lot of ways to do service discovery in microservices. You might get service discovery services by default depending on the platform you are using. But service discovery is another critical aspect you need to consider when developing microservices.

Another thing your services might go offline for some reasons. Then your other services that depend on the unavailable service should know how to handle the situation. So you might use Circuit Breaker to handle these situations. And then you need to decouple services as much as you can to avoid dependency between services. So you might use some type of messaging service or event bus to handle messages between services. Then you need to manage multiple databases that are being used by your services.

So what do I suggest?

Starting a microservices project with 2 to 3 developers is not the best idea. Because those developers need to lay the groundwork before start developing the functionalities. My opinion is for startup companies up and running project is far more important than the technology it uses. Being a startup company meaning is trying new ideas and projects. The reality is most of the projects won’t be successful. So the important thing is to get an up and running project and check the user’s feedback and based on that improve the architecture and technologies. Companies that use microservices like Netflix have thousands of employees so comparing a small startup with Netflix and decide to go with the technologies they use can be problematic.

Finally, if you have a well-designed monolithic system it much easier to migrate to microservices. If you think the project cannot be designed properly with a monolithic architecture. First, you need to figure out how to do that. Because If somebody cannot design a proper monolithic system. s/he definitely cannot design a microservices system.

Spread the love