➤ How to Code a Game
➤ Array Programs in Java
➤ Java Inline Thread Creation
➤ Java Custom Exception
➤ Hibernate vs JDBC
➤ Object Relational Mapping
➤ Check Oracle DB Size
➤ Check Oracle DB Version
➤ Generation of Computers
➤ XML Pros & Cons
➤ Git Analytics & Its Uses
➤ Top Skills for Cloud Professional
➤ How to Hire Best Candidates
➤ Scrum Master Roles & Work
➤ CyberSecurity in Python
➤ Protect from Cyber-Attack
➤ Solve App Development Challenges
➤ Top Chrome Extensions for Twitch Users
➤ Mistakes That Can Ruin Your Test Metric Program
Microservices Introduction | We will examine some of the terms commonly used in microservices. And see what is Monolithic Application, its advantages and disadvantages, Microservices Design Overview, and Spring Cloud Netflix Components.
Microservices: It is a design used to develop applications by decomposing modules into applications and integrating them using web services. Microservices is not coding, it is theory/design. For this coding is Spring Cloud.
What is Cloud computing? Using services over the network for rental is called Cloud computing. For example you have started a new software company today then you will need servers but server setup is very costly. So, instead of server setup, you go for renting the servers and pay the server provider based on usages/services.
We will need mainly three types of services:- Hardware, OS, and Applications.
- IaaS: Using Hardware (Hard Disk, Network, Processor, etc.) is called Infrastructure as a Service (IaaS)
- Paas: Using OS (Windows server, Unix server) is called as Platform as a Service (Paas)
- SaaS: Using Applications (Tomcat server, Oracle tools, databases, etc.) is called Software as a Service (SaaS)
What are different cloud computing providers? AWS (Amazon Web Services), Google Cloud, and Microsoft Azure are popular cloud computing providers. By using them we can run our application.
What is Spring Cloud? Where it is used? To develop applications using Microservices design, Spring Cloud is used.
Cloud computing vs Spring Cloud? Cloud computing is used to run the application whereas Spring cloud is used to develop the Microservices design.
To know what is microservices (not coding) we have to see the below concepts:-
- Monolithic Application
- Monolithic Advantages
- Monolithic Limitations
- Scaling
- SOA (Service Oriented Architecture)
- Microservices design
- Spring Cloud Netflix OSS components
Monolithic Applications
One application that contains multiple services together and is deployed as a single unit is called a Monolithic Application. In short, we can say monolithic application = complete project as a single unit (.jar/.war file).
- Application = Collection of Services
- Project = Collection of Modules
Let us see an example of an Application/Project. Consider any e-commerce website. It provides the following services:- Register, Login, Search items, Add to Cart, Payment, Track, History, Help, Feedback, Review, Logout. In a monolithic application, all these services will be developed as a single application.
To develop a monolithic Java application, first, we will write the source code (.java) containing all services together, compile it (.class) then build the project which will create a .jar/.war file, and finally, deploy it to the server.
What is build? Creating the final format of a project code that can be deployed to the server is called build. Example: creating .jar/.war file. To build the project we can use Maven Goals ‘Maven Clean’ and ‘Maven Install’ or we can automate the process using Jenkins with Maven/Gradle or AWS pipeline.
Maven clean
will delete the old files from the target folder. Maven install
will download all the dependencies and create the .jar/.war file in the target folder. To run the .jar/.war file we can use java -jar <project.jar/.war>
. In real time Jenkins with Maven/Gradle or AWS Pipeline is most commonly used which automates the build process.
What is Deploy? Placing the build file (.jar/.war file) inside the server and starting the server is called deploy.
What is a server instance / Service Instance? An Application running inside one server is called a service instance. Each service instance will have a unique instance ID.
What is the default max capacity of a server (or) the default max number of requests a server can process at a time? 200 (default). But we can modify that as follows:-
server.tomcat.threads.max=400
server.jetty.threads.max=400
What is Load and Load Factor? One server creates one request thread when a request comes. One request thread is called one Load.
- Load = Current number of requests under processing
- Load Factor = Current Load / Max Load. Assume the current load is 20 then load factor = 20/200 = 0.1
- Load Factor always varies in the range of 0 (min) to 1 (max)
What is scaling and how many types do we have? Scaling is the process of increasing resource processing capacity. That provides fast/more service. It is 2 types:-
- Horizontal Scaling: Creating multiple instances of the same service/project. Each instance will have a unique ID called IID (Instance ID). Most of the time these multiple instances are created at different servers so that if one server is down then other servers will be available.
- Vertical Scaling: Increase current system capacity/hardware configuration like RAM, Processor, Hard disk, network .. etc.
MySQL and Oracle primarily support vertical scaling, while MongoDB supports both vertical and horizontal scaling.
What is LBS (Load Balancing Server)? Why is it used for? LBS (Load Balancing Server) is a mediator server, it will distribute requests equally to multiple instances to execute. It will allocate an instance that has less Load Factor. If all/multiple instances have the same load factor, then any one random instance will be allocated.

