You are on page 1of 7

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/324959098

From Monolithic to Microservices: An Experience Report from the


Banking Domain

Article  in  IEEE Software · May 2018


DOI: 10.1109/MS.2018.2141026

CITATIONS READS
46 2,910

5 authors, including:

Antonio Bucchiarone Nicola Dragoni


Fondazione Bruno Kessler Örebro universitet, Sweden, and Technical University of Denmark
120 PUBLICATIONS   1,417 CITATIONS    130 PUBLICATIONS   2,012 CITATIONS   

SEE PROFILE SEE PROFILE

Schahram Dustdar Manuel Mazzara


TU Wien Innopolis University
65 PUBLICATIONS   1,770 CITATIONS    267 PUBLICATIONS   2,053 CITATIONS   

SEE PROFILE SEE PROFILE

Some of the authors of this publication are also working on these related projects:

A Machine to Machine framework for the charging of Electric Autonomous Vehicles View project

Data Mining and Machine Learning for Knowledge Discovery and Predictive Analysis View project

All content following this page was uploaded by Manuel Mazzara on 08 September 2018.

The user has requested enhancement of the downloaded file.


FOCUS: MICROSERVICES

From Monolithic back-end systems to accommodate


the advantages of the new para-
digm. This is the case for the system

to Microservices
and the institution considered in
this article—i.e., the FX Core of
Danske Bank. (FX stands for foreign
exchange, which is also called forex.
It is the exchange of currencies—i.e.,
the conversion from one currency to
An Experience Report from another.)
In monolithic architectures, the
the Banking Domain modularization abstractions rely on
the sharing of resources of the same
machine (memory, databases, or
Antonio Bucchiarone, Fondazione Bruno Kessler files), and the components are there-
fore not independently executable.
Nicola Dragoni, Technical University of Denmark and Örebro A notable problem of monoliths in-
University volves scalability and, in general, all
the aspects related to change.5 In the
Schahram Dustdar, TU Wien microservice paradigm, a system is
structured by composing small inde-
Stephan T. Larsen, Danske Bank pendent building blocks, each with a
dedicated persistence tool and com-
Manuel Mazzara, Innopolis University municating exclusively via message
passing. In this kind of organization,
the complexity is moved to the level
// This experience report of a real-world case of coordination of services.
study from the banking domain demonstrates Each microservice is expected
to implement a single business
how reimplementing a monolithic architecture capability—in fact, a very limited
into microservices improves scalability. system functionality—bringing ben-
efits in terms of service scalability.
The case study is based on Danske Bank’s
Since each microservice represents
FX Core currency conversion system. // a single business capability, which
is delivered and updated indepen-
dently, discovering bugs or adding
minor improvements does 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. 2,6 The idea to have a
team working on a single microser-
MICROSERVICES1–3 ARE AN ar- large—i.e., for cross-organization vice is rather appealing: to build a
chitectural style that originated business-to-business workflow. The system with a modular and loosely
from service-oriented architecture shift toward microservices is a sen- coupled design, you should pay at-
(SOA),4 with the idea of bringing sitive matter these days, seeing tention to the organization structure
into the small (within an application) as how several companies are in- and its communication patterns be-
those concepts that worked in the volved in a major refactoring of their cause they, according to Conway’s

50 I E E E S O F T WA R E | PUBLI S HED BY THE IEEE COMPUTER SO CIE T Y 0 74 0 -74 5 9 / 1 8 / $ 3 3 . 0 0 © 2 0 1 8 I E E E


