Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Microservices from 0 to 0.5

Microservices from 0 to 0.5

What you need to prepare to be ready for microservices, suggestions from my experience.

Avatar for Hai Nguyen

Hai Nguyen

May 16, 2019

More Decks by Hai Nguyen

Other Decks in Technology

Transcript

  1. About Me • More than 10 years working in the

    industry. • Experience in banking and digital transformation. • Involved in building a digital bank from zero . • A hungry learner. • …
  2. Today Story • Motivation. • Why microservices. • What did

    we do wrong? • What would we prepared if we would have done it again? • Do you really need microservice?
  3. Motivation • Scaling the team. • Deliver faster. • Services

    scalability. • Old technology. • Microservice was a shining star. • Learn something hot.
  4. Why microservices • Independent Development – All microservices can be

    easily developed based on their individual functionality. • Independent Deployment – Based on their services, they can be individually deployed in any application. • Fault Isolation – Even if one service of the application does not work, the system still continues to function. • Mixed Technology Stack – Different languages and technologies can be used to build different services of the same application. • Granular Scaling – Individual components can scale as per need, there is no need to scale all components together.
  5. What did we do? • We start by having a

    look at this : https://github.com/sqshq/piggymetrics • Formed two teams of 6 people to “learn” microservices • We used: • Spring Boot • Eureka • Config Service • ELK • API gateway • Identity server • Kafka • Rancher • Simple CI/CD pipelines • Running ON PREMISE (PROD) • AWS for DEV • We designed the system with a lot of events • Almost everything runs on docker
  6. What happened next? • Environments are not stable, moving development

    on cloud and production on premise is a big problem. • Infrastructure provisioning • Security • CI/CD • …. • Quality is not good, we were focus on delivery more than quality • Frontend teams complained about the contract changes… • Core services are not stable • Security requirements are coming… • More services mean more bug and “conflicts” • Deployment time increase with the number of services
  7. What are the problems? • Dev on cloud and run

    production on-premise just does not work! • Business, senior managers and PMs need to understand and support the team(quality matter!) • Devops and automation • Team structure is not optimized for microservices (Conwey’s law) • Delivery over Engineering • Everything run on docker • Lack of security • Trouble shooting is extremely time cosumming • Operation was not consider as important as it should (DR, No down time deployment…)
  8. What would we have prepared? • Devops devops and devops(tooling,

    infrastructure as code) • Technical skillset (bash, CI/CD, cloud, languages flexibility) • Automation testing • Use managed services when possible e.g. use RDS instead of setting up your own DB cluster… • Full CI/CD, no manual deployment, minimize human mistakes • Design for failure • Run services not build services
  9. What would we have prepared? • Team structure for microservices

    • Change is the only constant, prepare for that • Security built-in to the CI/CD pipelines • Deploy heavy services on host for better performance • Monitoring goes first • Services versioning • Blue/Green, Canary release
  10. Suggestions • CI/CD : TeamCity, Jenkin, GoCD, Bamboo… • Infrastructure

    as code: Terraform, Puppet, Chef, Ansible… • Testing: Unit Test, Contract Test, Integration Test… • Docker Registry, Artifactory, SonarQube… • Cross cutting concerns: Headers, logging pattern, correlation id… • Centralizes logging: ELK, Splunk, Datadog…
  11. Suggestions • Monitoring: Prometheus + Grafana, AppDynamic, NewRelic… • Orchestration

    tool: Rancher 2.x, K8s, Mesos, PCF… • Platform feature teams: API, Devops , Automation… • If possible, go for Service Mesh • Istio • Linkerd • Chaos Engineering and Site Reliability Engineering
  12. Do you really need microservices • NO • If you

    don’t have that much users • Have not prepared tooling, skillset as well as support from top managers • Have not really seen the benefit of microservices link to your business • It is okay to do SOA if you have a good level of testing, CI/CD and engineering practices • YES • You have a large number of customers • Your services need to scale significantly • You have all the tooling and skillset required • Support and understanding from top managers
  13. What to read • InfoQ.com • Building Microservice, Sam Newman

    • Microservice Patterns : With examples in Java, Chris Richardson