Microservices Science and Engineering: July 2017
Microservices Science and Engineering: July 2017
net/publication/317782761
CITATIONS READS
4 368
6 authors, including:
Some of the authors of this publication are also working on these related projects:
Data Mining and Machine Learning for Knowledge Discovery and Predictive Analysis View project
All content following this page was uploaded by Manuel Mazzara on 22 June 2017.
1 Introduction
2 What is a microservice?
Microservices [1] are not just small services, which means little by itself. It
is an architectural style that originated from Service-Oriented Architectures
(SOAs) [4] [5], that we will try to emphasize here. The main idea is to move
in the small (within an application) some of the concepts that worked in the
large, i.e. for cross-organization business-to-business workflow which makes use
of orchestration engines such as WS-BPEL (in turn inheriting some of the func-
tional principles from concurrency theory [6]).
When following the microservice paradigm, a system is structured by com-
posing small independent building blocks communicating exclusively via message
passing. These components are called microservices. The characteristic differen-
tiating the new style from monolithic architectures and classic Service-Oriented
is the emphasis on scalability, independence, and semantic cohesiveness of
each unit constituting the system.
Indeed, mainstream languages for development of server-side applications
(e.g. Java, C/C++, Python) still provide abstractions to break down the com-
plexity of programs into modules or components [7] [8] [9], but these languages
are designed for the creation of single executable artifacts. In monolithic archi-
tecture the modularization abstractions rely on the sharing of resources of the
same machine (memory, databases, files) and the components are therefore not
independently executable. In Figure 1, the classic monolithic organization is pic-
torially described: here the different layers of the system, from presentation to
access to persistence tools, and including the business logic, are split in terms
of responsibilities between different modules (here indicated by the vertical split
with numbers from 1 to 4). In fact, each module may take part in the imple-
mentation of functionalities related to each layer, the database is common, and
so the access to other resources such as memory.
The first set of question asked in this context typically is: how small? Is a
Microservice a very small service? What does it mean? How do we measure size
(Line of codes, size of executable, number of classes or modules, size of API, size
of team)?
A Microservice is not just a very small service. There is not a predefined
size limit that defines whether a service is a microservice or not. Indeed mi-
croservice is a somehow misleading definition. Each microservice is expected to
implement a single business capability, in fact a very limited system functional-
ity, bringing benefits in terms of service maintainability and extendability. Since
each microservice represents a single business capability, which is delivered and
updated independently, discovering bugs or adding minor improvements do not
have any impact on other services and on their releases. In common practice, it
is also expected that a single service can be developed and managed by a single
team [1].
The idea to have a team working on a single microservice is rather appealing:
to build a system with a modular and loosely coupled design, one should pay
attention to the organization structure and its communication patterns as they,
according to Conway’s Law [12], directly impact the produced design. So if one
creates an organization with each team working on a single service, such structure
4 Manuel Mazzara et al.
will make the communication more efficient not only on the team level, but within
the whole organization, improving the resulting design in terms of modularity.
Microservices’ approach is to keep teams small and communications efficient by
creating small cross-functional (DevOps) teams that are able to continuously
work on the same service and to be fully responsible for it (the “you build it,
you run it” principle [13]). The teams are organized around services, which in
turn are organized around business capabilities [14] The optimal team size for
microservices is best described by Jeff Bezos famous “two pizza team” rule, which
suggests that the size of a team should be no larger than what two pizzas can feed.
The rule itself does not give an exact number, however it is possible to estimate
it to be around 6-8 people. The drawback of such approach is that it is not
always practical from the financial point of view to maintain a dedicated team of
developers for a single service as it may lead to high development/maintenance
costs [15]. Furthermore, one should be careful when designing the high level
structure of the organization using microservices - increasing the number of
services will negatively impact on the overall organization efficiency, if no actions
are taken.
The second set of questions that often arises is instead: is this the same
story than SOA? What are the differences? Indeed there are some notable dif-
ferences. In SOA, services are not required to be self-contained with data and
User Interface, and their own persistence tools, eg. database. SOA has no fo-
cus on independent deployment units and related consequences, it is simply
an approach for business-to-business intercommunication. The idea of SOA was
to enable business-level programming through business processing engines and
languages such as WS-BPEL and BPMN that were built on top of the vast lit-
erature on business modelling [16]. Furthermore, the emphasis was all on service
orchestration more than service development and deployment.
Microservices have seen their popularity blossoming with an explosion of con-
crete applications seen in real-life software [17]. Several companies are involved
in a major refactoring of their back-end systems in order to improve scalabil-
ity [2]. In [3] a real world case study, concerning the migration of a mission
critical system from an existing monolithic architecture to microservices, has
been presented. This case study shows the will of major companies to cope with
scalability issues.
The notable success of the approach gave rise to both academic and commercial
interest, and ad-hoc programming languages arose to address the new architec-
tural style [18]. In principle, any general-purpose language could be used to pro-
gram microservices. However, some of them are more oriented towards scalable
applications and concurrency [19] . The Jolie (Java Orchestration Language In-
terpreter Engine) [18] programming language, for example, is based on the new
paradigm and it allows describing computation from a data-driven instead of
Microservices Science and Engineering 5
Let us illustrate the Jolie syntax with a simple example of the service printing
anything it receives. First we need to define the interface that other services will
use and list all available functions inside (as depicted in Figure 3).
6 Manuel Mazzara et al.
interface PrintInterface {
OneWay: print ( string )
}
include ‘‘console.iol’’
include ‘‘printInterface.iol’’
outputPort PrintService {
Location: ‘‘socket://localhost:8000’’
Protocol: json
Interfaces: printInterface
}
main {
print( line ){
print@Console( line )()
}
Finally, we define the client’s service, including the information needed for
calling the printing service and call to the printing function (print@PrintService)
Microservices Science and Engineering 7
include ‘‘printInterface.iol’’
outputPort PrintService {
Location: ‘‘socket://localhost:8000’’
Protocol: json
Interfaces: printInterface
}
main {
print@PrintService(‘‘Hello, world!’’)
}
After invoking both services, PrintService will print our “Hello, world!”
greetings.
Jolie is an open source project with an active community of developers. Our
team has been working on an extension of the type system [20] and the develop-
ment of static type checking with refinement types [24], as well as development
of the IDE [21]. One of the current projects relates to the augmenting of user
experience. We are trying to make the language easy to use, adding the inline
documentation, value scaffolding, autocompletion and other ergonomics improv-
ing features.
However, there are more ongoing projects aimed on ensuring Jolie type safety.
The approach is to implement the type checker from [25] follows the formal spec-
ification rules defined in [26]. The rules then are encoded on the Jolie interpreter
level and checked by means of Z3 SMT solver [27]. [28] follows a slightly different
approach, it is built on top of a proof assistant instead of a SMT solver, which
helps to ascertain the correctness of the specification. The type checker is written
as well-typed program by means of dependent types in Agda [29] programming
language.
From the architectural point of view, Jolie has the potential to lead to a
paradigm shift. Component-wise each building block is built as a microser-
vice [30] embedding business capabilities in isolation. Every microservice can
be reused, orchestrated, and aggregated with others [31]. This approach brings
simplicity in components management, reducing development and maintenance
costs, and supporting distributed deployments [32].
5 Conclusions
test, deploy, scale (2) easier for new developers and it allows fast start (3) Poly-
glot architecture (each service may use individual technology) (4) Evolutionary
design (remove, add, replace services).
We are actively collaborating with both the scientific world (to develop solid
theories and methodologies in order to improve software quality) and with com-
panies interested to migrate their systems. The next decade will see a growing
attention to the SSE field, and the development of further programming lan-
guages intended to address the paradigm. Changes to scene should be expected,
and these may be comparable to what Object-Oriented programming brought
in the last two decades of the previous century.
References
1. N. Dragoni, S. Giallorenzo, A. Lluch-Lafuente, M. Mazzara, F. Montesi,
R. Mustafin, and L. Safina, “Microservices: yesterday, today, and tomorrow,” in
Present and Ulterior Software Engineering, Springer, 2017.
2. N. Dragoni, I. Lanese, S. T. Larsen, M. Mazzara, R. Mustafin, and L. Safina,
“Microservices: How to make your application scale,” in A.P. Ershov Informatics
Conference (the PSI Conference Series, 11th edition), Springer, 2017.
3. N. Dragoni, S. Dustdar, S. T. Larsen, and M. Mazzara, “Microservices: Migration
of a mission critical system,” https://arxiv.org/abs/1704.04173.
4. M. MacKenzie et al., “Reference model for service oriented architecture 1.0,” OA-
SIS Standard, vol. 12, 2006.
5. Sillitti A., Vernazza T., and Succi G., “Service oriented programming: a new
paradigm of software reuse,” in 7th International Conference on Software Reuse,
Lecture Notes in Computer Science 2319, pp. 269–280, Springer Berlin Heidelberg,
2002.
6. R. Lucchi and M. Mazzara, “A pi-calculus based semantics for WS-BPEL,” J. Log.
Algebr. Program., vol. 70, no. 1, pp. 96–118, 2007.
7. Predonzani P., Sillitti A., and Vernazza T., “Components and data-flow applied
to the integration of web services,” in The 27th Annual Conference of the IEEE
Industrial Electronics Society (IECON01), 2001.
8. Clark J., Clarke C., De Panfilis S., De Panfilis S., Sillitti A., Succi G., and Vernazza
T., “Selecting components in large COTS repositories,” Journal of Systems and
Software, pp. 323 – 331, 2004.
9. Gross H.G., Melideo M., and Sillitti A., “Self certification and trust in component
procurement,” Journal of Science of Computer Programming, pp. 141 – 156, 2005.
10. M. Mazzara and S. Govoni, A Case Study of Web Services Orchestration, pp. 1–16.
Springer Berlin Heidelberg, 2005.
11. Damiani E., El Ioini N., Sillitti A., and Succi G., “WS-certificate,” in 2009 IEEE
International Workshop on Web Services Security Management, IEEE, 2009.
12. M. E. Conway, “How do committees invent,” Datamation, vol. 14, no. 4, pp. 28–31,
1968.
13. J. Gray, “A conversation with werner vogels,” ACM Queue, vol. 4, no. 4, pp. 14–22,
2006.
14. M. Fowler and J. Lewis, “Microservices,” ThoughtWorks. http://martinfowler.
com/articles/microservices. html [last accessed on February 17, 2015], 2014.
15. S. Jones, “Microservices is soa, for those who know what soa is.” http://service-
architecture.blogspot.co.uk/2014/03/microservices-is-soa-for-those-who-
know.html, 2014.
10 Manuel Mazzara et al.