law,7 directly impact the produced
design. So, if you create an organi-
zation with each team working on
External clients
a single service, that structure will
make the communication more effi-
cient not only on the team level but Danske Bank Markets
FX IT
also within the whole organization,
improving the resulting design in Danske Bank
terms of modularity. clients
Microservices is not just another
name for SOA. Indeed, there are
some notable differences. In SOA, FIGURE 1. The FX IT system. FX stands for foreign exchange.
services are not required to be self-
contained, with data, a user in-
terface, and their own persistence The business functionalities were assets from one currency to another
tools—e.g., a database. defined mostly by communicating and exporting or importing products
SOA does not focus on inde- with stakeholders (FX traders) and to and from foreign markets.
pendent deployment units and re- were iteratively added according to FX has grown with globalization
lated consequences; it is simply an the level of priority for the business and is now the largest financial mar-
approach for business-to-business itself. We considered case by case ket in the world, averaging a daily
inter­
communication. The idea of whether a functionality should result transaction volume of roughly five
SOA was to enable business-level in a new service or not. If the busi- trillion dollars. This results in some
programming through business pro- ness functionality seemed isolated transactions reaching hundreds of
cess engines and languages such as and big enough, or it was shared millions of dollars. Unlike the stock
WS-BPEL (Web Services Business among numerous other business exchange, there is no centralized
Process Execution Language) and functionalities, then it resulted in market. Instead, FX is decentral-
BPMN (Business Process Model and a new service. In some cases, some ized and done over the counter; i.e.,
Notation) that were built on top of functionalities might have been ini- traders negotiate prices and trade
the vast literature on business mod- tially included together in a service directly between each other. Trad-
eling.8 Furthermore, the empha- and only later moved into their own ers are typically the largest multi-
sis was all on service orchestration separate services. For example, this national banks, trading on behalf of
rather than on service development occurred when the functionality was their customers or themselves. Ad-
and deployment. too big or was equally required by ditionally, due to the decentralized
In this article, we report the expe- multiple services. and global nature of FX, the market
rience of migration from monolithic One of the benefits of this ap- is open 24 hours a day, five days a
to microservices of Danske Bank’s proach is that it has distanced the week.9
FX Core system. The documentation team from the old implementation, The FX IT system (see Figure 1)
of the original system architecture hindering the possibility of reimple- is part of the bank’s Corporates and
was sparse, and the vast majority of menting everything as a distributed Institutions (C&I) department, and
technical details were obtained by monolith. it acts as a gateway between the in-
direct conversations and interviews ternational markets and Danske
with the FX Core team and by man- Danske Bank’s FX Core Bank’s clients and traders. C&I’s
ually inspecting the source code. System clients are mainly large financial in-
FX encompasses everything from stitutions and large multinational
Migration Process private transactions performed in corporations. The FX Core system is
The migration process was business- foreign countries (e.g., Internet shop- part of FX IT; it handles trades and
driven and outside-in; i.e., the sys- ping from abroad and the use of line checks—i.e., checking whether
tem was designed and implemented credit cards while traveling) to cor- a client has the financial collat-
one business functionality at a time. porations moving their financial eral (e.g., stocks, bonds, or cash) to

M AY/J U N E 2 0 1 8 | I E E E S O F T WA R E 51
FOCUS: MICROSERVICES

External providers

External-provider APIs

ResponsibilityService LinecheckService
PostgreSQL

AuthService RabbitMQ TradingService Mainframe

TracingService DataSyncService
Cassandra
DB2
(mainframe)
MonitoringService FailoverService
Redis
lcinga cache
LoggingService ConfigurationService
PostgreSQL

ElasticSearch
cAdvisor

Kibana

FIGURE 2. The new FX Core microservice architecture.

