Microservices
In computing, microservices is a software architecture style in which complex applications are composed of small, independent processes communicating with each other using language-agnostic APIs.[1] These services are small, highly decoupled and focus on doing a small task,[2][3][4] facilitating a modular approach to system-building.[5]
Details
Properties of microservices architecture (MSA):
- The services are easy to replace
- Services are organized around capabilities, e.g., user interface front-end, recommendation, logistics, billing, etc.
- Services can be implemented using different programming languages, databases, hardware and software environment, depending on what fits best
- Architectures are symmetrical rather than hierarchical (producer - consumer)
A microservices-based architecture
- lends itself to a continuous delivery software development process
- is distinct from a service-oriented architecture (SOA) in that the latter aims at integrating various (business) applications whereas several microservices belong to one application only
History
The term "Micro-Web-Services" was first introduced during a presentation at Cloud Computing Expo in 2005 by Dr. Peter Rodgers. On slide #4 of the conference presentation he states that "Software components are Micro-Web-Services". Juval Lowry also had similar precursor type of thinking about classes being granular services, as the next evolution of Microsoft architecture. "Services are composed using Unix-like pipelines (the Web meets Unix = true loose-coupling). Services can call services (+multiple language run-times). Complex service-assemblies are abstracted behind simple URI interface. Any service, at any granularity, can be exposed". He described how a well designed service platform "applies the underlying architectural principles of the Web and Web services together with Unix-like scheduling and pipelines to provide radical flexibility and improved simplicity by providing a platform to apply service-oriented architecture throughout your application environment." [6] The motivation behind this design, which originated in a research project at Hewlett Packard Labs, is to make code less brittle and large-scale, complex software systems robust to change.[7] To make "Micro-Web-Services" work one has to question and analyze the foundations of architectural styles such as SOA and the role of messaging between software components in order to arrive at a new general computing abstraction.[8] In this case, one can think of Resource-Oriented Computing (ROC) as a generalized form of the Web abstraction. If in the Unix abstraction "everything is a file", then in ROC everything is a "Micro-Web-Service". It can contain information, code or the results of computations so that a service can be either a consumer or producer in a symmetrical and evolving architecture.
The term "microservice" was discussed at a workshop of software architects near Venice in May, 2011 to describe what the participants saw as a common architectural style that many of them had been recently exploring. In May 2012, the same group decided on "microservices" as the most appropriate name. James Lewis presented some of these ideas as a case study in March 2012 at 33rd Degree in Kraków in Microservices - Java, the Unix Way as did Fred George about the same time. Adrian Cockcroft at Netflix, describing this approach as "fine grained SOA" was pioneering the style at web scale as were many of the others mentioned in this article - Joe Walnes, Dan North, Evan Bottcher and Graham Tackley.[9]
Philosophy
Philosophy of microservices architecture essentially equals the Unix philosophy of "Do one thing and do it well". It is described as follows:[10][11][12]
- The services are small - fine-grained to perform a single function.
- The organization culture should embrace automation of deployment and testing. This eases the burden on management and operations.
- The culture and design principles should embrace failure and faults, similar to anti-fragile systems.
- Each service is elastic, resilient, composable, minimal, and complete.[12]
Criticism
The microservices architecture is subject to criticism for a number of issues:
- services form information barriers[13]
- the architecture introduces additional complexity and new problems to deal with, such as network latency, message formats, load balancing and fault tolerance,[14] ignoring one of these belongs to the "fallacies of distributed computing"
- testing and deployment are more complicated[14]
- the complexity of a monolithic application is only shifted into the network, but persists:
You can move it about but it's still there!
Speaking of complexity, it is also true that an application made up of any number of microservices has to access its respective ecosystem which is riddled with unnecessary complexity.[16] This kind of complexity can be reduced by standardizing the access mechanism. The Web as a system handles this element very well. It retained essentially the same access mechanism between browser and application resource over the last 20 years. Using the number of Web pages indexed by Google it grew from 26 million pages in 1998 to around 60 trillion individual pages by 2015 without the need to change its access mechanism. The Web itself is the best example that the complexity inherent in traditional monolithic software systems can be overcome.[17][18]
Nanoservices
Fine-grained microservices have been criticized as an anti-pattern, dubbed a nanoservice by Arnon Rotem-Gal-Oz:
[A] nanoservice is an anti-pattern where a service is too fine grained. [A] nanoservice is a service whose overhead (communications, maintenance etc.) outweighs its utility.[19][20][lower-alpha 1]
Problems include the code overhead (interface definition, retries), runtime overhead (serialization/deserialization, network traffic), and fragmented logic (useful functionality not implemented in one place, instead requiring combining many services).
Proposed alternatives to nanoservices include:[20]
- Package the functionality as a library, rather than a service.
- Combine the functionality with other functionality, producing a more substantial, useful service.
- Refactor the system, putting the functionality in other services or redesigning the system.
Languages
Users
Known users of the Microservices architecture:
- Akana
- Amazon
- AnyPresence JustAPIs[22]
- Apprenda[23]
- Axway
- 1060 Research Ltd. has deployed architectures on its platform that contain on average between 3-5,000 individual services since 2003.
- Bluemix
- Cloud Foundry[14]
- The Guardian
- Hailo Taxi
- HP Helion Development Platform
- Jelastic
- Microsoft Azure
- Netflix[24] (Netflix receives nearly two-billion requests each day resulting in roughly 20 billion internal API calls.)
- Nirmata[25]
- nearForm[26]
- Riot Games
- SoundCloud
- Uber
- Joined Node
Implementations
- Docker
- Microsoft Service Fabric (overview, blog announcement)
- MicroService4Net, an implementation that uses Windows services and self hosting web API in order to create micro services easily (C#)
- NetKernel is a uniform resource engine or operating system for developing, testing and running complex, distributed microservice architectures. It consists of a pure-Java microkernel that embodies the ROC abstraction, combined with a small core set of libraries, to provide a minimal ROC system. The system is modular and is extensible both with user modules and with off-the-shelf ready to use dedicated function modules that can be installed from NetKernel's repositories. Modules are hot-swapable allowing for zero-downtime evolution of the software configuration. Out of the box the core platform is accompanied by a comprehensive set of modules which provides a complete self-contained application server, featuring: languages, transformation-tools, integrated developer tools, operational monitoring/control etc.[27]
- Nirmata
- Seneca Microservices Framework and Protocol
- Spring Cloud
- Test tool for Microservices: Wilma[28][29]
- Vert.x[30]
- Baratine is an open-source JVM framework for building reactive applications. Baratine is a unique framework that allows developers to build concurrent & distributed applications without external datasources. Instead of relying on an external database, Baratine services manage their data on a single thread. Because of this data + thread abstraction, Baratine applications do not suffer from database, cache coherency, or synchronization issues. (blog overview)[31]
- KumuluzEE[32] is an open-source microservice framework for Java EE (Java Duke's Choice Award winner 2015)
- Enduro/X framework enables to build distributed microservices based applications for C/C++/Go.
See also
- Microservices Demo Project in Python
- Microservices Demo Project in Java
- Self-contained Systems
- Conway's law
- Fallacies of distributed computing
- Service-oriented architecture (SOA)
- Representational state transfer (REST)
- RISC, "RISC vs CISC" as analog debate
- Unix philosophy
- Web-oriented architecture (WOA)
- Cross-cutting concern
- Microservice Weekly newsletter
Notes
- ↑ Spelling and grammar corrected.
References
- ↑ Martin Fowler. "Microservices".
- ↑ Sam Newman. Building Microservices. ISBN 978-1-4919-5035-7.
- ↑ Eberhard Wolff. Microservices - Flexible Software Architectures. ISBN 978-1-5233-6125-0.
- ↑ Eberhard Wolff. Microservices Primer - A Short Overview. ISBN 978-1-5234-7213-0.
- ↑ Miller, Joseph B. (2014). Internet Technologies and Information Services. Library and Information Science Text Series (2 ed.). ABC-CLIO. p. 269. ISBN 9781610698863. Retrieved 2015-08-04.
As with many complex information technologies, there are two general architectural options: a monolithic, layered system that embodies all the needed functionalities within one large-scale solution or a modular approach based on microservice architecture (MSA). [...] MSA is a more flexible, modular strategy.
- ↑ Rodgers, Peter. "Service-Oriented Development on NetKernel- Patterns, Processes & Products to Reduce System Complexity". CloudComputingExpo. http://sys-contv.sys-con.com. Retrieved 19 August 2015. External link in
|publisher=
(help) - ↑ Russell, Perry; Rodgers, Peter; Sellman, Royston (2004). "Architecture and Design of an XML Application Platform". HP Technical Reports. p. 62. Retrieved 20 August 2015.
- ↑ Hitchens, Ron (Dec 2014). Swaine, Michael, ed. "Your Object Model Sucks". PragPub Magazine (Pragmatic Programmers): 15.
- ↑ James Lewis and Martin Fowler. "Microservices".
- ↑ Lucas Krause. Microservices: Patterns and Applications. ASIN B00VJ3NP4A.
- ↑ Lucas Krause. "Philosophy of Microservices?".
- 1 2 Jim Bugwadia. "Microservices: Five Architectural Constraints".
- ↑ Jan Stenberg (11 August 2014). "Experiences from Failing with Microservices".
- 1 2 3 "Developing Microservices for PaaS with Spring and Cloud Foundry".
- ↑ Robert Annett. "Where is the complexity?".
- ↑ "BRASS Building Resource Adaptive Software Systems". U.S. Government. DARPA. April 7, 2015. "Access to system components and the interfaces between clients and their applications, however, are mediated via a number of often unrelated mechanisms, including informally documented application programming interfaces (APIs), idiosyncratic foreign function interfaces, complex ill-understood model definitions, or ad hoc data formats. These mechanisms usually provide only partial and incomplete understanding of the semantics of the components themselves. In the presence of such complexity, it is not surprising that applications typically bake-in many assumptions about the expected behavior of the ecosystem they interact with."
- ↑ Alpert, Jesse; Hajaj, Nissan. "We knew the web was big". Official Google Blog. Google.com. Retrieved 22 August 2015.
- ↑ "The Story". How search works. Google.com. Retrieved 22 August 2015.
- ↑ Services, Microservices, Nanoservices – oh my!, Arnon Rotem-Gal-Oz
- 1 2 Pratical SOA: 1.1: Nanoservices, Arnon Rotem-Gal-Oz, 2010
- ↑ "Jolie".
- ↑ "AnyPresence Launches a New API Platform for Mobile and IoT Developers".
- ↑ "How Enterprise PaaS can add Critical Value to Microservices".
- ↑ "Microservices" (PDF).
- ↑ "Microservices".
- ↑ http://www.nearform.com/nodecrunch/tag/microservices/. Missing or empty
|title=
(help) - ↑ "Products > Platform". 1060 Research Ltd. Retrieved 12 October 2015.
- ↑ Wilma documentation
- ↑ Wilma source code
- ↑ "Vertx".
- ↑ "Baratine".
- ↑ "KumuluzEE".
Further reading
- Armin Balalaie, Abbas Heydarnoori, Pooyan Jamshidi, "Migrating to Cloud-Native Architectures Using Microservices: An Experience Report", arXiv preprint arXiv:1507.08217