Distributed Adaptive Systems (DAS) Unit
A Model-Driven Approach Towards
Automatic Migration to Microservices
Antonio Bucchiarone, Kemal Soysal, Claudio Guidi
bucchiarone@fbk.eu, kemal.Soysal@ls-it-solutions.de, cguidi@italianasoftware.com
LS IT-Solutions GmbH
Microservices 2020 Towards Automatic Migration to Microservices 2
Introduction
 Scalability and Availability of modern software systems.
 Microservices is an architectural style originating from SOA.
 Microservices to realize complex systems.
 A set of small services that operate independently.
 Services that are easy to maintain and evolve.
 Each service represents a single business capability.
 Each service can be developed and managed by a single team.
 Migration from monolithic applications to microservices-based
applications.
 Is a challenging task that very often is done manually and without a
supporting tool.
Microservices 2020 Towards Automatic Migration to Microservices 3
The microservice paradigm still misses a conceptual
model able to support engineers starting from early
phases of development.
Research Challenge
conceptual model
A Model-Driven approach for
the automatic migration to microservices.
Microservices 2020 Towards Automatic Migration to Microservices 4
Model-Driven Engineering
 Software Engineering Methodology that proposes to shift the
focus of the development from coding to modelling.
 The goal is to reduce the complexity of software development by
raising the level of abstraction:
 Analyzing application properties earlier.
 Introducing automation in the development process.
 Models are expected to allow domain experts to reason about a
certain solution by means of concerns closer to their area of
expertise than to implementation details.
 Model transformation techniques manipulate models to evaluate
the attributes of the application and generate implementation code.
Microservices 2020 Towards Automatic Migration to Microservices 5
Domain Specific Languages (DSLs)
 Languages introduced for expressing problems by using terms
closer to a particular domain of application.
 The definition of DSLs can be challenging due:
 The nature of the specific domain.
 How the concepts should be interconnected to ease the modelling
activity.
 What kind of concrete syntaxes the users desire to exploits.
 Etc…
 To support the development of DSLs, it is common practice to use a
language workbench.
 A toolkit supporting the definition of various aspects of the DSL under
development
 Syntax, semantics, validation constraints, generators
 Code competition, syntax coloring, find usages, refactoring, etc..
Microservices 2020 Towards Automatic Migration to Microservices 6
JetBrains MPS - I
 Text-based meta-programming system that enables language-
oriented programming.
 Open Source and used to implement languages with different
notations.
 Based on MPS BaseLanguage is possible to define new custom
languages through extension and composition of concepts.
 A new language is composed by different aspects making its
specification modular and therefore easy to maintain.
 Structure Definition: Abstract Syntax Tree (AST) of a language as a
collection of concepts.
https://www.jetbrains.com/mps/
Microservices 2020 Towards Automatic Migration to Microservices 7
JetBrains MPS - II
 Structure Definition aspect: Abstract Syntax Tree (AST) of a language as
a collection of concepts.
 Editor Definition aspect deals with the definition of the concrete
syntax for a DSL:
 It specifies the notation (i.e., tabular, diagram, tree, etc..) and the
interaction behavior of the editor.
 Generators Definition aspect is used to define the denotational
semantics for the language concepts.
 AST to text (model-to-text)
 AST to AST (model-to-model)
 Type System Definition and Constraints Definition aspects.
https://www.jetbrains.com/mps/
Microservices 2020 Towards Automatic Migration to Microservices 8
Jolie Language for Microservices
 A programming language which offers a native linguistic tool for
defining microservices following a structured service-oriented
paradigm.
 It provides an integrated syntax for defining API interfaces and types;
 It provides specific communication primitives for dealing with
communication (synch, asynch).
 It allows for defining the service behaviour in a workflow manner:
easy definition of orchestrators and coordinators of services.
https://www.jolie-lang.org/
Microservices 2020 Towards Automatic Migration to Microservices 9
Jolie Language for Microservices
 Each operation comes with a request message and a response
message (synchronous operations).
https://www.jolie-lang.org/
Microservices 2020 Towards Automatic Migration to Microservices 10
Jolie Language for Microservices
 Declarative Part where all the
interfaces and ports are
defined.
 Behavioral Part where the
implementation of the
operations is provided.
 The primitive execution defines
the execution modality of the
service (concurrent, sequential,
single).
https://www.jolie-lang.org/
Microservices 2020 Towards Automatic Migration to Microservices 11
Deploying a Jolie Service
 The available image jolielang/jolie provides a core layer where both
Java and Jolie are installed.
 Docker file allows for the creation of a docker image of the service
“calculator”.
https://www.jolie-lang.org/
Microservices 2020 Towards Automatic Migration to Microservices 12
Our Vision towards an Automatic Migration
 There is an extreme and increasingly emerging need to migrate applications
from monolithic to microservices.
 Rare are the approaches that try to make this process automatic and tool
supported.
 Most of the migration approaches proposed are guided by the developers
