Monolithic vs Microservice Architecture - Yash-777/SteamingServlet GitHub Wiki

Service-Oriented Architecture (SOA) Defination stackoverflow.com

A service-oriented architecture is essentially a collection of services. These services communicate with each other. The communication can involve either simple data passing or it could involve two or more services coordinating some activity.
Web Service is a connection technology, a way to connect services together into a Service Oriented Architecture (SOA).

Web Service is a way to expose the functionality of an application to other application, without a user interface. It is a service which exposes an API over HTTP.

RESTful / REST-style

Representational State Transfer (REST) architectural style is based on a set of principles that describe how networked resources are defined and addressed. Status Codes

An application or architecture considered RESTful or REST-style is characterized by:

  • State and functionality are divided into distributed resources

  • Every resource is uniquely addressable using a uniform and minimal set of commands (typically using HTTP commands of GET, POST, PUT, or DELETE over the Internet)

  • The protocol is client/server, stateless, layered, and supports caching

    Client need some information form server like weather report
    	- if he has permission to update info so will update the weather report
    
     Client -------- HTTP ---------- Server
     Browser --Req and Get HTML ---- from server
    	because html can be parsed by server and displyed
    	design + view
     Third Party App --------------- Java App
     Java App then it can get Java Object from serialization concept so that it de-Serialized back to object and use/display
     
     Non Java App  ------------------ Java App
     i need the Resource info in JSON form So, that i can process it and display in my applicaiton/Mobile APp.
     Server Java app converts Pojo class obj into JSON object, because server needs the information in JSON format.
     This flow is called the Representation state transfer which used JSERY Implementation of JAX API.
    

Web Services could be of any size, including large enterprise apps retrofitted with APIs that too many other apps depended on. Although "micro" in Micro Services, the basic concept is that each service performs a single function. RPC

Micro Services and Web Services are two different concepts of Application Development Architecture, API's are the way of exposing the funtionality of an application.

The monolithic architecture pattern is the traditional architectural style that many systems utilize, with the monolith application built as a single, autonomous unit. Monolithic applications are layered architecture, where all the services/functionality are layered and packaged into single deployable file.

« For example, a Java web application consists of a single WAR file that runs on a web container such as Tomcat.

For the first time developmenat, test and developmenat is easy. but the porblem comes when keep on adding new functionality. When some functionality fails then whole developmenat fails. On adding/chainging small section of code, we must completely rebuilt and deploye the entire application. Microservices help to solve these challenges and more.

Monolithic applications has a barrier to adopting new technologies. Since changes in frameworks or languages will affect an entire application it is extremely expensive in both time and cost. Microservice can be developed using different programming language (Personally I don't suggest to do it).

Microservice architecture is an approach of building large enterprise application with multiple small unit called service, each service develop, deploy and test individually. Each service intercommunicate with a common communication protocol like REST web service with JSON.
Each service runs on a unique/separate process either in single/different machine by maintaining its own/separate storage system in order to be decoupled from other services, communicates through APIs.

Micro Services are designed to cope with failure and breakdowns of large applications. Since multiple unique services are communicating together, it may happen that a particular service fails, but the overall larger applications remain unaffected by the failure of a single module.

Large monolithic code base makes complicated to understand, especially for new developer. Where microservice is small and focused on a specific feature / business requirement.

Microservice is easy to scale based on demand. In a nutshell, monolithic vs microservice architecture is like elephant vs ant approach. What you wants to build a giant system like elephant or army of ant, small, fast and effective.


The term Web Services refers to the technologies that allow for making connections. Services are what you connect together using Web Services. A service is the endpoint of a connection. Also, a service has some type of underlying computer system that supports the connection offered. The combination of services—internal and external to an organization—make up a service-oriented architecture.

The Web is simply defined as the universe of global network-accessible information.

Web's major goal was to be a shared information space through which people and machines could communicate.

Web Examples

Data Element		Modern Web Examples
---------------------------------------------
resource		the intended conceptual target of a hypertext reference
resource 		identifier	URL, URN
representation		HTML document, JPEG image
representation 		metadata	media type, last-modified time
resource metadata	source link, alternates, vary
control data		if-modified-since, cache-control

REST must be created only when it will be used by many apps.

Servelts

The HTTP content type for this format is “application/x-www-form-urlencoded”. This works fine for simple input fields, but web pages may also allow the user to upload one or more files. To support this, another format was created in the early days of the web, and it is known by its content type, “multipart/form-data”.

Micro Service is a single business unit.
All data, all functions which are relavent to a service are put into one service.

Each service will have its own dedicated DB to communicate.

 User -> GateWay RPC call ->  Micro[DB] (BookMyShow/Paytm) -> [DB] (Imax/Inox theater tickets) like way

 Hub - Node - Jar
 
Mono

 User -> GateWay RPC Call -> Mono[DB] Service to Service function call to get the respose [Local call not RPC call].
 
 EndPoint
⚠️ **GitHub.com Fallback** ⚠️