Advantages of Monolithic Application
- Simple to develop the application using basic Layers design (Presentation Layer, Service Layer, and Data Access Layer).
- Easy to test as it is a single application. By using a single script like the Selenium tool and execute end to end test.
- Easy to deploy the application. Create the build then place it in the server and start.
- Scaling is also a simple process. We can create multiple instances (Horizontal Scaling).
Example:- Spring Thymeleaf CRUD Application
Limitations of Monolithic Application
- We must rebuild and re-deploy the entire application even for small modifications/updates in code.
- These are not reliable applications [may not work properly every time].
- If one small problem exists in one module, it may affect other modules’ execution/stop completing project work. It leads to memory issues, bugs in code, wrong output .. etc because of high cohesion/tight connected design.
- Adding new concepts/Adopting new technologies may affect project design, take time, affect cost, and code may become complex.
- When new modules are added then application size, code, and memory may increase which affects deployment time, debugging, CI/CD pipeline management, log tracing .. etc.
- On Scale, all instances may not use memory properly for all modules. Resource utilization issues may come.
We have various forms of Monolithic with names like Single-Process Monolith, Modular Monolith, Distributed Monolith.
Microservices Design Overview
What are Microservices? Microservices can be defined as:-
- An independent deployable component.
- A Decoupled Architecture.
- Module as a project / Service as an Application.
- Independent services make resource utilization and communication using web services.
Monolithic App: All Modules were together as a single project.
Microservices: One Module as one project and interacts using web services.
Microservices Advantages
- Effective Resource Utilization
- Parallel implementation
- CI/CD (Continuous Integration/Continuous deployment) is easy.
- Less Cohesion (connectivity between two moduli). So, one module’s problem may not affect other modules. No need to re-build and deploy all projects even on one service change.
- Adding a new concept/module/service needs another instance and integration is also easy (web services).
Limitations in Microservices
- Maintenance (There will be multiple server/ instance/ log files/deployments)
- Debug process (Finding Bugs and execution flow)
- Testing Process.

Spring Cloud [Netflix] – Components
Register and Discovery Server | Eureka Server |
Intra Communication Clients | DiscoveryClient, LoadBalancerClient, FeignClient |
Fault tolerance / Circuit Breaker | Hystrix with Dashboard |
Log Trace and Visualize | ELK (Elastic Search, Logstash, Kibana), Zipkin and Sleuth |
Message Queues | ActiveMQ, RabbitMQ, Apache kafka |
Production Support Endpoints | Actuator with Admin UI |
Config Server (common properties) | Git Accounts (GitHub / Gitlab) |
API Gateway | Zuul |
Security | JWT, OAuth (FB, GOOGLE, etc) |
SOA (Service Oriented Architecture)
SOA (Service Oriented Architecture) design is used to link two applications that are running in different places/servers.
Components of SOA
- Service Provider: Provider application contains logic to give actual service. Ex: Payment Service, Email Service, Message Service, etc.
- Service Consumer: It contains logic to make HTTP calls to the service provider that gets services executed and output.
- Service Register and Discovery: It contains service provider information like where it exists (IP and PORT), Load Details, and Logical information (service Name, instance ID, common Path). It will hold service information and provide it on request to consumers.

Operations of SOA
- PUBLISH: The service provider code is called Skeleton this code is converted into a document (globally understandable format like XML) and placed inside the Registry server.
- FIND: Consumer able to detect the service.
- BIND: Consumer code (called Stubs) makes the request and gets a response.
If you enjoyed this post, share it with your friends. Do you want to share more information about the topic discussed above or do you find anything incorrect? Let us know in the comments. Thank you!