experience and are not supported by a specific tool or language.
Towards the realization of a
general framework
for automatic migration to microservices.
Microservices 2020 Towards Automatic Migration to Microservices 13
Model-Driven Migration Approach
 Two components, Two DSLs, and a set of Generators
Microservices 2020 Towards Automatic Migration to Microservices 14
The Microservice Language - I
Microservices 2020 Towards Automatic Migration to Microservices 15
Calculator Microservice Model
Microservices 2020 Towards Automatic Migration to Microservices 16
The Deployment Language
Concepts of the
Deployment
Language
Dockerfile Editor
and Model
Microservices 2020 Towards Automatic Migration to Microservices 17
Microservices Miner
 To analyze the monolithic application written in Java and to retrieve the set of
needed microservices.
 To search in the Abstract Syntax Tree (AST) of the imported Java code for patterns of
interest and suggest to the developer the set of microservices for the migration.
Microservices 2020 Towards Automatic Migration to Microservices 18
Microservices “Searcher”
 Each searcher is realized by implementing the interface or the abstract
implementation and finds nodes in the AST that comply to the semantic
understanding of the searcher.
Microservices 2020 Towards Automatic Migration to Microservices 19
Microservices Generator
 AST to Text (model-to-text) transformation.
 To run a microservice we provide one file for the service specification (.ol)
and one file for each interface the microservices uses (.iol)
Microservices 2020 Towards Automatic Migration to Microservices 20
Dockerfile Generator
We generate the Dockerfile used to deploy the microservice in a Docker
container.
 This generator is used to generate the corresponding Dockerfile document
needed to deploy the microservice in a Docker container.
Microservices 2020 Towards Automatic Migration to Microservices 21
Prototype Implementation
https://github.com/antbucc/Migration
Microservices 2020 Towards Automatic Migration to Microservices 22
Open Research Challenges
• Microservices Modeling
• Define a more abstract DSL that can be used to model more general
microservices.
• Microservices Mining
• AI-based approach to extract automatically microservices from
monolithic application
• Microservices Composition
• Introduce the way to realize not only microservices but a complete
Microservice-based Application (MSA)
• Abstraction / Generalization
• To target multiple microservices technologies from the same abstraction
Distributed Adaptive Systems (DAS) Unit
A Model-Driven Approach Towards
Automatic Migration to Microservices
Antonio Bucchiarone
bucchiarone@fbk.eu
Thank you!
Any questions?

