Diese Präsentation wurde erfolgreich gemeldet.
Die SlideShare-Präsentation wird heruntergeladen. ×

Building microservices web application using scala & akka

Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Wird geladen in …3
×

Hier ansehen

1 von 51 Anzeige

Weitere Verwandte Inhalte

Diashows für Sie (20)

Andere mochten auch (20)

Anzeige

Ähnlich wie Building microservices web application using scala & akka (20)

Aktuellste (20)

Anzeige

Building microservices web application using scala & akka

  1. 1. Building microservices web application using Scala & Akka Grokking Engineering, March 2015 Binh Nguyen - Anduin Transactions, Inc. March 21st, 2015 HCMC
  2. 2. Introduction: Who? Engineer at-large with strong interest in engineering processeses. 2
  3. 3. Who? August 2014 - now Anduin Transactions 3
  4. 4. Who? 4 Palantir Technologies 2011-2014
  5. 5. Who? 5
  6. 6. What? ● What is µ-services architecture? pros and cons ● Why Anduin µ-services? ● How can Akka & Scala help? 6
  7. 7. The world before microservices 7
  8. 8. Monolithic vs microservices 8
  9. 9. Monolithic problems ● Complexity 9
  10. 10. Monolithic problems ● Complexity ● Conway’s law => silos 10
  11. 11. Monolithic problems ● Complexity ● Conway’s law => silos ● Modules development speed 11
  12. 12. Monolithic problems ● Complexity ● Conway’s law => silos ● Modules development speed ● Dependencies collision 12
  13. 13. Monolithic problems ● Complexity ● Conway’s law => silos ● Modules development speed ● Dependencies collision ● Deployment 13
  14. 14. Monolithic problems ● Complexity ● Conway’s law => silos ● Modules development speed ● Dependencies collision ● Deployment 14
  15. 15. Can it be fixed? 15
  16. 16. So what’s microservices? Microservices The term "Microservice Architecture" has sprung up over the last few years to describe a particular way of designing software applications as suites of independently deployable services. While there is no precise definition of this architectural style, there are certain common characteristics around organization around business capability, automated deployment, intelligence in the endpoints, and decentralized control of languages and data. Martin Fowler http://martinfowler.com/articles/microservices.html 16
  17. 17. So what’s microservices? “complex applications are composed of small, independent processes communicating with each other using language-agnostic APIs” Wikipedia 17
  18. 18. Some key takeaways ● should be something one developer can fit in their head 18
  19. 19. Some key takeaways ● Can fit in one developer head ● One developer should be able to independently produce 19
  20. 20. Some key takeaways ● Can fit in one developer head ● One developer should be able to independently produce ● One "verb" (single concern/function, not GET/PUT/DELETE) per microservice 20
  21. 21. Some key takeaways ● Can fit in one developer head ● One developer should be able to independently produce ● One "verb" (single concern/function, not GET/PUT/DELETE) per microservice ● Should be possible to deploy in a container 21
  22. 22. Some key takeaways ● Can fit in one developer head ● One developer should be able to independently produce ● One "verb" (single concern/function, not GET/PUT/DELETE) per microservice ● Should be possible to deploy in a container ● Can be upgraded independently 22
  23. 23. So...what is microservices? 23
  24. 24. Microservices challenges 24
  25. 25. So why chasing that unicorn? 25
  26. 26. So why chasing that unicorn? 26 Iteration speed
  27. 27. So why chasing that unicorn? 27 Engineers autonomy
  28. 28. 28
  29. 29. So why chasing that unicorn? 29 More tools available = it’s not too bad
  30. 30. Summary - microservices ● Microservices is challenging ● ...But worths it (in my view) ● Modern tools like Amazon AWS, Docker, Deis, CoreOS, Kubenettes, Ansible, Akka, … help a lot! 30
  31. 31. So...programming language? 31
  32. 32. Obligatory joke on language war 32
  33. 33. Node.js/Vert.x/Meteor 33
  34. 34. Go ● Readability over everything else ● Battery included ● Google ● Easy to pick up ● A bit of niche feel (more system oriented) ● No Type safety ● Some problems with cross OSs compiling 34
  35. 35. OK, more serious choice: Java 35
  36. 36. OK, more serious choice: Java 36
  37. 37. Java: Multithreaded programming 37 In Theory
  38. 38. Java: Multithreaded programming 38 In Practice
  39. 39. Java: Lack of functional and Immutability 39
  40. 40. Clojure My personal favorite language ● Simple but no simpler ● Lisp ● Rich Hickey & the likes ● ClojureScript ● Weak libraries ● Dynamic typing 40
  41. 41. Scala: Very complicated 41
  42. 42. Scala: Long time to master 42
  43. 43. Akka = Actor model ● One of the biggest reason for choosing Scala! 43 Concurrent and distributed programming done right
  44. 44. Akka’s “cool kids” club! ● Apache Spark ● Apache Kafka ● Apache Samza ● Spray ● …. 44
  45. 45. Akka Remote Actor and Clustering ● Location transparency ● Distributed by default (beware: Fallacies of distributed computing) 45
  46. 46. Akka Persistence ● Actor state snapshot for easier recovery ● Event sourcing 46
  47. 47. Akka reactive streaming Data flow at the same speed as the slowest link to prevent buffer blows up. 47
  48. 48. Akka: built for modern web ● Akka http 2.0 ● Akka websocket ● Akka webRTC 48
  49. 49. Conclusion: Scala & Akka 49
  50. 50. 50
  51. 51. 51

×