What is a MICROSERVICE ARCHITECTURE and what are its advantages?

preview_player
Показать описание
Microservices are a hot topic in system design interviews. It is important to know why we use them instead of monolithic systems. The short answer is Scalability. The detailed one would be:

Advantages:
1) The microservice architecture is easier to reason about/design for a complicated system.
2) They allow new members to train for shorter periods and have less context before touching a system.
3) Deployments are fluid and continuous for each service.
4) They allow decoupling service logic on the basis of business responsibility
5) They are more available as a single service having a bug does not bring down the entire system. This is called a single point of failure.
6) Individual services can be written in different languages.
7) The developer teams can talk to each other through API sheets instead of working on the same repository, which requires conflict resolution.
8) New services can be tested easily and individually. The testing structure is close to unit testing compared to a monolith.

Microservices are at a disadvantage to Monoliths in some cases. Monoliths are favorable when:
1) The technical/developer team is very small
2) The service is simple to think of as a whole.
3) The service requires very high efficiency, where network calls are avoided as much as possible.
4) All developers must have a context of all services.

Recommended system design video course:

00:00 How do they differ?
02:02 Advantages of Monoliths
03:33 Disadvantages of Monoliths
04:55 Advantages of Microservices
06:16 Disadvantages of Microservices
07:03 Summary
07:57 Thank you!

Along with video lectures, this course has architecture diagrams, capacity planning, API contracts, and evaluation tests. It's a complete package.

References:

System Design Video Course:

The above is a complete course on how systems are designed. Along with video lectures, the course has continuous updates and live classes.

Рекомендации по теме
Комментарии
Автор

I have watched all of your system design videos (till now) on a single seating. Not that I am particularly preparing for interviews, I just find them interesting.
You should continue making these contents. These are rich and practical. Keep it up.

md.mottakinchowdhury
Автор

2023 and this video is still helping out! I'm just new in the software engineering world and yet you've managed to discuss monolithic and microservice systems in a way that even a newbie can understand. I also appreciate the references you've left in the description for further reading. Thank you for this.

joshuapasaba
Автор

Good video but missed some key points in favour of micro services example A. You can design a system with different technologies. B. You do not have to scale the entire system when load is high on just one function. C. Micro services support DevOps which enable Also a microservices design are created using Domain driven design which also maps to the actual business function. To maintain separation of accountability I can have 2 microservices even in the case you mention.

kshitizsingh
Автор

This is a very nice channel. Nice work Gaurav. :).


My 2 cents :)
Monolith Advantage / Microservices disadvantage.
1. Transaction management.
2. One does not have to deal with multiple technology stacks.
3.There is no need to maintain code at the same level for all the services.
You don't need to pass on a jar to other services in order to enable resue of code.
4. Latency (as mentioned in the video)


Microservices advantages
1. No single point of failure.
2. You can use the correct technology stack for the required microservice.
3. Decentralized architecture.
4. Decentralized data management.
5. No need to redeploy the whole application. Deployment is faster and easier.
6.Your microservices should be designed across products. SOA is designed around features. This way of thinking is more customer centric.

mukundsridhar
Автор

Thanks Gaurav. Excellent videos. Though I would like to argue with a statement you are making about microservices vs. monolith. Not just you. Everyone makes this statement about microservices.


Microservice architecture is easier for onboarding new members because they need less context - is just a false statement. Within monolith we can equally identify classes or packages that new developers need to work on without knowing about the rest of the system. Classes within monolith can be tested using unit tests. Microservices need to be tested with integration tests - they are harder to write.


If system is monolithic it doesn't mean that we shouldn't reduce coupling between classes and increase cohesion with in classes. Linux is a monolithic architecture, but Linus speaks a lot about how important it was for them to come up with independent parts inside the kernel. So that these independent parts can be modified without knowing about the rest of the kernel.


So ease of onboarding of new members is not really a feature of microservice architecture.

victordenisov
Автор

As a SWE1, this is the perfect channel on YouTube. Thank you!

dephcn
Автор

Very good explanation in short video .Just adding few more points of my understanding
Monolith is a single application build for many systems.
In Monolith if any modifications done in the code the whole application should be build and deploy. In case of my microservices only the modified microservices will be deployed.
Monolith uses local calls for interaction where as microservices will use network calls. So here Monolith will give better performance as compared to microservices.
Testing will be easier in microservices because we test only modified microservice .
In case of Monolith if any changes done need to perform the functionality testing of whole application to make sure application is working as expected.

