The document discusses agile microservices and their advantages over monolithic architectures. It describes how to decompose a monolithic real estate management application into independent microservices for properties, facilities, and engineering. Microservices allow for improved independence, speed of development, automation, and use of different technologies. Inter-service communication can occur over REST, HTTP, or AMQP, while an API gateway pattern hides service complexity from clients. Cloud computing platforms like Docker and Convox can deploy and manage containerized microservices. The Internet of Things connects physical devices to these services over protocols like MQTT and WebSocket.
2. about me
CIRO DONATO CAIAZZO
CTO & Software Architect @SCAIBO
SCAI Consulting s.r.l.
ciro.caiazzo@scai-consulting.grupposcai.it
cd.caiazzo@gmail.com
@CyrusD87
https://www.linkedin.com/in/ciro-donato-caiazzo-35a38a32
3. in the next 40 minutes I will talk about...
microservices @scaibo
the sometimes (evil) monolith
building microservices
cloud computing solutions
internet of things
6. the sometimes (evil) monolith
browser
load
balancer
User interface
Business logic
Persistence database
7. the sometimes (evil) monolith : Features
Simple to develop, test, deploy, scale… for small applications
Application puts all its functionality into a single process
Application scales by replicating the monolith on multiple servers
if an application becomes large and complex?
8. the sometimes (evil) monolith
browser
load
balancer
User interface
Business logic
Persistence
database
User interface
Business logic
Persistence
…
9. a real case:
Real estate management platform (I)
browser
load
balancer
User interface
property
module
Persistence database
10. a real case:
Real estate management platform (II)
browser
load
balancer
User interface
property
module
Persistence database
facility
module
11. a real case:
Real estate management platform (III)
browser
load
balancer
User interface
property
module
Persistence database
facility
module
engineering
module
12. a real case:
Real estate management platform (then?)
browser
load
balancer
User interface
property
module
Persistence database
facility
module
engineering
module
13. then? Problem!
possible constraints on technology stack
one change can affect the entire system
one change in one component requires the deploy of the entire system
difficult integration between cross-functional teams
few release (more UI tests & QA work)
15. decomposing applications into services
Divide an application in components
Each component is built as a service
Each service is a unit of software that is indipendently upgradable and deployable
16. a real case:
Real estate management in microservices
User interface
property
service
facility
service
engineering
service
database
database
database
17. a real case:
Real estate management in microservices
property UI
property
service
facility
service
engineering
service
database
database
database
facility UI
engineering UI
18. microservices: Rules
a service should have a small set of responsibility
SINGLE RESPONSIBILITY PRINCIPLE
a service should be developed in small time (max 2 weeks)
a service should be isolated from others (isolation for storage and deploy environment)
19. microservices: Rules
a service should model a single and well defined part of the business domain
DOMAIN DRIVEN DESIGN
20. microservices: Benefits
Simplicity
each service is relative small
it is simple for a developer to understand the business logic
a service can eventually be redesigned very quickly.
21. microservices: Benefits
Independence
each service can be released without affect the others
problem on a service (like memory leak) does not affect the others
Independent deploy
22. microservices: Benefits
Speed
release early & release often
less coordination between developers
cross-functional teams can work in parallel reducing the integration problems
23. microservices: Benefits
o a service can be built with different technologies, in terms of
platform & programming languages (.NET, Java, NodeJS, …)
Database (Oracle, Sql Server, MongoDb, Cassandra, …)
…but it is not true for the communication protocol : HTTP, AMQP, MQTT
24. microservices: Benefits
Automation
each service has a build on the Continuous integration server
it is more simple to automate the continuous delivery & deploy
blue green deploy for each service
25. a real case:
Real estate management in microservices
User interface
property
service
facility
service
engineering
service
database
database
database
26. a real case:
Real estate management in microservices
User interface
property
service
facility
service
engineering
service
database
database
databaseHow to manage
interactions?
27. a real case:
Real estate management in microservices
User interface
property
service
facility
service
engineering
service
database
database
database
Between clients & services
REST
(HTTP)
REST
(HTTP)
REST
(HTTP)
28. a real case:
Real estate management in microservices
property
service
facility
service
engineering
serviceBetween services
REST
(HTTP)
REST
(HTTP)
REST
(HTTP)
29. a real case:
Real estate management in microservices
property
service
facility
service
engineering
serviceBetween services
AMQP
30. microservices: a more complex scenario
User interface
facility
service
property
service
engineering
service
REST
(HTTP)
REST
(HTTP)
REST
(HTTP)
AMQP
AMQP
31. microservices: a more complex scenario
Granularity
each client should know each service in details
Localization
each client should know the location of each service
Complexity
business logic to build and manage more complex objects at the client level
32. API Gateway pattern
User interface
facility
service
property
service
engineering
service
REST
(HTTP)
REST
(HTTP)
AMPQ
AMQP
AMQP
API
Gateway
REST
(HTTP)
mobile interface MQTT
AMQP
33. API Gateway
Benefits
hide to the clients how services are structured
encapsulation of multiple requests for multiple services
API optimization for each client
Drawbacks
increase in complexity
require an additional network hop
35. cloud computing solutions
Software as a Service (SAAS)
Platform as a Service (PAAS)
Infrastructure as a Service (IAAS)
Container as a Service (CAAS)
36. cloud computing solutions
Software as a Service (SAAS)
Platform as a Service (PAAS)
Infrastructure as a Service (IAAS)
Container as a Service (CAAS)
37. cloud computing solutions
Software as a Service (SAAS)
Platform as a Service (PAAS)
Infrastructure as a Service (IAAS)
Container as a Service (CAAS)
38. cloud computing solutions
Software as a Service (SAAS)
Platform as a Service (PAAS)
Infrastructure as a Service (IAAS)
Container as a Service (CAAS)
39. cloud computing solutions
Software as a Service (SAAS)
Platform as a Service (PAAS)
Infrastructure as a Service (IAAS)
Container as a Service (CAAS)
41. how does Docker work?
Server
Host OS
Hypervisor
Guest OS Guest OS
Middleware Middleware
AppApp
Server
Host OS
Docker engine
Docker image Docker image
Virtualization Container
42. how does Docker work?
Build a container reading the instructions in Dockerfile
Configure and orchestrate one or more containers in docker-compose
43. convox
An open source tool to deploying, managing and monitoring applications in cloud infrastructure
https://convox.com
https://github.com/convox/rack
https://convox-public.slack.com/
44. convox: Rack
A rack is a structure to create and manage all the infrastructure needed to run and monitor your
applications
In a rack you can create and define each service to build your microservices using docker