Drabina Ekspertów
Transcript of Drabina Ekspertów
![Page 1: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/1.jpg)
Drabina EkspertówŚcisły przewodnik po aspektach miękkich – część II
Enterprise makeover
Making sense of agile requirements
Przejrzysty i testowalny kod na Androidzie?
REST w praktyce - tej dobrej i tej złej
Skalowanie i integracja systemów w asynchronicznym stylu
Do you think you're doing microservice architecture?
CQRS dla każdego
Kiedy, jak i po co migrować na NoSQL
www.bottega.com.pl facebook.com/BottegaITSolutions
![Page 2: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/2.jpg)
About usŁUKASZ SZCZĘSNY
Systems engineer atCo-organizer of the Warsaw Linux User GroupFan of automation and DevOps
Twitter: @wybczuBlog: http://wybcz.plHomepage: http://wybcz.pl
![Page 3: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/3.jpg)
About usMARCIN GRZEJSZCZAK
Software Architect atAuthor of "Mockito Instant", "Mockito Cookbook" booksCo-author of the Groovy core’s @Builder AST Co-founder of the Warsaw Groovy User GroupCo-author of "micro-infra-spring" lib
Twitter: @MGrzejszczakBlog: http://toomuchcoding.blogspot.comHomepage: http://marcin.grzejszczak.pl
![Page 4: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/4.jpg)
Agendashort intro to microserviceshow to deploy your first microservicemicroservice pitfalls
![Page 5: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/5.jpg)
Agendashort intro to microserviceshow to deploy your first microservicemicroservice pitfalls
![Page 6: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/6.jpg)
Conway’s Law
Conway, Melvin E. (April 1968), How do Committees Invent?, Datamation 14 (5): 28–31, retrieved 2009-04-05
Organizations which design systems ... are constrained to produce designs which are copies of the communication structures of these organizations
— M. Conway
![Page 7: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/7.jpg)
A single codebase
Conway’s Law in practice
![Page 8: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/8.jpg)
A single codebase
Conway’s Law in practice
![Page 9: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/9.jpg)
Conway’s Law in practiceConcept:
one team
two countries
one codebase
![Page 10: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/10.jpg)
Conway’s Law in practiceReality:
two teams
two countries
one codebase
![Page 11: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/11.jpg)
Conway’s Law in practiceEffect:
two different solutions
solving same stuff
one codebase
![Page 12: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/12.jpg)
Conway’s Law - siloed teams
extract from http://martinfowler.com/articles/microservices.html
![Page 13: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/13.jpg)
Conway’s Law - cross functional teams
extract from http://martinfowler.com/articles/microservices.html
![Page 14: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/14.jpg)
Business flow
AccountingBack officeFront office
![Page 15: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/15.jpg)
Common problematic code flow
Dto Service
Impl Entity
Accounting Accounting
Accounting Accounting
Front office Front office
Front office Front office
Back office Back office
Back office Back office
monolith
many programmers
big organization
![Page 16: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/16.jpg)
Common problematic code flow
Looks familiar?
http://www.foodnetwork.com/topics/spaghetti-recipes.html
![Page 17: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/17.jpg)
Code flow
REST REST
Autonomous
Business oriented
PolyglotLightweight
Front officebounded context
JARS
Back officebounded context
JARS
Accountingbounded context
JARS
![Page 18: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/18.jpg)
Microservices vs ESB
http://www.banzaj.pl/pictures/sport/boks/Haye_Walujew/haye_vs.walujew_2.jpg
![Page 19: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/19.jpg)
Microservices vs ESBEnterprise Service Bus
intelligent communication layer between services
provides routing, transformations etc
![Page 20: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/20.jpg)
Microservices vs ESBMicroservices approach favors
smart endpoints (services)
dumb pipes (means of communication)
![Page 21: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/21.jpg)
Microservices vs SOASOA - Service Oriented Architecture - a very broad topic
Typically understood as XML and SOAP based with WSDLESB based solution
Microservice may be called “more thoroughly described SOA”
![Page 22: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/22.jpg)
Agendashort intro to microserviceshow to deploy your first microservicemicroservice pitfalls
![Page 23: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/23.jpg)
Write codeAs a developer
I want my microservice codebase to be small
I want to be fully responsible for supporting that service
I don’t want people from outside my team to push changes to my codebase
![Page 24: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/24.jpg)
Write code
introduce code review / working via Pull Requests
dev team responsible for CD pipeline
dev team receives all alerts
![Page 25: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/25.jpg)
Build itAs a developer
I’d like all services to be built alike
it’s easier to comprehend and support
I’d like to have fast feedback if my code works
![Page 26: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/26.jpg)
Build it
![Page 27: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/27.jpg)
Build itJenkins as a Code
Jenkins master and slaves deployment
Jenkins’ jobs creation
one CD pipeline template to rule them all
![Page 28: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/28.jpg)
Build itdef project = 'quidryan/aws-sdk-test'def branchApi = new URL("https://api.github.com/repos/${project}/branches")def branches = new groovy.json.JsonSlurper().parse(branchApi.newReader())branches.each { def branchName = it.name job { name "${project}-${branchName}".replaceAll('/','-') scm { git("git://github.com/${project}.git", branchName) } steps { maven("test -Dproject.name=${project}/${branchName}") } }}
![Page 29: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/29.jpg)
Test itAs a developer
I don’t want to hardcode service’s IPs and ports
I don’t want to set up whole environment for tests
I’d like to test my application in isolation
I’d like to ensure that others can talk to my service
![Page 30: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/30.jpg)
Service DiscoveryFind your collaborator’s address and port with
ZookeeperConsulEurekaEtcd...
![Page 31: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/31.jpg)
Consumer Driven Contracts
HTTP REQUEST
HTTP RESPONSE
HTTP REQUEST
HTTP RESPONSE
version 1 version 2
![Page 32: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/32.jpg)
Consumer Driven Contracts
REQ
RESP
REQ
RESP
REQ
RESP
REQ
RESP
REQ
RESP
RE
Q
RE
SP
RE
Q
RE
SP
RE
Q
RE
SP
v1 v2 v8
v4 v2 v3
![Page 33: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/33.jpg)
Consumer Driven Contracts
![Page 34: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/34.jpg)
Consumer Driven Contracts
![Page 35: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/35.jpg)
Consumer Driven Contracts
REQ
RESP
REQ
RESP
RE
Q
RE
SP
v1 v8
v2 v3
STUB
STUB
![Page 36: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/36.jpg)
Consumer Driven Contracts
REQ
RESP
REQ
RESP
RE
Q
RE
SP
v1
STUB
STUB
![Page 37: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/37.jpg)
Consumer Driven ContractsConsumer Driven Contracts:
test your stub against server
your consumers call your stubs
![Page 38: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/38.jpg)
Deploy itAs a developer
I’d like my feature to be on production ASAP
I’d like to have application properties in one placeauditablesecure
![Page 39: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/39.jpg)
Deploy it
![Page 40: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/40.jpg)
Deploy itEnvironment provisioning
PuppetChefSalt Ansible...
![Page 41: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/41.jpg)
Deploy itApplication deployment
RundeckCapistranoFabricAnsibleFreight...
![Page 42: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/42.jpg)
Deploy itApplication configuration
Version it!Encrypt it!
Spring Cloud Config Server
micro-infra-spring-config
![Page 43: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/43.jpg)
Monitor itAs a developer
I don’t want to grep my logs from different servers
I’d like to have application data in one placelogsmetricshealth status
![Page 44: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/44.jpg)
Monitor itLogs
Unify logging patterns!Collect logs in one place
syslog,ELK stack, graylog2,Splunk, Loggly...
![Page 45: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/45.jpg)
CorrelationID
FIRST SERVICE
REQUEST
No correlationId
CorrelationId set to X
CorrelationId set to X
RESPONSE
SECOND SERVICE
REQUEST
CorrelationId set to X
CorrelationId set to X
RESPONSE
ANOTHER SERVICE
REQUEST
CorrelationId set to XCorrelationId
set to X
RESPONSECorrelationId set to X
YET ANOTHER SERVICE
REQUEST
CorrelationId set to XCorrelationId
set to X
RESPONSE
![Page 46: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/46.jpg)
CorrelationID
![Page 47: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/47.jpg)
Monitor itMetrics
graphite + grafana / tesseracollectd / muninstatsd
![Page 48: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/48.jpg)
Monitor itAlters
nagios / zabbixcabotlogstash!
![Page 49: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/49.jpg)
Agendashort intro to microserviceshow to deploy your first microservicemicroservice pitfalls
![Page 50: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/50.jpg)
Code reuse
do not abstract everything
sometimes copy paste gives you code decoupling
no - copy paste is not a solution to all problems ;)
do not write nanoservices - who will support it?
![Page 51: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/51.jpg)
Too many technology stacks
pick a right tool for the job but don’t exaggerate
why would you ever want to code in Brainfuck or Whitespace?
someone will support it afterwards - want to do it? ;)
![Page 52: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/52.jpg)
Management issues
have to invest time and effort to build foundations
have to invest in infrastructure and devops
feature delivery pace will decrease for some time
![Page 53: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/53.jpg)
Questions?
![Page 54: Drabina Ekspertów](https://reader033.fdocument.pub/reader033/viewer/2022051506/587601d91a28ab0f0c8b6e9d/html5/thumbnails/54.jpg)
LinksMicroservice HackathonAccurest - Consumer Driven Contracts implementation