java architectures - a new hope
DESCRIPTION
Large Java Enterprise ApplicationsTRANSCRIPT
![Page 1: Java Architectures - a New Hope](https://reader038.vdocuments.us/reader038/viewer/2022110113/540d69288d7f728d7e8b48fd/html5/thumbnails/1.jpg)
Java Architectures
Eberhard Wolff http://ewolff.com
A New Hope
![Page 2: Java Architectures - a New Hope](https://reader038.vdocuments.us/reader038/viewer/2022110113/540d69288d7f728d7e8b48fd/html5/thumbnails/2.jpg)
Eberhard Wolff - @ewolff
What happens with a talk titled
like this?
![Page 3: Java Architectures - a New Hope](https://reader038.vdocuments.us/reader038/viewer/2022110113/540d69288d7f728d7e8b48fd/html5/thumbnails/3.jpg)
Architecture of Enterprise
Java Apps
![Page 4: Java Architectures - a New Hope](https://reader038.vdocuments.us/reader038/viewer/2022110113/540d69288d7f728d7e8b48fd/html5/thumbnails/4.jpg)
Eberhard Wolff - @ewolff
![Page 5: Java Architectures - a New Hope](https://reader038.vdocuments.us/reader038/viewer/2022110113/540d69288d7f728d7e8b48fd/html5/thumbnails/5.jpg)
Eberhard Wolff - @ewolff
![Page 6: Java Architectures - a New Hope](https://reader038.vdocuments.us/reader038/viewer/2022110113/540d69288d7f728d7e8b48fd/html5/thumbnails/6.jpg)
Eberhard Wolff - @ewolff
How can I implement a
new feature???
![Page 7: Java Architectures - a New Hope](https://reader038.vdocuments.us/reader038/viewer/2022110113/540d69288d7f728d7e8b48fd/html5/thumbnails/7.jpg)
Eberhard Wolff - @ewolff !
![Page 8: Java Architectures - a New Hope](https://reader038.vdocuments.us/reader038/viewer/2022110113/540d69288d7f728d7e8b48fd/html5/thumbnails/8.jpg)
Eberhard Wolff - @ewolff
ECommerce System
Spring & OSGi
New Stuff
![Page 9: Java Architectures - a New Hope](https://reader038.vdocuments.us/reader038/viewer/2022110113/540d69288d7f728d7e8b48fd/html5/thumbnails/9.jpg)
Eberhard Wolff - @ewolff
New Stuff Spring & OSGi
New Stuff
ECommerce System
![Page 10: Java Architectures - a New Hope](https://reader038.vdocuments.us/reader038/viewer/2022110113/540d69288d7f728d7e8b48fd/html5/thumbnails/10.jpg)
Eberhard Wolff - @ewolff
HTTP
New Stuff
Links
No legacy code Any technology
" Small code base
![Page 11: Java Architectures - a New Hope](https://reader038.vdocuments.us/reader038/viewer/2022110113/540d69288d7f728d7e8b48fd/html5/thumbnails/11.jpg)
Eberhard Wolff - @ewolff
Micro Services • Component Model
• Component… • Separate process • Individual deployment unit • GUI+Logic • Small services+GUI – unlike SOA
![Page 12: Java Architectures - a New Hope](https://reader038.vdocuments.us/reader038/viewer/2022110113/540d69288d7f728d7e8b48fd/html5/thumbnails/12.jpg)
Eberhard Wolff - @ewolff
Online Shop
Order
Catalog
Search
Billing
![Page 13: Java Architectures - a New Hope](https://reader038.vdocuments.us/reader038/viewer/2022110113/540d69288d7f728d7e8b48fd/html5/thumbnails/13.jpg)
Eberhard Wolff - @ewolff
Online Shop
elasticsearch
Spring Batch Oracle
Spring MVC MongoDB
Order
Catalog
Search
Billing
![Page 14: Java Architectures - a New Hope](https://reader038.vdocuments.us/reader038/viewer/2022110113/540d69288d7f728d7e8b48fd/html5/thumbnails/14.jpg)
Service might be even smaller
![Page 15: Java Architectures - a New Hope](https://reader038.vdocuments.us/reader038/viewer/2022110113/540d69288d7f728d7e8b48fd/html5/thumbnails/15.jpg)
Eberhard Wolff - @ewolff
Continuous Delivery
![Page 16: Java Architectures - a New Hope](https://reader038.vdocuments.us/reader038/viewer/2022110113/540d69288d7f728d7e8b48fd/html5/thumbnails/16.jpg)
Eberhard Wolff - @ewolff
Continuous Delivery: Build Pipeline
Commit Stage
Automated Acceptance
Testing
Automated Capacity Testing
Manual Explorative
Testing
Release
![Page 17: Java Architectures - a New Hope](https://reader038.vdocuments.us/reader038/viewer/2022110113/540d69288d7f728d7e8b48fd/html5/thumbnails/17.jpg)
Eberhard Wolff - @ewolff
Without Micro Services • Modify order process slightly • Billing, Search & Catalog unchanged
Order
Catalog
Search
Billing
![Page 18: Java Architectures - a New Hope](https://reader038.vdocuments.us/reader038/viewer/2022110113/540d69288d7f728d7e8b48fd/html5/thumbnails/18.jpg)
Eberhard Wolff - @ewolff
Order
Catalog
Search
Billing
![Page 19: Java Architectures - a New Hope](https://reader038.vdocuments.us/reader038/viewer/2022110113/540d69288d7f728d7e8b48fd/html5/thumbnails/19.jpg)
Eberhard Wolff - @ewolff
Continuous Delivery: Everything Tested etc
Commit Stage
Automated Acceptance
Testing
Automated Capacity Testing
Manual Explorative
Testing
Release Order
Catalog
Search
Billing
![Page 20: Java Architectures - a New Hope](https://reader038.vdocuments.us/reader038/viewer/2022110113/540d69288d7f728d7e8b48fd/html5/thumbnails/20.jpg)
Eberhard Wolff - @ewolff
Build Pipeline • Just one component changed!
• Lots of unneeded work
• Takes much too long
![Page 21: Java Architectures - a New Hope](https://reader038.vdocuments.us/reader038/viewer/2022110113/540d69288d7f728d7e8b48fd/html5/thumbnails/21.jpg)
Eberhard Wolff - @ewolff
With Micro Services
Commit Stage
Automated Acceptance
Testing
Automated Capacity Testing
Manual Explorative
Testing
Release Order
![Page 22: Java Architectures - a New Hope](https://reader038.vdocuments.us/reader038/viewer/2022110113/540d69288d7f728d7e8b48fd/html5/thumbnails/22.jpg)
Eberhard Wolff - @ewolff
Release • Just a single component
• Faster feedback
• Easier deployment • Rollback of single service also easier
![Page 23: Java Architectures - a New Hope](https://reader038.vdocuments.us/reader038/viewer/2022110113/540d69288d7f728d7e8b48fd/html5/thumbnails/23.jpg)
Eberhard Wolff - @ewolff
How to scale agile?
Implement more feature
![Page 24: Java Architectures - a New Hope](https://reader038.vdocuments.us/reader038/viewer/2022110113/540d69288d7f728d7e8b48fd/html5/thumbnails/24.jpg)
Eberhard Wolff - @ewolff
Conways Law Architecture
copies communication structures
of the organization
![Page 25: Java Architectures - a New Hope](https://reader038.vdocuments.us/reader038/viewer/2022110113/540d69288d7f728d7e8b48fd/html5/thumbnails/25.jpg)
Eberhard Wolff - @ewolff
Online Shop
Order
Catalog
Search
Billing
Component = Team
![Page 26: Java Architectures - a New Hope](https://reader038.vdocuments.us/reader038/viewer/2022110113/540d69288d7f728d7e8b48fd/html5/thumbnails/26.jpg)
Eberhard Wolff - @ewolff
Micro Service • Team independent from each other
• No code dependencies • Can use individual technology stack • Can even deploy independently
• Speed up development
![Page 27: Java Architectures - a New Hope](https://reader038.vdocuments.us/reader038/viewer/2022110113/540d69288d7f728d7e8b48fd/html5/thumbnails/27.jpg)
Eberhard Wolff - @ewolff
Architecture Challenges • Code Reuse? • Handling interfaces? • Managing dependencies between
(>100) Services? • Global architecture? • Global refactorings?
![Page 28: Java Architectures - a New Hope](https://reader038.vdocuments.us/reader038/viewer/2022110113/540d69288d7f728d7e8b48fd/html5/thumbnails/28.jpg)
Install and configure App Server for each Microservice??
![Page 29: Java Architectures - a New Hope](https://reader038.vdocuments.us/reader038/viewer/2022110113/540d69288d7f728d7e8b48fd/html5/thumbnails/29.jpg)
Simple Java Application? What about Operations?
![Page 30: Java Architectures - a New Hope](https://reader038.vdocuments.us/reader038/viewer/2022110113/540d69288d7f728d7e8b48fd/html5/thumbnails/30.jpg)
Spring Boot Demo
![Page 31: Java Architectures - a New Hope](https://reader038.vdocuments.us/reader038/viewer/2022110113/540d69288d7f728d7e8b48fd/html5/thumbnails/31.jpg)
Eberhard Wolff - @ewolff
Why Spring Boot? • Easier deployment • i.e. just a JAR
• Built in operations support
![Page 32: Java Architectures - a New Hope](https://reader038.vdocuments.us/reader038/viewer/2022110113/540d69288d7f728d7e8b48fd/html5/thumbnails/32.jpg)
Eberhard Wolff - @ewolff
Other Technologies • Dropwizard by Yammer
• vert.x
• Play Framework
![Page 33: Java Architectures - a New Hope](https://reader038.vdocuments.us/reader038/viewer/2022110113/540d69288d7f728d7e8b48fd/html5/thumbnails/33.jpg)
Micro Services as a
Component System
![Page 34: Java Architectures - a New Hope](https://reader038.vdocuments.us/reader038/viewer/2022110113/540d69288d7f728d7e8b48fd/html5/thumbnails/34.jpg)
Eberhard Wolff - @ewolff
Components Collaborate
Micro Service
Micro Service
Link
Data Replication
REST Messaging
![Page 35: Java Architectures - a New Hope](https://reader038.vdocuments.us/reader038/viewer/2022110113/540d69288d7f728d7e8b48fd/html5/thumbnails/35.jpg)
Micro Service can easily integrate
with Legacy
![Page 36: Java Architectures - a New Hope](https://reader038.vdocuments.us/reader038/viewer/2022110113/540d69288d7f728d7e8b48fd/html5/thumbnails/36.jpg)
Deploy & Operate?
![Page 37: Java Architectures - a New Hope](https://reader038.vdocuments.us/reader038/viewer/2022110113/540d69288d7f728d7e8b48fd/html5/thumbnails/37.jpg)
Eberhard Wolff - @ewolff
Component Model • No restriction on language etc • Individual processes • + infrastructure (database etc) • JARs, WARs, EARs: No good fit • Virtual machines as components? • Overhead??
![Page 38: Java Architectures - a New Hope](https://reader038.vdocuments.us/reader038/viewer/2022110113/540d69288d7f728d7e8b48fd/html5/thumbnails/38.jpg)
Eberhard Wolff - @ewolff
Docker • No true virtualization
• Linux Containers (lxc) • i.e. shared kernel • i.e. separate file systems
![Page 39: Java Architectures - a New Hope](https://reader038.vdocuments.us/reader038/viewer/2022110113/540d69288d7f728d7e8b48fd/html5/thumbnails/39.jpg)
Eberhard Wolff - @ewolff
Docker File Systems • Read only base images • +read/write image
• Can be stacked Application
Read / Write
Java
Ubuntu
![Page 40: Java Architectures - a New Hope](https://reader038.vdocuments.us/reader038/viewer/2022110113/540d69288d7f728d7e8b48fd/html5/thumbnails/40.jpg)
Eberhard Wolff - @ewolff
Docker • Linux only
• So: Run it in VM
• Controlled by Vagrant
![Page 41: Java Architectures - a New Hope](https://reader038.vdocuments.us/reader038/viewer/2022110113/540d69288d7f728d7e8b48fd/html5/thumbnails/41.jpg)
Docker Demo
![Page 42: Java Architectures - a New Hope](https://reader038.vdocuments.us/reader038/viewer/2022110113/540d69288d7f728d7e8b48fd/html5/thumbnails/42.jpg)
Eberhard Wolff - @ewolff
Vagrant VM
Docker ContainerRedis
Port6379
6379
6379
![Page 43: Java Architectures - a New Hope](https://reader038.vdocuments.us/reader038/viewer/2022110113/540d69288d7f728d7e8b48fd/html5/thumbnails/43.jpg)
Eberhard Wolff - @ewolff
Communication Between Docker Container
• Via ports
• Via data volumes
![Page 44: Java Architectures - a New Hope](https://reader038.vdocuments.us/reader038/viewer/2022110113/540d69288d7f728d7e8b48fd/html5/thumbnails/44.jpg)
Docker is a Component
System
![Page 45: Java Architectures - a New Hope](https://reader038.vdocuments.us/reader038/viewer/2022110113/540d69288d7f728d7e8b48fd/html5/thumbnails/45.jpg)
Eberhard Wolff - @ewolff
Example • Log file analysis • ELK Stack • Elasticsearch: Store • Logstash: Parse • Kibana: Web based GUI • Install three servers • Automate installation ... !
![Page 46: Java Architectures - a New Hope](https://reader038.vdocuments.us/reader038/viewer/2022110113/540d69288d7f728d7e8b48fd/html5/thumbnails/46.jpg)
Eberhard Wolff - @ewolff
Dockerized ELK Stack • 1 Vagrantfile (25 lines) • 6 Dockerfiles (total 28 lines) • 1 HTML file (11 lines) • 1 Config (Logstash) (29 lines)
• Total: 93 lines, 9 files • Including one RegExp !
![Page 47: Java Architectures - a New Hope](https://reader038.vdocuments.us/reader038/viewer/2022110113/540d69288d7f728d7e8b48fd/html5/thumbnails/47.jpg)
Eberhard Wolff - @ewolff
Vagrant VM
Containeruser-registration
8080
8081
Port8081
Containerelasticsearch
Containerlogstash
9200
9200
Port9200
9200
link
Containerkibana
Port8080
8080
8080
Browser
Volume/log
![Page 48: Java Architectures - a New Hope](https://reader038.vdocuments.us/reader038/viewer/2022110113/540d69288d7f728d7e8b48fd/html5/thumbnails/48.jpg)
Demo ELK Stack
![Page 49: Java Architectures - a New Hope](https://reader038.vdocuments.us/reader038/viewer/2022110113/540d69288d7f728d7e8b48fd/html5/thumbnails/49.jpg)
Eberhard Wolff - @ewolff
Links • https://github.com/ewolff/user-
registration • http://www.heise.de/developer/
artikel/Episode-44-Modularisierte-Architektur-fuer-grosse-Systeme-2195818.html
• http://projects.spring.io/spring-boot/ • http://www.docker.com/ • http://www.docker.com/tryit
![Page 50: Java Architectures - a New Hope](https://reader038.vdocuments.us/reader038/viewer/2022110113/540d69288d7f728d7e8b48fd/html5/thumbnails/50.jpg)
Eberhard Wolff - @ewolff
![Page 51: Java Architectures - a New Hope](https://reader038.vdocuments.us/reader038/viewer/2022110113/540d69288d7f728d7e8b48fd/html5/thumbnails/51.jpg)
Eberhard Wolff - @ewolff
Micro Services • A new hope against Java Monoliths • Also great for legacy
• Spring Boot for implementation
• Docker as component model & runtime