dmitry petukhov (provectus): "МИКРОСЕРВИСЫ НА ПРАКТИКЕ....
TRANSCRIPT
Features Known
● modularity a step towards clean architecture● single responsibility principle SOLID app!● distributed deployment model scalable app!● full isolation of:
○ teams and backlogs bye 30-min meetings!○ versioning CI increments it when needed○ repositories a repo per module is faultless○ documentation small separated docs○ CI servers concurrent build of everything○ hardware isolation of JVMs and instances
Monolith
”$ pidof java9927 2151
$ ps aux | grep -v grep | grep java | awk '{print $2}'99272151
Microservice
- Milen Dyankov / Liferay, JPoint 2017
Microservices = SOA -- ESB - SOAP- centralized DB/mgmt- fixed vendors+ REST/HTTP + CI/CD + DevOps+ cross-language + containerization+ Cloud/PaaS
- Arun Gupta / AWS
”
Benefits of Microservices
● Independent of languages true polyglot programming● Independent of frameworks choose best for purpose● Independent of datasources SQL, NoSQL, files, streams● Independent of other microservices except contracts● Independent of UI frontend guys don't even know you● Asynchronous speed up your system X times● Observable monitoring, logging, tracing● Testable embraces automated testing
Companies Evolved To Microservices
● Google● Netflix● eBay● Amazon● Facebook
Are you operating on
the samescale?
● PayPal● Twitter● Walmart● Spotify● LinkedIn
Microservices vs Modularity / Milen Dyankov
Milen Dyankov -
Microservices and
Modularity or the difference
between treatment and cure!
JUG .ru
149 views
Uploaded on May 4, 2017
1:02:08
REST API
● Server-side query engine greatly enriches plain REST● CQRS segregation supports queries and mutations● Sync/async execution even better in GraphQL 5.0● Schema as documentation yet another doc for your API
Service security
Business Access
Permissions
● Authentication (401)● Authorization (403)● Session management (SSO)● OAuth 2.0● JWT authorization tokens
● Role-based access● Group-based access● User-based access
Resilience
● Fault-tolerance with fallback no more cascading failures● Repeatable commands configurable● Sync/async/reactive execution thanks to RxJava!● Latency metrics for each call● Web dashboard see problems on circuits instantly
Inter-service communication
● Cross-language support● Lightweight serialization● Binary protocols
Apache Thrift
Logging
+ Transparent logging unique request ID across the system+ All services have logs from API Gateway to DB workers+ 2K requests/sec ~10K log entries per second+ Automated request logging on every Hystrix call
Monitoring and tracing
+ Hystrix metrics and healtchecks built-in+ Dropwizard metrics and healthchecks built-in+ Brave/Zipkin tracing request timespans+ Metrix from JVM threads, GC, memory, NIO buffers etc.+ Custom endpoints /ping, /properties etc.+ AWS monitoring Cloudwatch, RDS, Asgard etc.+ 3rd party monitoring Kafka/Hermes, RMQ, Icinga,
Configuration
Static
● Source configuration files● Jenkins configurations for
build & deployment
Dynamic
● Git repos for dynamic settings● Endpoints to rewrite dynamic
settings
Testing
● API unit- and IT tests JUnit/Mockito/TestNG● API load testing JMeter● API regression testing Chakram JS● Manual testing
upstream
requests
downstream
request
Request Processing
Jersey
endpoints
Handler
A
Handler
B
Handler
C
Operation
Handlers
Service A
Service B1
Service B2
Business
Services
Service C
Upstream
Commands
GraphQL
engine
Single-
threaded
strategy
Multi-
threaded
strategy
Resource
A
Resource
B
Resource
C
Thank you!
from monolith to microservices
metrics, monitoring, logging
eventual consistency
transactionality
data sources
blue/green
documentation
runtime dependencies
source code dependencies
static and dynamic configuration
introducing new microservices
splitting existing service
service discovery
loadbalancing
security
resilience
fault-tolerance
invocation retries
asynchronous communication
dynamic request routing (fallbacks)
Q & A