perform a trade and how a trade will completely replace the old monolithic the whole architecture with a
affect that collateral. This includes architecture (see Figure 2). single command. All these op-
registration, validation, and post- The experience of migration, ex- erations had to be done manu-
trade management. plained next, is an example of how ally before. Also, all container
So that the information can be this kind of architecture can be im- images are hosted in an internal
publicly available, all the confiden- plemented in an enterprise setting. Docker Registry, a central repos-
tial details such as concrete names Here, we identify major improve- itory. New images are deployed
of protocols, external providers, and ments of the migration, regarding to the internal registry when a
specific services have been withheld. both architectural aspects and com- new version of a service is suc-
Furthermore, the internal logic of pany processes: cessfully built and tested by the
certain components cannot be de- continuous-integration system.
scribed in depth. • Containerization/Docker. All • Automation. All the services in
services are now hosted in Linux the architecture now have an
FX Core Microservice containers on the Docker Swarm automated continuous integra-
Architecture Cluster. This enables the use of tion and continuous deployment
Danske Bank’s new FX Core archi- the suite of tools provided by (CICD) pipeline. The tooling
tecture is based on the micro­service Docker. For example, the system coming with Docker Swarm has
architectural style and is intended to uses Docker Compose to deploy an API enabling automation of

52 I E E E S O F T WA R E | W W W. C O M P U T E R . O R G / S O F T W A R E | @ I E E E S O F T WA R E
several infrastructural tasks— compared to the large monolithic the system that they do not control.
e.g, rolling updates—that can services. They do not integrate di- Since the team controls the whole
be utilized within the CICD rectly, resulting in looser coupling infrastructure with Docker, includ-
pipeline. Modern DevOps ap- and less chance of feature overlap- ing databases and ports open to out-
proaches for CI and CD can now ping in the future. For example, in side clients, the team can eliminate
be applied, bringing full automa- the monolithic architecture, trade all unwanted access. This allows the
tion to the process and following registration and line checks were team to develop open APIs for cli-
the DevOps corporate philoso- handled by both ForexAPI and ents and traders in the bank to use,
phy of reducing barriers between RequestService. In the microservice thus eliminating direct database que-
teams. Dockers allows support- architecture, TradingService and ries and the like. This gives the team
ing such an approach. LineCheckService are handling these full ownership and control of inter-
• Orchestration. Docker Swarm tasks individually, instead. nal implementation details.
allows orchestration. Failed The monolithic architecture had Internally, the microservices
services can be automatically many shared components, but in integrate only via messaging on
restarted, providing self-healing. the microservice architecture, this RabbitMQ. Due to using message-
The orchestration tooling also has been reduced to only one shared based choreography, the services
allows service discovery and component—the Lambda frame- do not call each other directly, thus
load balancing. work. Lambda is very minimal and resulting in very low coupling and
• Integration. Services now inte- is only meant to be a framework to no interfaces to violate. The system
grate via message-passing chore- connect to the infrastructure and does communicate to external sys-
ography, with RabbitMQ as the provide standard formatting meth- tems via other paradigms, such as
messaging system (see Figure 2). ods for, e.g., messages, logs, and proprietary protocols to external
health checks. providers and, in the future, REST
On the IT department’s roadmap Due to the criticality of the infor- APIs. (REST stands for Representa-
for the internal datacenters is the mation involved and the clearance tional State Transfer.)
adoption of the Red Hat OpenShift necessary to take action, the main- The team aimed for a polyglot
(www.openshift.com) Iaas/PaaS (in- frame will still be attached to the architecture, meaning that it is not
frastructure as a service/platform as micro­ service architecture for some technology dependent. The team is
a service) platform. However, at the time to come. But, over time, the func- no longer dependent on the .NET
moment, the infrastructure consists tionalities from the mainframe will be platform or MS SQL databases and
of virtual machines that are ordered implemented as new services. This will can implement the services in what-
through a web portal and are set up in the future result in all FX function- ever language it likes. You might ar-
manually by the FX Core team. ality being extracted, totally decou- gue that the team is just becoming
pling the mainframe from the system. dependent on other technologies,
Solving Monolithic For now, the impact of the mainframe such as Docker, but Linux contain-
Problems has been reduced by caching. ers are becoming a standard through
Let us now see how the microservice Since the microservices are in- the Open Container Initiative (www
architecture has improved or solved dependent, loosely coupled, and .opencontainers.org).
some of the problems identified in isolated components, they can be The microservice architecture has
the monolithic architecture. deployed individually, without af- centralized logging in the form of
The large components of the fecting the other components. This LoggingService, ElasticSearch, and
monolithic architecture, which were makes deployment very simple, and Kibana, allowing for the aggregation
highly coupled, had overlapping re- the usage of Docker and Linux con- of logs from all services. The same
sponsibilities, and were integrated tainers ensures that services run in applies to monitoring implemented
in a multitude of ways, have been the same environment during lo- with MonitoringService, Icinga, and
substituted with several independent cal testing, on test servers, and in cAdvisor, allowing for aggregated
microservices. Just the names of the production. monitoring of metrics. Centralizing
services reveal their responsibility, The whole reimplementation al- and aggregating both logs and moni-
and they are generally much smaller lows the team to kill all paths into toring gives the team a complete

