Introduction to Microservices
What is Monolithic?

In this course, we will learn the concepts of microservice and spring framework. 

Learning Objectives

  • Microservices Architectural Advantages and Enhancements
  • Microservice Library Organization
  • Microservices Architecture Compared to SOA

Intended Audience

  • Beginner Java developers
  • Java developers interested in learning how to Build and Deploy RESTful Web Services
  • Java Developers who want to develop web applications using the Spring framework
  • Java Developers who want to develop web applications with microservices
  • Java Developers who wish to develop Spring Boot Microservices with Spring Cloud


  • Basic Java knowledge


What is Monolith?

When developing a software system, the monolith architecture is the obvious first choice. Suppose you have a good idea, a solid development team, and sufficient server capacity, you can easily construct a tiered architecture including a database, an application server, a frontend and a backend. With a few lines of code, it can be quickly turned into an instance of a demo application, complete with tightly coupled functions or components such as services, databases, and frontend parts for user interaction. Please take note of the phrase 'tightly coupled', it is representative of the essence of monolithic architecture. In the early days of enterprise software development, systems were improved using this method. It was, of course, the only method. It was natural, which may explain why no special definition was required. When reading white papers or articles on microservices architecture, you'll notice a lot of special definitions made by prominent developers, but you will not find anything similar about monolith.

However, we need to define the term. We can say, a monolithic architecture is a large solid computing network with a single code base that couples all of the business concerns together. Monolithic applications have several key components. Authorization: The part of the application that authorizes users and allows them to use it. In some applications, this component can be found in the business logic layer. Presentation: It allows you to render appropriate content using HTML, CSS, and scripting languages in response to user requests. It is the layer where the user will interact. Business logic: The underlying business logic that drives the functionality and features of the applications. The database layer contains data access objects that access the applications' database.

Application integration: It controls and manages the applications integration with other services and data sources. Over time, certain factors revealed the need for new architecture. These factors were the increase in the amount of data, the need for distributed processing systems, the need to scale systems easily, and the frequency of deployment requests. So, new approaches were developed to meet the needs. The benefits. By the way, there are benefits to monolithic architectures, which is why many applications are still created using this development paradigm. First, monolithic programs may have better throughput than modular applications because in a monolithic paradigm, components are tightly coupled and the communication is made internal, so the communication overhead is minimum. Another reason is that at the beginning of the software development lifecycle, it is usually easier to go with the monolithic architecture since development can be simpler during the early stages.

Constructing a basic model of the application rapidly, testing and deploying it with fewer elements is easier. That being said, the monolithic approach is usually better for simple lightweight applications. For more complex applications that need frequent deployment or evolving scalability requirements, this approach is not suitable. The drawbacks: The more complex the application, the more difficult it is to develop and test with the monolithic architecture. Even if you only add a simple component to the system, you must sometimes consider the entire application. When you change a single line of code, you must run a number of tests. In general, the codebase of monolithic applications is comprehensive, which makes understanding its structure difficult. As a result, new team members may find it difficult to modify the code to meet new business or technical requirements.

Understanding the application becomes more difficult as it becomes more complex. Another side effect of this complexity is that it makes it difficult for developers to write effective and clean code. For each update to a monolithic application, developers must compile the entire codebase and redeploy the full application instead of just the part that was updated, and this makes continuous or regular deployments difficult, which then affects the applications and team's agility. Besides, the application size can also increase startup time and add to delays. Scaling is another drawback of monolithic architecture. Because your business logic is all together and tightly coupled, it's difficult to increase the source for a component that is frequently used. And lastly, reliability is another concern. A bug in any part can potentially bring down the entire application. The bug may cause a runtime exception, which may then cause the application to crash. So, let's take a short break here, my friends, and I'll see you in the next lesson.


About the Author
Learning Paths

OAK Academy is made up of tech experts who have been in the sector for years and years and are deeply rooted in the tech world. They specialize in critical areas like cybersecurity, coding, IT, game development, app monetization, and mobile development.