Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
MICROSERVICES IN REALITY:
INCEPTION
Dmitry Petukhov / Upwork Mobile API
dpetukhov@provectus.com
What are
Microservices
?
Features Known
● modularity a step towards clean architecture
● single responsibility principle SOLID app!
● distributed d...
Microservices
vs
monoliths
Monolith
”$ pidof java
9927 2151
$ ps aux | grep -v grep | grep java | awk '{print $2}'
9927
2151
Microservice
- Milen Dya...
Common Idea
Microservices in
J2EE containers?
● Glassfish
● JBoss / WildFly
● WebSphere
● WebLogic etc.
Microservices = SOA -
- ESB - SOAP
- centralized DB/mgmt
- fixed vendors
+ REST/HTTP + CI/CD + DevOps
+ cross-language + c...
Microservices
on modular
platforms?
● OSGi containers
● JBoss Modules
Why use
microservices
?
Benefits of Microservices
● Independent of languages true polyglot programming
● Independent of frameworks choose best for...
What People Say
Microservices
reduce
complexity!
...do they?
Under the Hood
– Complexity reduced!
Companies Evolved To Microservices
● Google
● Netflix
● eBay
● Amazon
● Facebook
Are you
operating on
the same
scale?
● Pa...
Monolith First / Martin Fowler
Don't Start With A Monolith / Stefan Tilkov
Microservices vs Modularity / Milen Dyankov
Milen Dyankov -
Microservices and
Modularity or the difference
between treatme...
How we do
microservices
at Upwork
Upwork Mission
1 2
3
14M
users
Upwork in Numbers
300
services
30
teams
Mobile API is presented by
2teams and 11 services
Upwork Mobile API
Technology stack
Guice
REST API
● Server-side query engine greatly enriches plain REST
● CQRS segregation supports queries and mutations
● Sync/a...
Service security
Business Access
Permissions
● Authentication (401)
● Authorization (403)
● Session management (SSO)
● OAu...
Resilience
● Fault-tolerance with fallback no more cascading failures
● Repeatable commands configurable
● Sync/async/reac...
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
...
Monitoring and tracing
+ Hystrix metrics and healtchecks built-in
+ Dropwizard metrics and healthchecks built-in
+ Brave/Z...
Configuration
Static
● Source configuration files
● Jenkins configurations for
build & deployment
Dynamic
● Git repos for ...
Testing
● API unit- and IT tests JUnit/Mockito/TestNG
● API load testing JMeter
● API regression testing Chakram JS
● Manu...
Data storages
Documentation
1GraphQL API Doc 2Swagger UI Doc
upstream
requests
downstream
request
Request Processing
Jersey
endpoints
Handler
A
Handler
B
Handler
C
Operation
Handlers
...
Management Console
Thank you!
from monolith to microservices
metrics, monitoring, logging
eventual consistency
transactionality
data sources
...
Upcoming SlideShare
Loading in …5
×

Dmitry Petukhov (Provectus): "МИКРОСЕРВИСЫ НА ПРАКТИКЕ. НАЧАЛО."

357 views

Published on

Published in: Technology
  • Be the first to comment

Dmitry Petukhov (Provectus): "МИКРОСЕРВИСЫ НА ПРАКТИКЕ. НАЧАЛО."

  1. 1. MICROSERVICES IN REALITY: INCEPTION Dmitry Petukhov / Upwork Mobile API dpetukhov@provectus.com
  2. 2. What are Microservices ?
  3. 3. 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
  4. 4. Microservices vs monoliths
  5. 5. Monolith ”$ pidof java 9927 2151 $ ps aux | grep -v grep | grep java | awk '{print $2}' 9927 2151 Microservice - Milen Dyankov / Liferay, JPoint 2017
  6. 6. Common Idea
  7. 7. Microservices in J2EE containers? ● Glassfish ● JBoss / WildFly ● WebSphere ● WebLogic etc.
  8. 8. Microservices = SOA - - ESB - SOAP - centralized DB/mgmt - fixed vendors + REST/HTTP + CI/CD + DevOps + cross-language + containerization + Cloud/PaaS - Arun Gupta / AWS ”
  9. 9. Microservices on modular platforms? ● OSGi containers ● JBoss Modules
  10. 10. Why use microservices ?
  11. 11. 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
  12. 12. What People Say
  13. 13. Microservices reduce complexity! ...do they?
  14. 14. Under the Hood
  15. 15. – Complexity reduced!
  16. 16. Companies Evolved To Microservices ● Google ● Netflix ● eBay ● Amazon ● Facebook Are you operating on the same scale? ● PayPal ● Twitter ● Walmart ● Spotify ● LinkedIn
  17. 17. Monolith First / Martin Fowler
  18. 18. Don't Start With A Monolith / Stefan Tilkov
  19. 19. 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
  20. 20. How we do microservices at Upwork
  21. 21. Upwork Mission 1 2 3
  22. 22. 14M users Upwork in Numbers 300 services 30 teams Mobile API is presented by 2teams and 11 services
  23. 23. Upwork Mobile API
  24. 24. Technology stack Guice
  25. 25. 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
  26. 26. 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
  27. 27. 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
  28. 28. Inter-service communication ● Cross-language support ● Lightweight serialization ● Binary protocols Apache Thrift
  29. 29. 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
  30. 30. 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,
  31. 31. Configuration Static ● Source configuration files ● Jenkins configurations for build & deployment Dynamic ● Git repos for dynamic settings ● Endpoints to rewrite dynamic settings
  32. 32. Testing ● API unit- and IT tests JUnit/Mockito/TestNG ● API load testing JMeter ● API regression testing Chakram JS ● Manual testing
  33. 33. Data storages
  34. 34. Documentation 1GraphQL API Doc 2Swagger UI Doc
  35. 35. 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
  36. 36. Management Console
  37. 37. 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

×