Over a million developers have joined DZone.

Monolithic vs Microservice Architecture

The debate between monolithic architectures, wherein centralization takes precedence, versus microservice construction, which holds that specialized and insular tasks are best left to themselves, has entered a new era with Docker and its ilk. But it's more than architecture, it's a culture of thought.

· Integration Zone

Learn how API management supports better integration in Achieving Enterprise Agility with Microservices and API Management, brought to you in partnership with 3scale

Monolithic architecture is something that build from single piece of material, historically from rock. Monolith term normally use for object made from single large piece of material.” - Non-Technical Definition 

 “Monolithic application has single code base with multiple modules. Modules are divided as either for business features or technical features. It has single build system which build entire application and/or dependency. It also has single executable or deployable binary” – Technical Definition 

 Industry is using this approach since long to develop enterprise application. Many companies have invested years to build enterprise application with monolithic approach. Sometime it also called multi-tier architecture because monolithic applications are divided in three or more layers or tire i.e. presentation, business, database, application, etc. It was a time of browser evaluation. Enterprise was focused on desktop/laptop devices with Web Browser as client, which doesn't require to expose data with API, mainly because browsers can understand only HTML, CSS and JavaScript. Although, Enterprise was using Enterprise Data Bus(EDB), Electronic Data Interchange(EDI) , Enterprise Data Exchange (EDX) and many more ( https://www.oasis-open.org/standards) data exchange format to interact with each other in back-end. Monolithic architecture need of enterprises' at that time.

 Suddenly, entire paradigm shift from browser / desktop to mobile / smart devices. Enterprise need to serve data to different devices and form factors (smart phone, tablet, handheld, etc). Smart phone become always available, always on and personal device for everyone, which demand information anytime, anywhere, on fingertip. Mobile application is nearly useless without internet connectivity and backend services. Now is a time for mobile first, every enterprises are looking forward to develop mobile application before web. To developer mobile application enterprise need to expose data using API (REST or SOAP) because legacy data exchange format was not compatible with mobile application. With increasing demand of mobile application force to change back-end architecture. This is prime force behind migrating monolithic architecture to microservice architecture.

 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 run individually either in single machine or different machine but they execute its own separate process. Each service may have own database or storage system or they can share common database or storage system. Microservice is all about distribute or break application in small chunks.

 Microservice is more than code and structure. It’s way of working. Its culture in a way, every developer or team own some part of large application. Microservice is not ultimate solution for every application but it’s surely solution for large enterprise application. Microservice has some shortfalls like increase lot of operations overhead, DevOps skills required, complex to manage because of distributed system, bug tracking become challenging.

 Difficulties with monolithic application, when it grow 
  • Large monolithic code base makes complicated to understand, especially for new developer
  • Scaling become challenging
  • Continuously integration / deployment become complex and time consuming. You may require dedicated team for build and deploy
  • Overloaded IDE, Large code base makes IDE slow, build time increase.
  • Extremely difficult to change technology or language or framework because everything is tightly coupled and depend up on each other.
   Privilege with Microservice architecture, when it grow 
  • Each microservice is small and focused on a specific feature / business requirement.
  • Microservice can be developed independently by small team of developers (normally 2 to 5 developers).
  • Microservice is loosely coupled, means services are independent, in terms of development and deployment both.
  • Microservice can be developed using different programming language (Personally I don't suggest to do it).
  • Microservice allows easy and flexible way to integrate automatic deployment with Continuous Integration tools (for e.g: Jenkins, Hudson, bamboo etc..). The productivity of a new team member will be quick enough.
  • Microservice allows you to take advantage of emerging and latest technologies (framework, programming language, programming practice, etc.).
  • 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.

Unleash the power of your APIs with future-proof API management - Create your account and start your free trial today, brought to you in partnership with 3scale.

monolithic architecture,mobile application,data exchange format

Published at DZone with permission of Ketan Parmar, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}