Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...
-
Upload
andre-goliath -
Category
Software
-
view
465 -
download
0
Transcript of Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...
![Page 1: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/1.jpg)
Von JavaEE auf
Microservice in 6 MonatenThe Good, the Bad, and the wtfs...
André Goliath
![Page 2: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/2.jpg)
ENTERPRISE IT
![Page 3: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/3.jpg)
![Page 4: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/4.jpg)
MY VISION(AND MY KEY HOLDER, TOO)
![Page 5: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/5.jpg)
![Page 6: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/6.jpg)
SO, HOW TO GET THERE?
![Page 7: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/7.jpg)
WHEN
WHY
WITH WHOM
TO WHAT EXTENT
SO, HOW TO GET THERE?
![Page 8: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/8.jpg)
WHEN
WHY
WITH WHOM
TO WHAT EXTENT
SO, HOW TO GET THERE?
![Page 9: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/9.jpg)
Now!
![Page 10: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/10.jpg)
![Page 11: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/11.jpg)
„Digitization“
Cloud Computing Internet of Things
Virtual Reality
Microservices
$anything as a Service
fastIndustry 4.0
Web 2.0
Social Media
Big Data
Privacy & Security
![Page 12: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/12.jpg)
„Digitization“
Cloud Computing Internet of Things
Virtual Reality
Microservices
$anything as a Service
Industry 4.0
Web 2.0
Social Media
Big Data
Privacy & Security
yeah, let´s
do this!
fast
![Page 13: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/13.jpg)
WHEN
WHY
WITH WHOM
TO WHAT EXTENT
SO, HOW TO GET THERE?
![Page 14: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/14.jpg)
Because we can!
![Page 15: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/15.jpg)
Because we need to!
How long does it take from idea to production?
How long does it need to take from idea to production?
What is the cost of implementing an one-liner feature?
What should the cost be?
![Page 16: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/16.jpg)
Because we need to!
How long does it take from idea to production?
How long does it need to take from idea to production?
What is the cost of implementing an one-liner feature?
What should the cost be?
6 months
Cost to develop x 5
and then some…
![Page 17: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/17.jpg)
6 Monoliths.600 Services. 15 Clients. 25 Backends.
Featuring code from 1995 till today.(Anyone remember J2EE1.2 ?)
![Page 18: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/18.jpg)
Don´t get me wrong.
Monoliths are not bad.(at least not all of them)
![Page 19: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/19.jpg)
WHEN
WHY
WITH WHOM
TO WHAT EXTENT
SO, HOW TO GET THERE?
![Page 20: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/20.jpg)
How to code?
How to deploy?
How to use?
SO, HOW TO GET THERE?
![Page 21: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/21.jpg)
How to code?
How to deploy?
How to use?
SO, HOW TO GET THERE?
![Page 22: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/22.jpg)
Spring Boot
![Page 23: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/23.jpg)
But be careful!
![Page 24: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/24.jpg)
How to catch a 404 error
and wrap it in your own JSON response?
![Page 25: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/25.jpg)
How to catch a 404 error
and wrap it in your own JSON response?It took us about 30 work hours to figure this one out.
And it involves manipulating the embedded Tomcat.
Without a specific Spring Boot API for that feature.
![Page 26: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/26.jpg)
Coding 1 Microservice? Easy.
Coding 100 Microservices? Not so easy.
How do we organize our configuration?
Do we want to share code?
Do we want to force all microservices to use the same Spring Boot version?
Do we allow communication between services?
What aspects do we NEED to be the same for all services?
HATOEAS? Service Boundaries?
![Page 27: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/27.jpg)
Share framework code, nothing else.
![Page 28: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/28.jpg)
Share framework code, nothing else.
If you have no regrets
about sharing your code
on github, it is probably
framework code
![Page 29: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/29.jpg)
Share framework code, nothing else.
Filter (Security, Authentication, Logging, Monitoring)
Error Handling
Profile / Envíronment Configuration
Logging Configuration
Common Documentation
If you have no regrets
about sharing your code
on github, it is probably
framework code
![Page 30: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/30.jpg)
How about communication?
![Page 31: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/31.jpg)
Customer Search Card Management Account Management
„Backend“ Microservices
Mobile App Online Banking Branch
„Gateway“ Microservices
Mobile App Online Banking Branch
Actual Frontends
![Page 32: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/32.jpg)
Customer Search Card Management Account Management
„Backend“ Microservices
Data
Tailoring
Mobile App Online Banking Branch
„Gateway“ Microservices
Mobile App Online Banking Branch
Actual Frontends
HATEOAS
Links
Service
Orchestration
Clientspecific
Security
![Page 33: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/33.jpg)
Spring Cloud„Production-Ready“ Features…
… but only in an ideal world.
![Page 34: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/34.jpg)
Spring CloudActuator endpoints
Good for quick debugging, but how to integrate them in an enterprise monitoring world?
Configserver
You better play by the rules. Don´t use a – in your service name!
Routing Stuff (Eureka, Zuul, Ribbon)
Works. But only if you commit to doing routing the Netflix-way.
![Page 35: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/35.jpg)
How to code?
How to deploy?
How to use?
SO, HOW TO GET THERE?
![Page 36: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/36.jpg)
Automation!Tests
Builds
Provisioning
Deployments
![Page 37: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/37.jpg)
Automation! But…
Strict Hardware and OS Restrictions
No direct communication between development and production environments
No SSH connections to production
„I don´t trust those tools“ (senior dev.)
You want to put something into production?
Fine, here complete these forms,
and have them signed by 10 people,
who have never heard of you,
and have no clue what you are doing.
![Page 38: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/38.jpg)
The most important rule
Use the same deployment toolchain
for development, UATs, and production!
![Page 39: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/39.jpg)
So here is what we did.
![Page 40: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/40.jpg)
Step 1: Prepare everything for coding
![Page 41: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/41.jpg)
Code Repo
Developer
Jenkins
Deploy
Scripts
Ansibleansible-playbook create.yml
![Page 42: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/42.jpg)
![Page 43: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/43.jpg)
Step 2: Code and Test
![Page 44: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/44.jpg)
Code Repo
Developer
Jenkins
Deploy
Scripts
git push origin f-newStuff
git
post-push
hook
ssh
scp
Development / Test Environment
Service
Host A
Service
Host B
Config
Server
Apache
mod_proxy
![Page 45: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/45.jpg)
Step 3: Deploy to Production
![Page 46: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/46.jpg)
Code Repo
Developer
Deploy
Scripts
POTS:
„Please deploy v1, I‘ll mail you the paperwork“
ftp
ssh
Development / Test Environment
Service
Host A
Service
Host B
Config
Server
Apache
mod_proxy
Ops Guy
Production Environment
Gateway
Service
Host B
Config
Server
Apache
mod_proxy
some proprietary protocols…
Service
Host A
![Page 47: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/47.jpg)
Why no Docker?
![Page 48: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/48.jpg)
Why no Docker?Getting into Docker is easy. Even at a later stage.
Getting back from Docker to something else is a hell of a ride.
![Page 49: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/49.jpg)
How to code?
How to deploy?
How to use?
SO, HOW TO GET THERE?
![Page 50: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/50.jpg)
Working software
over comprehensive documentation
- agilemanifesto.org -
![Page 51: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/51.jpg)
Test-Driven Documentationusing spring-restdocs
![Page 52: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/52.jpg)
![Page 53: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/53.jpg)
![Page 54: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/54.jpg)
![Page 55: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/55.jpg)
Swagger UI
![Page 56: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/56.jpg)
![Page 57: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/57.jpg)
WHEN
WHY
WITH WHOM
TO WHAT EXTENT
SO, HOW TO GET THERE?
![Page 58: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/58.jpg)
You must overcome Conway‘s Law
![Page 59: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/59.jpg)
Vertical TeamsJust get used to it.
![Page 60: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/60.jpg)
Customer Search Card Management Account Management
„Backend“ Microservices
Mobile App Online Banking Branch
„Gateway“ Microservices
Mobile App Online Banking Branch
Actual Frontends
All developed in
one team!?!
![Page 61: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/61.jpg)
WHEN
WHY
WITH WHOM
TO WHAT EXTENT
SO, HOW TO GET THERE?
![Page 62: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/62.jpg)
There is no need for a big bang
![Page 63: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/63.jpg)
We started with 1 service and 1 client
![Page 64: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/64.jpg)
There are viable migration pathseven for legacy code
![Page 65: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/65.jpg)
Bottom Line?
![Page 66: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/66.jpg)
It works. Even in enterprises.
![Page 67: Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ecd56d1a28ab264f8b4623/html5/thumbnails/67.jpg)
One step at a time,
and you´ll be fine.