Towards Automatic Migration to Microservices

  • 1.
    Distributed Adaptive Systems(DAS) Unit A Model-Driven Approach Towards Automatic Migration to Microservices Antonio Bucchiarone, Kemal Soysal, Claudio Guidi bucchiarone@fbk.eu, kemal.Soysal@ls-it-solutions.de, cguidi@italianasoftware.com LS IT-Solutions GmbH
  • 2.
    Microservices 2020 TowardsAutomatic Migration to Microservices 2 Introduction  Scalability and Availability of modern software systems.  Microservices is an architectural style originating from SOA.  Microservices to realize complex systems.  A set of small services that operate independently.  Services that are easy to maintain and evolve.  Each service represents a single business capability.  Each service can be developed and managed by a single team.  Migration from monolithic applications to microservices-based applications.  Is a challenging task that very often is done manually and without a supporting tool.
  • 3.
    Microservices 2020 TowardsAutomatic Migration to Microservices 3 The microservice paradigm still misses a conceptual model able to support engineers starting from early phases of development. Research Challenge conceptual model A Model-Driven approach for the automatic migration to microservices.
  • 4.
    Microservices 2020 TowardsAutomatic Migration to Microservices 4 Model-Driven Engineering  Software Engineering Methodology that proposes to shift the focus of the development from coding to modelling.  The goal is to reduce the complexity of software development by raising the level of abstraction:  Analyzing application properties earlier.  Introducing automation in the development process.  Models are expected to allow domain experts to reason about a certain solution by means of concerns closer to their area of expertise than to implementation details.  Model transformation techniques manipulate models to evaluate the attributes of the application and generate implementation code.
  • 5.
    Microservices 2020 TowardsAutomatic Migration to Microservices 5 Domain Specific Languages (DSLs)  Languages introduced for expressing problems by using terms closer to a particular domain of application.  The definition of DSLs can be challenging due:  The nature of the specific domain.  How the concepts should be interconnected to ease the modelling activity.  What kind of concrete syntaxes the users desire to exploits.  Etc…  To support the development of DSLs, it is common practice to use a language workbench.  A toolkit supporting the definition of various aspects of the DSL under development  Syntax, semantics, validation constraints, generators  Code competition, syntax coloring, find usages, refactoring, etc..
  • 6.
    Microservices 2020 TowardsAutomatic Migration to Microservices 6 JetBrains MPS - I  Text-based meta-programming system that enables language- oriented programming.  Open Source and used to implement languages with different notations.  Based on MPS BaseLanguage is possible to define new custom languages through extension and composition of concepts.  A new language is composed by different aspects making its specification modular and therefore easy to maintain.  Structure Definition: Abstract Syntax Tree (AST) of a language as a collection of concepts. https://www.jetbrains.com/mps/
  • 7.
    Microservices 2020 TowardsAutomatic Migration to Microservices 7 JetBrains MPS - II  Structure Definition aspect: Abstract Syntax Tree (AST) of a language as a collection of concepts.  Editor Definition aspect deals with the definition of the concrete syntax for a DSL:  It specifies the notation (i.e., tabular, diagram, tree, etc..) and the interaction behavior of the editor.  Generators Definition aspect is used to define the denotational semantics for the language concepts.  AST to text (model-to-text)  AST to AST (model-to-model)  Type System Definition and Constraints Definition aspects. https://www.jetbrains.com/mps/
  • 8.
    Microservices 2020 TowardsAutomatic Migration to Microservices 8 Jolie Language for Microservices  A programming language which offers a native linguistic tool for defining microservices following a structured service-oriented paradigm.  It provides an integrated syntax for defining API interfaces and types;  It provides specific communication primitives for dealing with communication (synch, asynch).  It allows for defining the service behaviour in a workflow manner: easy definition of orchestrators and coordinators of services. https://www.jolie-lang.org/
  • 9.
    Microservices 2020 TowardsAutomatic Migration to Microservices 9 Jolie Language for Microservices  Each operation comes with a request message and a response message (synchronous operations). https://www.jolie-lang.org/
  • 10.
    Microservices 2020 TowardsAutomatic Migration to Microservices 10 Jolie Language for Microservices  Declarative Part where all the interfaces and ports are defined.  Behavioral Part where the implementation of the operations is provided.  The primitive execution defines the execution modality of the service (concurrent, sequential, single). https://www.jolie-lang.org/
  • 11.
    Microservices 2020 TowardsAutomatic Migration to Microservices 11 Deploying a Jolie Service  The available image jolielang/jolie provides a core layer where both Java and Jolie are installed.  Docker file allows for the creation of a docker image of the service “calculator”. https://www.jolie-lang.org/
  • 12.
    Microservices 2020 TowardsAutomatic Migration to Microservices 12 Our Vision towards an Automatic Migration  There is an extreme and increasingly emerging need to migrate applications from monolithic to microservices.  Rare are the approaches that try to make this process automatic and tool supported.  Most of the migration approaches proposed are guided by the developers experience and are not supported by a specific tool or language. Towards the realization of a general framework for automatic migration to microservices.
  • 13.
    Microservices 2020 TowardsAutomatic Migration to Microservices 13 Model-Driven Migration Approach  Two components, Two DSLs, and a set of Generators
  • 14.
    Microservices 2020 TowardsAutomatic Migration to Microservices 14 The Microservice Language - I
  • 15.
    Microservices 2020 TowardsAutomatic Migration to Microservices 15 Calculator Microservice Model
  • 16.
    Microservices 2020 TowardsAutomatic Migration to Microservices 16 The Deployment Language Concepts of the Deployment Language Dockerfile Editor and Model
  • 17.
    Microservices 2020 TowardsAutomatic Migration to Microservices 17 Microservices Miner  To analyze the monolithic application written in Java and to retrieve the set of needed microservices.  To search in the Abstract Syntax Tree (AST) of the imported Java code for patterns of interest and suggest to the developer the set of microservices for the migration.
  • 18.
    Microservices 2020 TowardsAutomatic Migration to Microservices 18 Microservices “Searcher”  Each searcher is realized by implementing the interface or the abstract implementation and finds nodes in the AST that comply to the semantic understanding of the searcher.
  • 19.
    Microservices 2020 TowardsAutomatic Migration to Microservices 19 Microservices Generator  AST to Text (model-to-text) transformation.  To run a microservice we provide one file for the service specification (.ol) and one file for each interface the microservices uses (.iol)
  • 20.
    Microservices 2020 TowardsAutomatic Migration to Microservices 20 Dockerfile Generator We generate the Dockerfile used to deploy the microservice in a Docker container.  This generator is used to generate the corresponding Dockerfile document needed to deploy the microservice in a Docker container.
  • 21.
    Microservices 2020 TowardsAutomatic Migration to Microservices 21 Prototype Implementation https://github.com/antbucc/Migration
  • 22.
    Microservices 2020 TowardsAutomatic Migration to Microservices 22 Open Research Challenges • Microservices Modeling • Define a more abstract DSL that can be used to model more general microservices. • Microservices Mining • AI-based approach to extract automatically microservices from monolithic application • Microservices Composition • Introduce the way to realize not only microservices but a complete Microservice-based Application (MSA) • Abstraction / Generalization • To target multiple microservices technologies from the same abstraction
  • 23.
    Distributed Adaptive Systems(DAS) Unit A Model-Driven Approach Towards Automatic Migration to Microservices Antonio Bucchiarone bucchiarone@fbk.eu Thank you! Any questions?