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.

Scale with Microservices

1,842 views

Published on

Microservices introduction and best practices in implementation.

Published in: Technology

Scale with Microservices

  1. 1. Scale with Microservices Võ  Duy  Tuấn   CEO/Founder   Teamcrop.com  
  2. 2. Vo DuyTuan CEO/Founder @Teamcrop.com §  PHP §  Web Scalability & Optimization §  Data Mining §  E-Commerce §  Docker & Microservices Interests
  3. 3. WHY we choose Microservices?
  4. 4. 1. ERP System
  5. 5. 2. Multi-platform
  6. 6. 3. Separation of concerns A design principle for separating a computer program into distinct sections, such that each section addresses a separate concern. - Wikipedia
  7. 7. 4. Resource allocation
  8. 8. 5. Trend
  9. 9. HOW we implement Microservices?
  10. 10. 1. Bounded context
  11. 11. 2. Inter-service communication •  Authentication: –  Json Web Token (JWT) –  Access Trusted Network •  Communications: –  Restful (HTTP) –  SOAP (HTTP) –  AMQP –  App specific: Redis… –  Protobuf
  12. 12. 3. Micro-framework •  Easy to learn •  Easy to code •  Easy to run •  Easy to test •  Easy to deploy •  Easy to upgrade •  Restful Web Service •  Slim framework
  13. 13. 4. Single Page App (SPA)
  14. 14. 5. Configuration
  15. 15. 5. Configuration (cont.)
  16. 16. 6. Logging
  17. 17. 6. Logging (cont.)
  18. 18. 7. Monitoring API  Status  Monitoring  from  statuscake.com  
  19. 19. 7. Monitoring (cont)
  20. 20. 8. Docker
  21. 21. 8. Docker overview
  22. 22. 8. Docker keywords •  Container •  Image •  Registry •  Port •  Volume •  Dockerfile
  23. 23. 8. Docker Container CLI docker run -ti -d -h tc-todo --restart=always --name tc-todo-$RANDOM -p :80 -e SERVICE_TAGS=tc-todo -e CONFIG_URL=http://configurl.com/?abc -e GRAPHITE_IP=127.0.0.1 -v /services/tc-todo/private:/var/www/private -v /services/tc-todo/src:/var/www/src voduytuan/tc-microservice
  24. 24. 9. Service discovery
  25. 25. OPS / Service discovery (cont.)
  26. 26. 9. Service discovery (cont.) HAProxy   Consul-­‐template   Docker  Engine   Backend  01  :  Port  32680   Backend  02  :  Port  32681   Backend  03  :  Port  32682   Update  haproxy.cfg   &  Reload  haproxy   CONSUL   REGISTRATOR   NoSfy   Update   Pull   1   2   3   4   5   Client   gliderlabs/registrator  gliderlabs/consul-­‐server  
  27. 27. 9. Service discovery (cont.) Sample  template  of  Haproxy,  will  parsed  by  Consul-­‐template  
  28. 28. 10. Continuous Integration / Continuous Deployment
  29. 29. 10. Continuous Integration / Continuous Deployment
  30. 30. Thanks! CONTACT: tuanmaster2012@gmail.com 0938 916 902 teamcrop.com

×