![Page 1: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/1.jpg)
A linguistic approach to microservicesClaudio Guidi, italianaSoftware
Trento, 04/09/2017
Distilling the core concepts of microservices into a programming language
![Page 2: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/2.jpg)
Interesting …but why?
![Page 3: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/3.jpg)
The nature of computational resources isgoing to change
The computational resource so
far
A machine
The reference computational
resource in the next years
A cloud of machines
Processes focused on computation. Processes focused on communication.
Naturally not distributed. Naturally distributed.
Functions, procedures and objects. Services, microservices, nanoservices,
…
![Page 4: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/4.jpg)
Containers are going to replace the idea of machine we know so far
Virtualization
(hardware independence)
Containerization
(cloud independence)
Real Computational
Resource
![Page 5: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/5.jpg)
The cloud is here
Layers of abstraction
![Page 6: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/6.jpg)
We can’t access the real computational level yet
Today
How long are we seeing behind the surface?
Today/Tomorrow?
![Page 7: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/7.jpg)
The new machine
The cloud is here
This is the new machine we are going to use
![Page 8: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/8.jpg)
What does it imply?Which are the short terms and the long terms consequences of such a scenario?
New computational
resource
Producers
Consumers
![Page 9: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/9.jpg)
The applications
Developers
Consumers
Shared components
The applications will be obtained as a composition of existing components
![Page 10: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/10.jpg)
Computational resource ~
Software functionalityIdeally, the concept of computational resource will be more and more
interchangeable with the concept of software component.
~
In the new machine the metrics
of the system will be managed
by the cloud platform provider as
a all which will optimize the
loads, by relocating resources or
replicating them. The software
functionlities will be actually
decoupled from the available
technical resources.
In the classical idea where a
computational resource is a
computer machine, the software
is concretely installed into the
machine and it is strongly tight
to the technical features of the
machine
≠
![Page 11: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/11.jpg)
Communication is more important than computation
The management of the
connections and the
dependencies among the
components is the key point!
Communication and coordination will be more
important than computation
![Page 12: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/12.jpg)
Containers today
![Page 13: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/13.jpg)
System Level
• Lighter than Virtual Machines
• Requires a software layer installed in the hosting machine, ex: Docker
Application Level
• Instantiated starting from an image
• Usually requires connections with other containers
• Remotely controlled status: start/stop/pause/destroy/…
Core concepts of a container
![Page 14: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/14.jpg)
• Internally coded as a set of script
to be executed
• A container is an instance of an image.
Multiple copies of the same container
can be generated from the same image.
• Technology agnosticism: different
applications made with different
technologies can be used within a container
• Images can depend on other images
Images
Image
Deploy
Program
Container
![Page 15: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/15.jpg)
Every application can be installed within a container.
Web application, database servers, load balancers, etc.
It is sufficient to properly prepare the
correspondant image.
Inside a container
Image
Deploy
Program
Container
Application
Installation script
![Page 16: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/16.jpg)
Deploying
Image
Deploy
Program
Container
Application
Installation script
The main impact engineers are facing
so far is about application deployment.
• Easy to create
• Easy to start/stop
• Easy to move
• Easy to replicate
PROGRAMMING
Programming still continue to exploit traditional
paradigms.
NEW!
![Page 17: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/17.jpg)
What’s programming?
Two aspects:
1. Single component programming
1. Communication endpoints
2. Communication protocols
3. Communication primitives
4. Activity flow
5. Fault handling
2. Architecture programming.
1. Component composition
2. Message routing
3. Protocol transformation
4. Asynchronous vs synchronous
communication
+ =
Depending on the technologies
there are different languages,
different tools, different
methods
Remember: communication
and coordination are the main
features to deal with
![Page 18: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/18.jpg)
Single component programming
Access endpoints for providing functionalities
• Communication protocols
• Interfaces of the functionalities
Other components dependencies
• Communication protocols
• Interfaces of the functionalities
Business logics
• Actual coding of the provided functionalities
+ =
+
Libraries and Frameworks Programming Languages
![Page 19: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/19.jpg)
Frameworks and languages
+
Libraries and Frameworks Programming Languages
• Several tools and
frameworks
• They change very often.
• They require upgrades
which could have impacts
on the code.
• Specific skills required
by the developers
• No actual standards for
defining interfaces
• Usually structurally
designed for specific
protocols (ex: http)
• The syntax is quite stable
• Once trained, a developer
has all the important
knowledge to be productive
• Unfortunately, the code
related to the
communication activities is
strictly bound to the
chosen framework and
libraries.
Communication and
coordinationfeatures
are usually demanded to the usage of
frameworks and libraries
![Page 20: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/20.jpg)
Programming languages are irrelevantThe knowledge required to manage frameworks and libraries eats up the knowledge required to
manage the programming language which become quite irrelevant
![Page 21: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/21.jpg)
Knowledge is money
• More than one• They change often• High dinamicity
• Syntax usually stablein the long terms. Backwardcompatibility usually guaranteed
![Page 22: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/22.jpg)
How to reduce the knowledge?
Reducing the required knowleldge by moving the
programming concepts hidden in the frameworks into a
stable syntax of a programming language
![Page 23: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/23.jpg)
A new programming language
Our choice is to introduce a new programming language.
Jolie represents our solution.
Our aim is to move the
knowlegde trapped
within the frameworks
into the programming
language
![Page 24: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/24.jpg)
Joliehttp://www.jolie-lang.org
![Page 25: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/25.jpg)
Once upon a time…SOA standard specifications analysis (WSDL, SOAP, WS-BPEL,…)
Development of a Milner’s CCS based process calculus (SOCK).
Definition of operational semantics
Development of a language based (Jolie) and of its interpreter engine
Exploitation in industry and real life
![Page 26: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/26.jpg)
Action model
Industryand
Practice
Theoretical model
![Page 27: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/27.jpg)
Jolie is interpretedA jolie service is described by a script
which is interpreted at runtime by the jolie engine.
No compilation required.
The engine is developed in Java
We call microservice the running instance of a service
jolie myservice.ol
![Page 28: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/28.jpg)
Services
The main idea behind Jolie is that
A service is a single unit of programmable software.
It is not obtained as a customization or a specialization of an existing
server, but it is the only possible programmable entity.
We usually exploit a trapezoid for representing a service.
![Page 29: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/29.jpg)
The linguistic constructs for
communication
Listener endpoints and sender endpoints are a specific construct in the
language. They are called ports: inputPorts and outputPorts.
inputPort IPName {Location: ‘’socket://230.230.230.230:8000’’Protocol: sodepInterfaces: MyInterface}
outputPort OPName {Location: ‘’socket://230.230.230.230:8000’’Protocol: sodepInterfaces: MyInterface}
![Page 30: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/30.jpg)
Where
The location represents the place, in the space of the Internet, where the
service can be reached.
inputPort IPName {Location: ‘’socket://230.230.230.230:8000’’Protocol: sodepInterfaces: MyInterface}
outputPort OPName {Location: ‘’socket://230.230.230.230:8000’’Protocol: sodepInterfaces: MyInterface}
![Page 31: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/31.jpg)
How
The protocol specifies the application protocol to be used. Sodep is a
protocol released with Jolie but also http, http/json, http/soap and https.
inputPort IPName {Location: ‘’socket://230.230.230.230:8000’’Protocol: sodepInterfaces: MyInterface}
outputPort OPName {Location: ‘’socket://230.230.230.230:8000’’Protocol: sodepInterfaces: MyInterface}
![Page 32: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/32.jpg)
What
The interface expresses all the available operations provided by a
service.
inputPort IPName {Location: ‘’socket://230.230.230.230:8000’’Protocol: sodepInterfaces: MyInterface}
outputPort OPName {Location: ‘’socket://230.230.230.230:8000’’Protocol: sodepInterfaces: MyInterface}
![Page 33: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/33.jpg)
More than one port are possible
A service can
invoke different
services on
different ports.
A service can provide its
functionalities on more than
one port. Different protocols
and locations are possible for
a service.
![Page 34: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/34.jpg)
The interface definition is part of the
language
type TestRRequest: void {.field: string
}
Interface MyInterface {RequestResponse:
testRR( TestRequest )( string )OneWay:
testOW( TestRequest )}
inputPort IPName {Location: ‘’socket://230.230.230.230:8000’’Protocol: sodepInterfaces: MyInterface}
outputPort OPName {Location: ‘’socket://230.230.230.230:8000’’Protocol: sodepInterfaces: MyInterface}
![Page 35: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/35.jpg)
Communication primitives
OneWay: asynchronous
inputPort IPName {Location: ‘’socket://230.230.230.230:8000’’Protocol: sodepInterfaces: MyInterface}
main {testOW( request );…other activities…
}
outputPort OPName {Location: ‘’socket://230.230.230.230:8000’’Protocol: sodepInterfaces: MyInterface}
main {request.field = ‘’hello world!’’testOW@OPName( request );…other activities…
}
![Page 36: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/36.jpg)
Communication primitives
RequestResponse: synchronous
outputPort OPName {Location: ‘’socket://230.230.230.230:8000’’Protocol: sodepInterfaces: MyInterface}
main {request.field = ‘’hello world!’’testRR@OPName( request )( response );…other activities…
}
inputPort IPName {Location: ‘’socket://230.230.230.230:8000’’Protocol: sodepInterfaces: MyInterface}
main {testRR( request )( response ) {…other activities…}
}
![Page 37: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/37.jpg)
The behaviour
The behaviour of a service is represented by a workflow.
Potentially, every service is an orchestrator.
main {testRR( request )( response ) {
….test2RR@OpName2( … )( … )|test3RR@OpName3( … )( … )
}}
inputPort OPName2 {Location: ‘’socket://230.230.230.230:8001’’Protocol: sodepInterfaces: MyInterface2}
inputPort OPName3 {Location: ‘’socket://230.230.230.230:8002’’Protocol: sodepInterfaces: MyInterface3}
Parallel,
sequence,
external choice
A behaviour
structured as a
workflow permits to
focus on the message
flows instead of
computation
![Page 38: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/38.jpg)
Other
• Tree format for data and messages
• Standard computation constructs
• if then
• for
• while
• Other constructs
• spawn
• foreach
• provide until
• linkIn and linkOut
• Fault handling
• Termination handlers
• Compensation handlers
• Dynamic installation handlers
• Sessions
• Session correlation
(correlation sets)
• Global data and session data
• Critical sections programming
(synchronize)
• Execution modalities
• Single
• Sequential
• Concurrent
![Page 39: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/39.jpg)
Important distilled single component
programming concepts
Programming Constructs Benefits
Ports They permit to define in a standard way endpoints: protocols and availableoperations are just parameters.
Interface It permits to formally define the interface of the service without exploiting external tools.
Communication primitives They permit to define messagecommunication actions (send and receive) independently from protocols and formats.
Workflow behaviour It permits to define the activities of a service by focusing on the message flow instead of computation.
Sessions are instantiated automatically.
…
![Page 40: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/40.jpg)
If you remember…
Image
Deploy
Program
Container
Jolie service
script
Installation script
PROGRAMMING WITH JOLIE
No specific packaging is required or libraries.
Just prepare the container with the Jolie Engine.
The code is readable.
The syntax is stable.
Less knowledge required.
Common concepts and constructs immediately
shared by all the team members.
Everybody can read and understand what a service
is doing wothout any additional knowledge.
![Page 41: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/41.jpg)
Programming architectures
![Page 42: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/42.jpg)
Where is the architecture?
Containers
Creating connections
(they must still available at the level
of service)
Scaling
Services
Moving
?
![Page 43: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/43.jpg)
Programming services means
programming architecturesSince the single programmable unit is a service, it does not matter the conceptual
designing model you choose for designing your system or your application because
the result will always be an architecture of services!
Each modelled service has an
immediate and direct
representation into code
![Page 44: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/44.jpg)
Prommaning services means
programming architecturesThe relation among entities are dorectly modelled as service dependencies
![Page 45: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/45.jpg)
Service size is not a problem
You can easily fragment your entities in sub-entities
by keeping the mapping with services because services can be EMBEDDED
![Page 46: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/46.jpg)
Everything you think is an architecture!
Do you remember? We said we want to reduce the knowledge!
embedded {…}
![Page 47: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/47.jpg)
Programming architectures with Jolie
![Page 48: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/48.jpg)
Redirection
M
/a
/b
/c
![Page 49: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/49.jpg)
Redirection, the code
outputPort SubService {
Location: "socket://localhost:8001/“
Protocol: soap
}
outputPort SumService {
Location: "socket://localhost:8002/"
Protocol: soap
}
inputPort M {
Location: "socket://localhost:8000/"
Protocol: sodep
Redirects: a => A,
b => B
}
![Page 50: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/50.jpg)
Aggregation
op1@M
op1@A
op1op2op3
op1
op2
op3
![Page 51: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/51.jpg)
Aggregation, the code
outputPort A {
Location: "socket://localhost:8001/“
Protocol: soap
}
outputPort B {
Location: "socket://localhost:8002/"
Protocol: soap
}
inputPort M {
Location: "socket://localhost:8000/"
Protocol: sodep
Aggregates: A, B
}
![Page 52: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/52.jpg)
Couriers
Aggregated service
Aggregator
Extended messagewhich carriesadditional contextinfos (ex: security tokens)
Message withoutextension, forwarded to the target service
The extended information can be used for invokingother services (ex: authentication services)
![Page 53: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/53.jpg)
Collection
ms1
ms2
ms3
Aggregator+
Courier
Ms1, ms2 and ms3 they allhave the same interface. Forwarding is decided by using the extendedinformation of the message.
![Page 54: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/54.jpg)
Embedding
More services can be instantiated within the same microservice
![Page 55: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/55.jpg)
Jolie & Docker
![Page 56: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/56.jpg)
Jocker
Docker
http docker API on localsocket
Jolie ordinary operations
docker pull jolielang/jocker
![Page 57: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/57.jpg)
Developing
Docker
Download project
Automatic extractionof dummydependencies
(experimental)
Git repo
1
2
Creation of dummyservices images
3
4 dummy servicescontainers deployment in localmachine
5 binding service under development to the dummy dependencies
6 development
![Page 58: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/58.jpg)
Developing
Docker
commit
Destruction of the dummy environmentand commit
(experimental)
Git repo
9
7 8 destroy images and containers
![Page 59: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/59.jpg)
Testing
Docker
Download project
test
(experimental)
Git repo
2
1
Download test suite
3
4 deploying systemAnd run the test suite
Dockerrepo
Test suite
5 Performing tests
6 Test results
7 Destroy system
![Page 60: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/60.jpg)
Dynamic Architectures(Experimental)
From synchronous…
outputPort OPName {Location: ‘’socket://230.230.230.230:8000’’Protocol: sodepInterfaces: MyInterface}
main {request.field = ‘’hello world!’’testRR@OPName( request )( response );…other activities…
}
inputPort IPName {Location: ‘’socket://230.230.230.230:8000’’Protocol: sodepInterfaces: MyInterface}
main {testRR( request )( response ) {…other activities…}
}
Docker
![Page 61: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/61.jpg)
Dynamic Architectures(Experimental)
…to asynchronous
outputPort OPName {Location: ‘’socket://230.230.230.230:8000’’Protocol: sodepInterfaces: MyInterface}
main {request.field = ‘’hello world!’’testRR@OPName( request )( response );…other activities…
}
inputPort IPName {Location: ‘’socket://230.230.230.230:8000’’Protocol: sodepInterfaces: MyInterface}
main {testRR( request )( response ) {…other activities…}
}
Docker
Rabbit
MQ
Keeping the code
synchronous!!!!
![Page 62: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/62.jpg)
Integration with other technologies
![Page 63: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/63.jpg)
Just a brief list of possibilities• Java
• There is a native possibility to integrate Java
code into a Jolie service (JavaServices)
• It is possible to run a Jolie service within an
hosting application server (Ex: JBoss)
• It is possible to send sodep messages to Jolie
from a third party Java application
• Javascript• As for Java, it is possible to embed javascript
code into a Jolie service
• Text Editors• Plugins for Atom and Sublime Text
• HTTP and HTTPs• HTTP and HTTPs are supported
protocols
• SOAP Web Services• SOAP is a supported protocol
• jolie2wsdl and wsdl2jolie are tools which
permit to convert Jolie interface into
WSDL documents and viceversa
• JSON• JSON format is supported as format
for the http Protocol
• Web• Leonardo is a web server written in
Jolie.
• REST• Thanks to the usage JSON messages
can be exploited just parameterizing a
port
• If necessary, it is possible to
implement a standard REST services
by exploiting Jester, a REST router
for jolie services
• Databases• SQL databases can be easily connected
to a Jolie service using JDBC libraries.
• MongoDB connector (by Balint
Maschio)
![Page 64: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/64.jpg)
Jolie in industry
![Page 65: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/65.jpg)
Jolie Enterprise
• Central control panel
• Deployment
• Start/stop
• Logging and monitor
• All the Jolie service can be
monitored and logged
• Used as a digital platform for system
integration and business process
development
![Page 66: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/66.jpg)
JSAP
SAP
RFC client: it permits to call SAP RFC
IDOC client: it permits to send IDOC to SAP
IDOC server:
It permits to receive IDOC
documents from SAP
RFC server:
It permits to receive RFC calls from
SAP
![Page 67: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/67.jpg)
JSAP
SAP
A Jolie service
receives documents
from SAP
Archive
Link
![Page 68: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/68.jpg)
JSAP
SAP
A Jolie service
receives documents
from SAP
Archive
Link
• Customers usually adopts JSAP for
archiving documents from SAP to a
third party Software
![Page 69: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/69.jpg)
Conclusion
![Page 70: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/70.jpg)
Summarizing…
• A new computational resources paradigm has
been introduced by cloud computing
• Software distribution is the natural paradigm for
approaching such a kind of systems
• The high level of complexity of distributed
systems require to reduce the required knowledge
for managing them
• A new generation of languages which crystalize
the basic microservice programming principles
could help in reducing the required knowledge
• Jolie is a good candidate for representing this new
generation of languages
• Jolie is already used as a technology in the
industry with successfull results
![Page 71: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/71.jpg)
Thank you
![Page 72: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/72.jpg)
Some interesting architectural
programming patterns
![Page 73: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/73.jpg)
Slave Service Mobility
![Page 74: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/74.jpg)
Master Service Mobility
![Page 75: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/75.jpg)
Master Service Mobility
![Page 76: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/76.jpg)
Service of Services
Redirection
![Page 77: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/77.jpg)
Recursion
func( x ) {if ( x == 0 ) {
return 0} else {return x + func( x – 1 )
}}
push
pop
Sessions
![Page 78: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/78.jpg)
Sessions
Sessions are automatically spawned at the
reception of the first message. Such a
mechanism is transparent w.r.t. the developer.
Session 1
Session 2
Session 3
M1
M2
M3M1
M2
M3
![Page 79: A linguistic approach to microservices - FBK · Services, microservices, nanoservices, ... The engine is developed in Java We call microservice the running instance of a service jolie](https://reader030.vdocument.in/reader030/viewer/2022040608/5ec5b79865b2e01d121557ab/html5/thumbnails/79.jpg)
ExampleCreating a REST microservice in Java with Spring Boot
(from a web tutorial)
• Setting up initial Spring Boot structure:
creation of a controller which registers
the method for managing the POST
request and its response
• Writing the application by annotating the
application class. In the main we need to
use method SpringApplication.run(….)
• Documentation generation exploiting
Swagger
• Packaging Spring Boot for Docker
deployment using Gradle Docker
Plugin
Requires to knowSpring Boot
Requires to knowSwagger
Requires to knowGradle
A huge part of the code is tight to the used frameworks.