8 Mandates for Developing Durable Software Systems with Microservices
Introduction
3.2 Trillion cells in one human body alone, if we consider all life whether plant or animal, is but a combination of cells, then we can only wonder at the amazing diversity of life that we see and experience in the natural world. The core structure of cells seems to be astonishingly uniform, they have membranes that allow for external interaction, and internal structures that allows them to perform specialized functions. Groups of these cells make tissue, tissues make muscles, muscles make organs, organs make biological systems and biological systems make up the living entity. No cell is individually aware of the entire entity, it just does its specialized function that it is programmed for.
Software engineers have now finally caught up to the simple elegant design secret, used by nature for billions of years to evolve myriad and fabulous life forms. “Isolate base functions into small units and use a universal interface pattern to allow these units to interact and create complex systems”. Software engineering practitioners refer to these functional units as microservices and the universal interfacing pattern as REST.
Implementing software by utilizing microservices has proved to be game changing, the current rapid pace of technology innovation will force all software engineering teams to implement microservices design in their software implementations, or they will not be able to keep their software viable in the face of constantly evolving and changing technologies.
You can click here for my post on "A Bounty of Emerging Technologies"
Microservices - A Panacea for Disruption
The onslaught of technology innovations continuously threatens sustained utilization of any software. It is becoming incumbent for software engineers that the software they build is reusable not only across current implementations but is also built so all foundational domain components can easily be used in their existing states with emerging technology disrupters. Failure to effectively reutilize established domain components as new technologies rapidly unsettle market dynamics could easily cause long transformation timelines for entrenched products, which in turn will rapidly erode their market shares.
A successful microservices centered development strategy can mitigate the risk of premature sun-setting for software products that have potential for extensively growing their market share. This strategy allows development teams to work simultaneous on diverse application requirements. Development teams can develop collections of fine-grained loosely coupled services that can be continuously delivered and deployed.
However, a preponderance of available frameworks and seemingly conflicting best-practice recommendations could easily misdirect teams while trying to establish a long term microservices strategy that will ensure product durability in the market.
Teams with existing microservices strategies or looking at adopting microservices development strategies will do well to make sure that their implementations adhere to these eight mandates..
1. Microservices are implemented over HTTP and are RESTful
Microservices are implemented over HTTP and adhere to REST architectural properties and constraints. The Uniform Interface enforced by REST ensures message exchanges adhere to a standard structure and are always construed unambiguously. RESTful communication over HTTP will allow microservices to be hosted on any web server platform that serves HTTP requests.
2. Microservices exchange data in JSON format
Enforcing JSON-in/JSON-out for implementing microservices ensures language and platform independent communications. The name-value pairs used in JSON allows data structures that are open-ended and therefore not restricted by any early data-model design deadends. This in-turn allows easy extension of already implemented functionality while allowing existing implementations to continue to be fully supported.
3. Wherever possible, client components are assimilated using microservices
Any code that needs to be executed on a client machine and is not required to be natively installed (e.g. HTML, JavaScript, etc.) is assimilated using microservices. This enforces decoupling of any end-user interaction from domain functions. This decoupling allows easy re-use of domain functions across any multitude of end-user devices. The required client code itself can be developed and managed utilizing best-fit development tools, however finalized code will not be directly deployed on the web server but will be available to microservices for on-request context based assimilation.
4. Non-standard interface requirements are implemented by lightweight edge functions
Any interface that is needed with systems that do not support REST are implemented by edge functions that specialize in the required interface protocol. Edge functions are used not only for implementing external interface requirements be it for non-HTTP protocols like FTP, SFTP etc., for non-REST message formats like SOAP, for non-JSON data formats like XML, but also for internal data stores requiring traditional JDBC, ADO.NET etc. data connections. Such edge functions are very lightweight and do not contain any business logic. They only provide minimal service for connecting and transforming in-coming or out-going data into the needed formats.
5. Deployed microservices cannot be overwritten
A version of a microservice is developed and deployed only once. Any updates required for fixing errant behavior, changing, or enhancing behavior must be implemented in a new version of the microservice. This allows different versions of a microservice to live simultaneously in the production environment. Previously implemented functions dependent on an earlier version can therefore continue to be used as-is, till their usefulness is naturally sunset.
6. Application assembly is dynamic
The application experience for end consumption is dynamically formulated at the time it is required. The end-user experience is implemented by dynamically stitching the right version of the right microservice to deliver requested functionality. Configuration tooling allows automatic defaults to preferred versions and surgical overrides based on need.
7. Microservice policing is automated
Microservice policing and administration tasks are automated. The implemented microservice framework relies on the “convention over configuration” design paradigm. Developers make minimal to no core design decisions for implementing needed functionality. The core patterns for common tasks like error handling, logging, fault-tolerance, security, asynchronous worker processing, handled and un-handled event capturing, notification generation etc., are regulated by standardized implementations. Documentation is near auto generated, referable and shareable. Locating, reference searching, redundancy protection etc. is readily facilitated through a strong toolkit and augmented by automated worker processes.
8. Microservices should be agnostic to the hosting web service platform.
Worker microservices should be loosely coupled to the web service platform that hosts the microservices. This allows easy portability to newer, lighter, faster, better platforms as and when they become available and optimal for continued efficiency and compatibility with emergent industry capabilities.
Succeeding with a Microservices Development Strategy
A failure to adequately adopt and evangelize the right framework and guidelines could easily lead to delivery failures despite utilizing a microservices based development strategy. Successful implementation requires best practices and standards to be well understood and followed across the development team. A robust and well managed development team utilizing a microservices strategy grounded on the right mandates will see huge success in their implementation and will be able to respond rapidly and effectively to changing business needs.
You can click here for my post on rapid continuous evolution for software products.
The views and opinions expressed here are posted in my personal capacity and do not represent any other entity that I may be affiliated with. I will love to hear your thoughts, comments or questions on this post. - Matin Bajighar, August 14, 2017.
I agree 100% with the author. The eight (8) micro-services implementation mandates are a great way to summarize the micro-services development strategy. Fortunately, most of the modern micro-services frameworks are designed based on these or similar guidelines.