M AY/J U N E 2 0 1 8 | I E E E S O F T WA R E 53
FOCUS: MICROSERVICES
ABOUT THE AUTHORS

ANTONIO BUCCHIARONE is a senior STEPHAN T. LARSEN is a software


researcher in the Distributed Adaptive engineer at Danske Bank Copenhagen. He
Systems research unit at the Bruno Kessler has been the key actor in the transition of
Foundation. His main research interests Danske Banks’ FX Core system to a mi-
are self-adaptive (collective) systems, croservice architecture. Larsen received an
applied formal methods, runtime service MSc in computer science and engineering
composition and adaptation, AI planning from the Technical University of Denmark.
techniques, and dynamic software archi- Contact him at stephantl@gmail.com.
tectures. Bucchiarone received a PhD in
computer science and engineering from the
IMT School for Advanced Studies Lucca.
Contact him at bucchiarone@fbk.eu.

NICOLA DRAGONI is an associate MANUEL MAZZARA is a professor of


professor of distributed systems and computer science at Innopolis University.
security at DTU Compute at the Technical His research interests include software
University of Denmark and a professor engineering, service-oriented architecture
of computer engineering at Örebro Uni- and programming, concurrency theory,
versity’s Centre for Applied Autonomous formal methods, and software verifica-
Sensor Systems. His research interests tion. Mazzara received a PhD in computing
primarily include pervasive computing and science from the University of Bologna.
cybersecurity, focusing on the Internet of Contact him at m.mazzara@innopolis.ru.
Things, fog computing, mobile systems,
and microservices. Dragoni received a PhD
in computer science from the University of
Bologna. Contact him at ndra@dtu.dk.

SCHAHRAM DUSTDAR is a full professor


of computer science and heads TU Wien’s
Distributed Systems Group. His research
interests include distributed systems,
the Internet of Things, and complex and
autonomic software systems. He’s the editor
in chief of Computing; a co-editor in chief of
ACM Transactions on the Internet of Things;
and an associate editor of ACM Transactions
on the Web, ACM Transactions on Internet
Technology, IEEE Transactions on Cloud Com-
puting, and IEEE Transactions on Services
Computing. He’s also on the editorial boards
of IEEE Internet Computing and Computer. He
has received the ACM Distinguished Scientist
award and the IBM Faculty Award. He is an
elected member of Academia Europaea,
where he’s the Informatics Section chair-
man, and is an IEEE Fellow. Contact him at
dustdar@dsg.tuwien.ac.at.

54 I E E E S O F T WA R E | W W W. C O M P U T E R . O R G / S O F T W A R E | @ I E E E S O F T WA R E
system status overview, allowing it Microservice composition tech- 8. Z. Yan et al., “Business Process
to act proactively on suspicious and niques are needed; they have to be Modeling: Classifications and Per-
faulty behavior. used when spectives,” Proc. 1st Int’l Working
Conf. Business Process and Services

