Java Day Minsk 2016 Keynote about Microservices in real world
-
Upload
- -
Category
Technology
-
view
442 -
download
1
Transcript of Java Day Minsk 2016 Keynote about Microservices in real world
![Page 1: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/1.jpg)
Микросервисы
огонь, вода, медные трубы1
![Page 2: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/2.jpg)
@tolkv
2
@lavcraft
![Page 3: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/3.jpg)
3
@aatarasoff
@aatarasoff
![Page 4: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/4.jpg)
DISCLAIMER
No warranty guarantee
4
![Page 5: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/5.jpg)
5
![Page 6: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/6.jpg)
6
![Page 7: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/7.jpg)
“Microservices” - just a buzzword
7
![Page 8: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/8.jpg)
“Microservices” - just a buzzword
8
![Page 9: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/9.jpg)
Why?
● High abstraction level
9
![Page 10: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/10.jpg)
Why?
● High abstraction level● Popular word
10
![Page 11: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/11.jpg)
Why?
● High abstraction level● Popular word● Sell itself
11
![Page 12: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/12.jpg)
Why?
● High abstraction level● Popular word● Sell itself● More talks
12
![Page 13: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/13.jpg)
13
Not Gartner Curve
![Page 14: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/14.jpg)
14
![Page 15: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/15.jpg)
15
Not Gartner Curve
![Page 16: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/16.jpg)
16
Not Gartner Curve
![Page 17: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/17.jpg)
17
![Page 18: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/18.jpg)
18
![Page 19: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/19.jpg)
What is the architecture?
19
![Page 20: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/20.jpg)
What is the architecture?
20
![Page 21: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/21.jpg)
What is the architecture?
21
https://www.youtube.com/watch?v=_Kex5hwGE-w
![Page 22: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/22.jpg)
22
Classic development
![Page 23: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/23.jpg)
23
![Page 24: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/24.jpg)
Big Ball of Mud
24
![Page 25: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/25.jpg)
SOLID
Counter-Strike Cats
25
![Page 26: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/26.jpg)
GOF
SOLID
GRASP
Counter-Strike Cats
26
![Page 27: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/27.jpg)
12 April 1996SOA is Born
https://www.gartner.com/doc/302868/service-oriented-architectures- 27
![Page 28: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/28.jpg)
12 April 1996SOA is Born
https://www.gartner.com/doc/302868/service-oriented-architectures- 28
![Page 29: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/29.jpg)
SOA Principles1. Standardized service contract
2. Loose coupling
3. Encapsulation
4. Reusability
5. Autonomy
6. Statelessness
7. Discoverability29
![Page 30: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/30.jpg)
Classic SOA
● centralized orchestration
● complicated (hi, SOAP)
● smart pipes (hi, ESB)
30
![Page 31: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/31.jpg)
5 January 2009SOA is Dead
http://apsblog.burtongroup.com/2009/01/soa-is-dead-long-live-services.html 31
![Page 32: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/32.jpg)
What did you say?
32
![Page 33: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/33.jpg)
SOA != SOAP (WS-*)
33
![Page 34: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/34.jpg)
34
![Page 35: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/35.jpg)
35
![Page 36: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/36.jpg)
...and what about people?2004 year
36
![Page 37: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/37.jpg)
SOA was ahead of its time
37
![Page 38: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/38.jpg)
38
SOA
So
![Page 39: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/39.jpg)
A=F(Rq, FRq, NFRq,..........???............)
39
![Page 40: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/40.jpg)
Microservices
40
![Page 41: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/41.jpg)
A=F(Rq, FRq, NFRq,..........???............)
DevOps
OSS Domination
41
![Page 42: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/42.jpg)
What is “microservices”?
42
![Page 43: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/43.jpg)
In short, the microservice architectural style is an approach to developing a single application as a suite of small services, each running in its own process and communicating with lightweight mechanisms, often an HTTP resource API. These services are built around business capabilities and independently deployable by fully automated deployment machinery. There is a bare minimum of centralized management of these services, which may be written in different programming languages and use different data storage technologies. James Lewis and Martin Fowler
43
![Page 44: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/44.jpg)
Does size matter?
● Method/Function = Microservice?
● 10-300 LOC = Microservice?
● 1 week = Microservice?
● 1 developer = Microservice?
44
![Page 45: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/45.jpg)
Size doesn’t matter*
● Single Responsibility
● One capability
● Bounded context
“In your organization, you should be thinking not in terms of data that is shared, but about the capabilities those contexts provide the rest of the domain.”– Sam Newman, Building Microservices
*within reason45
![Page 46: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/46.jpg)
Domain-Driven Design
46
![Page 47: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/47.jpg)
47
DDD
DdSOA
So
![Page 48: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/48.jpg)
Microservices are new classes
48
![Page 49: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/49.jpg)
In short, the microservice architectural style is an approach to developing a single application as a suite of small services, each running in its own process and communicating with lightweight mechanisms, often an HTTP resource API. These services are built around business capabilities and independently deployable by fully automated deployment machinery. There is a bare minimum of centralized management of these services, which may be written in different programming languages and use different data storage technologies. James Lewis and Martin Fowler
49
![Page 50: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/50.jpg)
Problem → So Many Teams
50
![Page 51: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/51.jpg)
LSD Principle
- L programming languages- S average framework count by language- D data source types
complexity = L * S * D
51
![Page 52: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/52.jpg)
Some LSD for you
- three programming languages- two average framework count by language- seven data source types
- legacy WS, mongo db- OLTP, OLAP- elasticsearch, neo4j- Mishka’s database %)
complexity = 3 * 2 * 7 = 42 (!)52
![Page 53: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/53.jpg)
What can’t be sacrificed?
min (L * S * D) → ?
53
![Page 54: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/54.jpg)
min (L * S * D) → max (D)
54
![Page 55: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/55.jpg)
L = Java 18+S = Spring BootD = ∞
55
![Page 56: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/56.jpg)
java
Ja
spring boot
Sb
56
LSD principle
LsDDD
DdSOA
So
![Page 57: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/57.jpg)
Data Isolation Patterns
57
![Page 58: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/58.jpg)
N services → 1 DB
Isolated by Schema/Tables58
![Page 59: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/59.jpg)
N services → N DB
Distributed Transactions are Painfull59
![Page 60: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/60.jpg)
M services → 1 DB L services → L DB
M + L = N, M << L60
![Page 61: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/61.jpg)
Event Sourcing / CQRS / SAGAS
http://gotocon.com/dl/goto-chicago-2015/slides/CaitieMcCaffrey_ApplyingTheSagaPattern.pdf
61
![Page 62: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/62.jpg)
java
Ja
spring boot
Sb
62
Data Isolation
DiLSD principle
LsDDD
DdSAGAS
SaSOA
So
![Page 63: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/63.jpg)
Problem -> Many Services
63
![Page 64: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/64.jpg)
git clone <cool_service_repo>
64
![Page 65: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/65.jpg)
git clone <template_repo>
65
![Page 66: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/66.jpg)
lazybones/start.spring.io/yeoman
66
![Page 67: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/67.jpg)
lazybones create api 1.0.1 service_name
67
![Page 68: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/68.jpg)
~home > lazybones create api 0.0.1 rent-serviceCreating project from template api 0.0.1 in 'rent-service'Define value for 'group' [by.javaday]:Define value for 'version' [0.0.1]:
srv1 ├──srv2 └──srv3
loggingsleuth
Define value for 'dependencies' [logging,sleuth]:
Project created for rent-service!
68
![Page 69: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/69.jpg)
lazybones
Lz
yoman
Yo
start.spring.io
Ssjava
Ja
spring boot
Sbgroovy
Gy
69
Data Isolation
DiLSD principle
LsDDD
DdSAGAS
SaSOA
So
![Page 70: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/70.jpg)
Problem → DRY off
70
![Page 71: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/71.jpg)
TServerTransport serverTransport = new TServerSocket( new InetSocketAddress(InetAddress.getLocalHost(), port));
TProcessor processor = new TInsuranceService.Processor<>(
//business value here);
server = new TSimpleServer(new TServer.Args(serverTransport).processor
(processor));
server.serve();
71
![Page 72: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/72.jpg)
TSocket transport = new TSocket(host, port);transport.open();
TBinaryProtocol tBinaryProtocol = new TBinaryProtocol(transport);TInsuranceService.Client client =
new TInsuranceService.Client(tBinaryProtocol);
perform(client); //business value here
transport.close(); 72
![Page 73: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/73.jpg)
@ThriftControllerpublic class InsuranceController implements TInsuranceService.Iface { @Override public void someMethod(TInsurance insurance){ //business value here }}
73
![Page 74: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/74.jpg)
@ThriftClient(serviceId = "insurance-service")TInsuranceService.Client client;
...perform(client); //business value here...
74
![Page 75: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/75.jpg)
smart libsstarters
launchers
shared libsutils
helpers
75
![Page 76: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/76.jpg)
smart libs/shared libs
76
![Page 77: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/77.jpg)
documentation → smart documentation
77
![Page 78: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/78.jpg)
Not smart= This is main documentation
This document describes how to be the most fundamental and important document in the world of documents
...COPY-PASTE documentation from another document...
78
![Page 79: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/79.jpg)
Not so smart= This is main documentation
This document describes how to be the most fundamental and important document in the world of documents
include::https://raw.github.com/asciidoctor/asciidoctor/master/Gemfile[]
include::../other.adoc[]include::/home/tolkv/git/docs-0/superdoc.adoc[]
79
![Page 80: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/80.jpg)
Really smart= This is main documentation
This document describes how to be the most fundamental and important document in the world of documents
include::https://raw.github.com/asciidoctor/asciidoctor/master/Gemfile[]
include::gradle://gradle-advanced:service-with-deps:1.0/deps.adoc[]include::gradle://:service/doc.adoc[]
80
![Page 81: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/81.jpg)
Payment Service[jar,doc] Insurance Service [jar,doc]
One Point of View [UberDoc.zip]
Rent Service[jar,doc] Other Service [jar,doc]
Information Aggregation
81
![Page 82: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/82.jpg)
Centralization Paradox
To work effectively with distributed applications, you need to have a very good centralized libraries and tools.
For example: logging, health-checking, metrics, exception handling, documentation autogeneration
82
![Page 83: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/83.jpg)
Centralization Paradox
To work effectively with distributed applications, you need to have a very good centralized libraries and tools.
But: don’t do this with you business logic or domain model
83
![Page 84: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/84.jpg)
lazybones
Lz
yoman
Yo
start.spring.io
Ssjava
Ja
thrift
Th
spring boot
Sb
gradle
Grasciidoctor
Ad
groovy
Gy
84
Data Isolation
DiCentralization paradox
CpLSD principle
LsDDD
DdSAGAS
SaSmart Docs
SdSmart Libs
SlSOA
So
![Page 85: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/85.jpg)
Delivery Story
85
![Page 86: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/86.jpg)
war/ear
86
![Page 87: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/87.jpg)
executable fatJar
87
![Page 88: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/88.jpg)
88
Not Gartner Curve
![Page 89: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/89.jpg)
docker/rkt/packer
89
![Page 90: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/90.jpg)
./gradlew deployViaSSH
90
![Page 91: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/91.jpg)
./gradlew deployViaSSH
ConsistencyHigh Availability
91
![Page 92: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/92.jpg)
./gradlew deployToArtifactoryansible -i [stage,dev,test] -t deploy
Predefined Configuration92
![Page 93: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/93.jpg)
Magic
Private PAAS93
![Page 94: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/94.jpg)
mesos/kubernetes/∞
94
![Page 95: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/95.jpg)
How we run cluster
95
![Page 96: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/96.jpg)
More spice!
96
![Page 97: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/97.jpg)
More spice!
97
![Page 98: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/98.jpg)
More spice!
98
![Page 99: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/99.jpg)
Mesos lets us treat a cluster as one big computer
WEB
WASTED
CACHE
WASTED WASTED
HADOOP
99
![Page 100: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/100.jpg)
Mesos lets us treat a cluster as one big computer
WEB
WASTED
CACHE
WASTED WASTED
HADOOP
WASTED
WEBCACHE
HADOOP FREE FREE
100
![Page 101: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/101.jpg)
lazybones
Lz
yoman
Yo
start.spring.io
Ss
python
Py
java
Ja
spring boot
Sb
gradle
Grasciidoctor
Addocker
Dr
mesos
Ms
marathon
Machronos
Chaurora
Au
Kubernetes
Kbgroovy
Gy
101
Data Isolation
DiCentralization paradox
CpLSD principle
LsDDD
DdSAGAS
SaSmart Docs
SdDynamic Sharing
DsSmart Libs
SlSOA
So
ansible
Anthrift
ThArtifactory
Ar
![Page 102: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/102.jpg)
Problem → Find them All
102
![Page 103: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/103.jpg)
insert into settings_table values (key, endpoint)
103
![Page 104: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/104.jpg)
update template → services.locationkill -s HUP nginx
104
![Page 105: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/105.jpg)
eureka/consul/etcd/zookeper
105
![Page 106: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/106.jpg)
106
Service ClientRegistry-aware
HTTP Client
Service Registry
Service Instance 1
Service Instance N
Service Instance ...
Load balance request
Client side discovery
![Page 107: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/107.jpg)
107
Service Client
Service Registry
Service Instance 1
Service Instance N
Service Instance ...
Load balance requestRouter/Proxy
Server side discovery
![Page 108: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/108.jpg)
Problem → Defend yourself
108
![Page 109: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/109.jpg)
109
![Page 110: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/110.jpg)
110
Circuit Breaker
![Page 111: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/111.jpg)
hystrix/apache camel/akka
111
![Page 112: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/112.jpg)
112
Хочу бегемота!
Rent Service
Payment Service
Security Service Blockchain Service
Insurance Service
5мс
![Page 113: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/113.jpg)
113
Хочу бегемота!
Rent Service
Payment Service
Security Service Blockchain Service
Insurance Service
300мс
![Page 114: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/114.jpg)
114
Хочу бегемота!
Rent Service
Payment Service
Security Service Blockchain Service
Insurance Service
300мс
![Page 115: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/115.jpg)
115
Хочу бегемота!
Rent Service
Payment Service
Security Service Blockchain Service
Insurance Service
300мс
![Page 116: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/116.jpg)
116
Хочу бегемота!
Rent Service
Payment Service
Security Service Blockchain Service
Insurance Service
300мс
![Page 117: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/117.jpg)
117
Хочу бегемота!
Rent Service
Payment Service
Security Service Blockchain Service
Insurance Service
300мсOpen
![Page 118: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/118.jpg)
118
Хочу бегемота!
Rent Service
Payment Service
Security Service Blockchain Service
Insurance Service
300мсHalf-Open
![Page 119: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/119.jpg)
119
Хочу бегемота!
Rent Service
Payment Service
Security Service Blockchain Service
Insurance Service
5мсHalf-Open
![Page 120: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/120.jpg)
120
Хочу бегемота!
Rent Service
Payment Service
Security Service Blockchain Service
Insurance Service
5мс
![Page 121: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/121.jpg)
121
![Page 122: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/122.jpg)
Problem → Follow the Trace
122
![Page 123: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/123.jpg)
No Trace
123
![Page 124: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/124.jpg)
X-Request-Id = X-Request-Id ?: new ID
Good Old ServletFilter124
![Page 125: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/125.jpg)
spring-cloud-sleuth/open zipkin
125
![Page 126: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/126.jpg)
126
Rent
Ser
vice
Paym
ent
Serv
ice
Secu
rity
Ser
vice
Bloc
kcha
in S
ervi
ce
TraceId = XSpanId = A
No TraceIdNo SpanId
TraceId = XSpanId = A
TraceId = XSpanId = A
TraceId = XSpanId = B
TraceId = XSpanId = B
TraceId = XSpanId = C
TraceId = XSpanId = C
TraceId = XSpanId = D
TraceId = XSpanId = D
TraceId = XSpanId = E
TraceId = XSpanId = E
TraceId = XSpanId = F
TraceId = XSpanId = G
![Page 127: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/127.jpg)
127
![Page 128: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/128.jpg)
128
![Page 129: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/129.jpg)
129
Rent
Ser
vice
Paym
ent
Serv
ice
SpanId = BClient Send
SpanId = BServer Received
SpanId = BClient Received
SpanId = BServer Send
TraceId = XSpanId = A
TraceId = XSpanId = C
![Page 130: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/130.jpg)
yoman
Yo
start.spring.io
Ss
python
Py
lazybones
Lzjava
Ja
spring boot
Sb
gradle
Grasciidoctor
Adthrift
Thdocker
Dr
mesos
Ms
marathon
Machronos
Chaurora
AuArtifactory
Ar
Kubernetes
Kb
eureka
Eu
consul
Cl
etcd
Ed
zookeeper
Zkhystrix
Hx
sleuth
Sl
zipkin
Zn
groovy
Gy
130
Data Isolation
DiCentralization paradox
CpLSD principle
LsDDD
DdSAGAS
SaSmart Docs
SdDynamic Sharing
DsSmart Libs
SlSOA
So
ansible
An
![Page 131: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/131.jpg)
1. Архитектура функция от множества переменных
2. Всё новое - хорошо забытое старое3. Микросервисы как iPhone4. Микросервисы - новые классы5. Каждой задаче - свой инструмент
Запомните это
131
![Page 132: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/132.jpg)
1. SOA принципы живы2. Принцип LSD3. Изоляция данных делает жизнь приятнее4. В сложных ситуациях Event
Sourcing/CQRS/SAGAS5. Парадокс централизации6. Планируй ресурсы динамически
Придерживайтесь принципов
132
![Page 133: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/133.jpg)
LinksSpring Thrift Starter: https://github.com/aatarasoff/spring-thrift-starter
Тоже, но для grpc: https://github.com/lavcraft/grpc-spring-boot-starter
Какие-то примеры:https://github.com/lavcraft/wild-microservices-in-kiev
Gradle doc plugin blueprint: https://github.com/aatarasoff/documentation-plugin-demo
133
![Page 134: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/134.jpg)
Спасибо! Готовы ответить на ваши вопросы
@tolkv
@aatarasoff
134
@lavcraft
@aatarasoff
![Page 135: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/135.jpg)
Post Scriptum
135
![Page 136: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/136.jpg)
Event Sourcing / CQRS / SAGA
http://gotocon.com/dl/goto-chicago-2015/slides/CaitieMcCaffrey_ApplyingTheSagaPattern.pdf
136
![Page 137: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/137.jpg)
137
![Page 138: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/138.jpg)
138
![Page 139: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/139.jpg)
Saga guarantee
● T1 -> T2 -> T3 -> … -> Tn
● T1 -> T2 -> … Tn -> Cn … -> C2 -> C1
139
![Page 140: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/140.jpg)
140
![Page 141: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/141.jpg)
141
![Page 142: Java Day Minsk 2016 Keynote about Microservices in real world](https://reader031.fdocuments.in/reader031/viewer/2022030115/589ce6bb1a28abf86d8b64c1/html5/thumbnails/142.jpg)
142