pavanch
Автор

Monolith - Single/Multiple machine running the computation

Microservice - It's a division of whole works into business units which are turned into specific microservice.

Adv Monolith:
- Less moving parts
- Good for small teams
- Less duplication for tests etc
- Faster because everything is in same box(procedure calls)

Disadv Monlith:
- Require more context
- Deployment is complex (everything is touching every other thing)
- Too much responsibility on one server (one can break everything)
- Tight coupling

Adv Micro:
- Easy to scale
- Less context required
- Parallel development is easy
- Less hidden parts(more resources can be provided where it is required)

Disadv Micro:
- Tougher to design

Most of the times interviews are high scale and hence micro service is preferred

Thanks for video 😄

Live-hhli
Автор

Hey Gaurav, I am going thru your videos around System Design, they are really crisp and clear. Thanks for your efforts.

Regarding micro-services, I would like to add a few pointers.
1. Even with Larger Systems, sometimes micro-services may not be always a good fit. For example, in stream processing systems where processing is centered around per record based processing and micro service calls would worsen the performance.

2. Deployment of micro-services is far more complicated than monoliths. Because usually with Monoliths, it's a single unit of deployment(Eg: war file if WebApps) but with microservices depending on the scale and grain of the micro-services, there will be N number of deployments needed. It becomes difficult to keep track of the status of each service and in turn, knowing the readiness of the overall system will be a challenge.

3. Microservices are a great fit for mobile and web applications but when it comes to Big-Data world, it would complicate the overall process. For example, In the Web applications, we mostly deal with Web Server, Database and its easier to containerize them but when it comes to distributed systems containerizing them will be a challenge.

I am not against of micro-services but wanted to list down few scenarios where micro-services may not be a great fit.

cseshivaprasad
Автор

You are gem on this programming world bro.... keep this up... Although I am a frontend guy, I get interest in backend bcz u teach very easy way...

GhanshyamDobariya
Автор

Managing several micro-services databases could be on a long run challenging. Great explanations! Hope MIT calls you as a special guest to lecture. :)

etienneekpo
Автор

I want to be able to communicate and speak like you do...You smile so much and have so much charisma...I refrain from smiling most of the time cause I look weird...Idk why! Thanks for inspiring me to improve 🙏🙏

Karthik-kt
Автор

Thanks Gaurav. Yes, Monolith is complex to understand completely in one go and basically tightly coupled. But the point that is a strong advantage there is apart form the fact that procedural calls are faster, in micro service architecture sometimes a service is dependent on too much on other services and when it comes to logging you also need to track the flow of all your calls plus they add an extra network cost, you need to handle all the failures, have retry logic and fall back in place.

kunalsaini
Автор

I teach CS and I like your way of explaining things, you are clever and that positive attitude and smil!. Your chuckle in 7:50 :D is so cute. Keep it up

quranconversations
Автор

In my opinion, "MonolithFirst", by Martin Fowler is the best approach to start a new project for current scenarios.

Because the high competitiveness (short deadlines) and low project budgets (small teams and limited resources).

italosantana
Автор

Now that's what I call method teaching. This is brilliant. Thanks for helping all of us.

zainmotiwala
Автор

Hi Gaurav, Thanks for your efforts it was a good video.

Following are few pointers which i would like to add
1) Monolith application can co-exist with microservices. What i mean here is that suppose if you have a large application which uses a MVC framework then the same application can also use a common services provided by a microservice.
2) Microservice architecture also has its own set of challenges in terms of maintenance and deployment. The Netflix architecture video about Mastering chaos discusses some problems.
3) Now a days the industry does not want a team to only focus on one thing and would like to have a small development team managing multiple application. Too cut costs can be one of the reasons.
4) With the advent of MVVM frameworks on client side like angularJS which performs a lot of processing on the client side would be better complemented with microservice architecture.

Once again Keep up the good work

codetolive
Автор

man.. I'm in the e-commerce business, and so grateful to watch and learn from this content.. thanks a lot for sharing, hope you can share more about IT world! Big Up!

naufalm
Автор

Really well done, concise is the word to describe this video. Since the topic is so well handled viewers can genuinely use this information to make decisions and analyze the need for a mono or micro for a system. So stackoverflow is a monolith that handles a massive load of questions on microservices.

josephfernando
Автор

Really a clear-cut explanation of some of the advanced topics!! Keep it up!

anubhavbhargava