W
• frequent revision of micro­ Computing (BPSC 07), 2007, pp.
e have all learned services is needed, 222–227.
that introducing this • changes occur in existing offered 9. A. MacEachern, “How Are Interna-
amount of distribution functionalities (i.e., microservice tional Exchange Rates Set?,” Investo-
to a system results in a whole new behavior), and pedia; www.investopedia.com
range of problems to solve. Scal- • adjustment of business policies /ask/answers/forex/how-forex
ability,10 loose coupling, and high and objectives (i.e., composition -exchange-rates-set.asp.
coherence (and other microservice requirements) is required.13 10. N. Dragoni et al., “Microservices:
benefits) were almost given from How to Make Your Application
the get-go, as we can simply repli- This is a typical situation in a dy- Scale,” Perspectives of System Infor-
cate services to scale, and they are namic market such as FX, with con- matics, LNCS 10742, Springer, 2017,
split up nicely according to domain tinuously changing policies. pp. 95–104.
boundaries. Now, aspects like fault- 11. C. Guidi et al., “Microservices: A
tolerance mechanisms, concurrency References Language-Based Approach,” Present
handling, and monitoring are of 1. A. Balalaie, A. Heydarnoori, and P. and Ulterior Software Engineer-
increasing importance. This situa- Jamshidi, “Microservices Architecture ing, B. Meyer and M. Mazzara, eds.,
tion has been valuable, as these as- Enables DevOps: Migration to a Cloud- Springer, 2017, pp. 217–225.
pects, when solved, create value in Native Architecture,” IEEE Software, 12. K. Mikhail et al., “Domain Objects
the system. With the monolith, these vol. 33, no. 3, 2016, pp. 42–52. and Microservices for Systems De-
problems never occurred; the prob- 2. N. Dragoni et al., “Microservices: velopment: A Roadmap,” Proc. 5th
lems there were mostly about solv- Yesterday, Today, and Tomorrow,” Int’l Conf. Software Eng. for Defence
ing object-oriented complexity and Present and Ulterior Software Engi- Applications, Springer, 2016, pp.
deploying such a monster. We have neering, B. Meyer and M. Mazzara, 97–107.
also experienced how important in- eds., Springer, 2017, pp. 195–216. 13. A. Bucchiarone et al., “A Context-
frastructure and automation is, since 3. C. Pahl and P. Jamshidi, “Micro­ Aware Framework for Dynamic
there are so many moving parts we services: A Systematic Mapping Study,” Composition of Process Fragments in
need to both manage and connect. Proc. 6th Int’l Conf. Cloud Comput- the Internet of Services,” J. Internet
The future will see growing atten- ing and Services Science (CLOSER 16), Services and Applications, vol. 8,
tion regarding the matters discussed vol. 1, 2016, pp. 137–146. no. 1, 2017, pp. 6:1–6:23.
here and the development of new 4. M.C. MacKenzie et al., Reference
programming languages intended Model for Service Oriented Architec-
to address the microservice para- ture 1.0, OASIS, 12 Oct. 2006.
digm.11 Languages for microservices 5. N. Kratzke and P.-C. Quint, “Under-
should be able to model micro­ standing Cloud-Native Applications
services in a uniform way and at a after 10 Years of Cloud Computing—
level of abstraction that also allows a Systematic Mapping Study,” J.
for their easy interconnection.12 In a Systems and Software, Apr. 2017,
system like the one described in this pp. 1–16.
article, the remodeling of part of the 6. D.L. Parnas, “On the Criteria to Be
system would be significantly sim- Used in Decomposing Systems into
pler if the programming language Modules,” Comm. ACM, vol. 15,
used natively offers microservice as no. 12, 1972, pp. 1053–1058. Read your subscriptions
a first-class entity (just think about 7. M.E. Conway, “How Do Committees through the myCS
publications portal at
the existence of large, highly coupled Invent?,” Datamation, vol. 14, no. 4,
components). 1968, pp. 28–31.
http://mycs.computer.org

M AY/J U N E 2 0 1 8 | I E E E S O F T WA R E 55

View publication stats

You might also like