What Is Microservices Architecture and How Does It Differ From Monolithic?

924.1K views
•
December 29, 2019
by
edureka!
YouTube video player
What Is Microservices Architecture and How Does It Differ From Monolithic?

TL;DR

Microservices architecture structures an application as a collection of small, autonomous services, each built around one business capability and communicating through well-defined interfaces such as REST or messaging. It solves the problems of monolithic systems: tight coupling, slow development, hard scaling, unreliability and inflexibility toward new frameworks and languages.

Transcript

Microservices is the New Age Technological Marvel that is used by today's Industries to create and deploy applications. So it's a great time for you to start learning about this trending technology. Hi all I welcome you to this Microservices full course and what follows is a session that will give you a complete insight to get you started with Micr... Read More

Key Insights

  • Monolithic architecture is a single self-contained piece of software in which all components are interconnected and interdependent, like one big container where every part is assembled and tightly packaged together.
  • A monolith is simple to develop, simple to deploy and simple to scale, because tools and IDEs support it and you only run multiple copies of one executable behind a load balancer.
  • Large monolithic applications become complex to understand and modify as they grow, so development slows down, modularity breaks down over time and code quality declines.
  • Monoliths block continuous deployment because updating one component, such as the cart service in an e-commerce site, forces a redeploy of the entire application and raises the risk of failures.
  • Monoliths scale poorly because each copy gets access to all the data, which makes caching less effective, and components with different CPU or memory needs cannot be scaled independently.
  • Monoliths are unreliable because all modules run in the same process, so a bug in any one module can bring down the entire application, and identical instances share the same bug.
  • Monoliths are inflexible: rewriting millions of lines of code to adopt a new framework or language is so expensive in time and cost that it creates a huge barrier to new technology.
  • Microservices architecture structures an application as a collection of small autonomous services modeled around a business domain, where each service focuses on a single business capability and talks to others through APIs rather than shared data structures.

Explore YouTube Video Summarizer or Get YouTube Transcript Extractor

Questions & Answers

Q: What is monolithic architecture?

Monolithic architecture is a design in which the entire software is composed as a single piece that is meant to be self-contained. All components are interconnected and interdependent, giving a tightly coupled system where each component and its associated components must be present to execute or compile the code. It works like one big container in which all parts are packaged together.

Q: What are the advantages of a monolithic architecture?

A monolithic application is very simple to develop because development tools and IDEs are built to support it, which makes development easy and straightforward. It is simple to deploy because you deploy one executable file at run time. It is also simple to scale, since you run multiple copies of the application behind a load balancer.

Q: Why is a monolithic application hard to update and deploy?

Because everything is one application, updating even a single component forces a redeploy of the entire application. In the e-commerce example, changing the cart service means redeploying the customer and product services too. This interrupts background tasks, risks components that were not changed failing to start because of dependency issues, and discourages frequent updates.

Q: Why is a monolithic architecture considered unscalable?

Each copy of a monolithic application instance gets access to all the data, which makes caching less effective and increases memory consumption and input/output traffic. Different components also have different resource needs, with some being CPU-intensive and others memory-intensive, but a monolith cannot scale each component independently. Scaling only the customer service means scaling the product and cart services as well.

Q: Why are monolithic applications unreliable?

Tightly coupled components mean that if one of them goes down, the entire system can fail to run. All modules run inside the same process, so a bug in any module can potentially bring down the whole process. Because all instances of the application are identical, the bug affects the availability of the entire application.

Q: Why is it difficult to adopt new frameworks in a monolith?

With a monolith it becomes very hard to adopt new frameworks and languages. If millions of lines of code are written in one framework, rewriting the whole application to use a newer one is extremely expensive in time and cost, even if the new framework is considerably better. This creates a huge barrier to adopting new technologies.

Q: What is microservices architecture?

Microservices architecture, also called microservices, is an architectural style that structures an application as a collection of small autonomous services modeled around a business domain. Each service is a self-contained process that provides a distinct business capability. Services do not share data structures and communicate through APIs, so each can focus on one single business capability.

Q: How do microservices communicate with each other?

In a microservices architecture, components are divided into separate modules that communicate with each other through a well-defined interface, usually REST or messaging. The communication is stateless, meaning each pair of request and response is an independent transaction. Services do not share data structures, so they interact only through their APIs.

Summary & Key Takeaways

  • The course starts with why microservices are needed, explaining monolithic architecture through an e-commerce example with customer, product and cart services deployed as one application. It lists the advantages of a monolith, which are easy development, deployment and scaling, before turning to its drawbacks.

  • The drawbacks covered are growing complexity, slow development, blocked continuous deployment, poor scalability, low reliability and inflexibility toward new frameworks. Each is tied to the tightly coupled nature of a monolith, where updating or scaling one component affects the whole application and one bug can bring everything down.

  • Microservices are then defined as small autonomous services modeled around a business domain. Using the same e-commerce example, the components are split into separate modules that communicate through well-defined interfaces, usually REST or messaging, with stateless communication in which each request and response is an independent transaction.

  • The agenda also covers microservices with Spring Boot and Docker, microservices versus SOA, microservices versus APIs, design patterns, tools, security of microservices applications and top interview questions, so learners get a path from fundamentals to interview preparation.


Read in Other Languages (beta)

Share This Summary 📚

Explore More Summaries from edureka! 📚