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.

.NET Fest 2019. Dan Patrascu-Baba. Microservices from the trenches. When buzzwords don’t make your application work

49 views

Published on

“Microservices” is certainly a buzzword. Everybody wants to work on microservices applications. However when working on such a project you’ll soon realize that a buzzword doesn’t magically make your application work. And there will be a lot of challenges that you’ll face on this journey. During this session I will share my experience from the trenches of a microservices project aiming to make developers aware of the different challenges you’ll mostly won’t see at conferences. I will also try to illustrate my experiences with relevant code samples.

Published in: Education
  • Get Now to Download PDF Format === http://bestadaododadj.justdied.com/B01LYQTJM8-dan-et-celia-les-jumeaux-d-autremonde.html
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Be the first to like this

.NET Fest 2019. Dan Patrascu-Baba. Microservices from the trenches. When buzzwords don’t make your application work

  1. 1. Тема доклада Тема доклада Тема доклада KYIV 2019 Dan Patrascu-Baba Microservices from the trenches .NET CONFERENCE #1 IN UKRAINE
  2. 2. Тема доклада Тема доклада Тема доклада .NET LEVEL UP .NET CONFERENCE #1 IN UKRAINE KYIV 2019 Dan Patrascu-Baba BIO: Software developer @Amdaris, Founder @Codewrinkles, Co-organizer @ApexVox Blog: http://danpatrascu.com Twitter: @danpdc
  3. 3. Тема доклада Тема доклада Тема доклада .NET LEVEL UP Agenda .NET CONFERENCE #1 IN UKRAINE KYIV 2019 • Microservices architecture overview • The project • Lessons learned: Decomposing services Messaging The API gateway • Conclusions
  4. 4. Тема доклада Тема доклада Тема доклада .NET LEVEL UP .NET CONFERENCE #1 IN UKRAINE KYIV 2019 Microservices architecture
  5. 5. Тема доклада Тема доклада Тема доклада .NET LEVEL UP Possible app architecture .NET CONFERENCE #1 IN UKRAINE KYIV 2019
  6. 6. Тема доклада Тема доклада Тема доклада .NET LEVEL UP Services are… .NET CONFERENCE #1 IN UKRAINE KYIV 2019 • small in size • messaging enabled • bounded by contexts • autonomously developed • independently deployable • decentralized • built and released with automated processes
  7. 7. Тема доклада Тема доклада Тема доклада .NET LEVEL UP Benefits .NET CONFERENCE #1 IN UKRAINE KYIV 2019 • Scalability • Agility • Availability • Innovation
  8. 8. Тема доклада Тема доклада Тема доклада .NET LEVEL UP Drawbacks? .NET CONFERENCE #1 IN UKRAINE KYIV 2019 Let's discuss them at the end :)
  9. 9. Тема доклада Тема доклада Тема доклада .NET LEVEL UP The project .NET CONFERENCE #1 IN UKRAINE KYIV 2019 • The customer is a provider of integrated systems for Contact Centers • Rich application ecosystem • Goal: Rebuild the Time and Attendance solution to meet modern software architecture standards and business needs • How? Use Microservices architecture
  10. 10. Тема доклада Тема доклада Тема доклада .NET LEVEL UP .NET CONFERENCE #1 IN UKRAINE KYIV 2019 Lessons learned: 1. Scoping / decomposing services
  11. 11. Тема доклада Тема доклада Тема доклада .NET LEVEL UP Decomposing models .NET CONFERENCE #1 IN UKRAINE KYIV 2019 • By business capability and define services corresponding to business capabilities • By DDD bounded contexts • By verb or use case and define services that are responsible for particular actions. e.g. a Shipping Service that’s responsible for shipping complete orders • By nouns or resources by defining a service that is responsible for all operations on entities/resources of a given type. e.g. an Account Service that is responsible for managing user accounts
  12. 12. Тема доклада Тема доклада Тема доклада .NET LEVEL UP Issues .NET CONFERENCE #1 IN UKRAINE KYIV 2019 • How to identify the bounded contexts? • How to identify business capabilities? • Which decomposition model is suitable for a given scenario? • Is it really possible to decompose everything in a meaningful way following only one model?
  13. 13. Тема доклада Тема доклада Тема доклада .NET LEVEL UP .NET CONFERENCE #1 IN UKRAINE KYIV 2019 DEMO: Decomposing services
  14. 14. Тема доклада Тема доклада Тема доклада .NET LEVEL UP .NET CONFERENCE #1 IN UKRAINE KYIV 2019 Lessons learned: 2. Messaging
  15. 15. Тема доклада Тема доклада Тема доклада .NET LEVEL UP Issues .NET CONFERENCE #1 IN UKRAINE KYIV 2019 • A microservices architecture is all about communication • How should services communicate in any given business scenario? • Should they call each other synchronously? • Should they communicate via asynchronous messaging? • What are the pros and cons of the chosen message brokering technology?
  16. 16. Тема доклада Тема доклада Тема доклада .NET LEVEL UP Communication patterns .NET CONFERENCE #1 IN UKRAINE KYIV 2019 Synchronous Calls if: • we want to query some data, because a query is not changing any state so we don’t have to worry about distributed transactions and data consistency across service boundaries • the call is allowed to fail and we don’t need a sophisticated retry mechanism Simple Messaging if: we want to send state-changing commands • the operation must be performed eventually, even if it fails the first couple times • we don’t care about potentially complex message structure Transactional Messaging if: • we want to send state-changing commands only when the local database transaction has been successful
  17. 17. Тема доклада Тема доклада Тема доклада .NET LEVEL UP Message broker concepts .NET CONFERENCE #1 IN UKRAINE KYIV 2019 • Producer - User application that sends messages to an exchange. • Exchange - Pushes messages into queues. Exchange types define what to do with the message when it’s received, whether. appended to a one queue, to many queues, or discarded. Example exchange types are direct, topic and fanout. • Queue - Each exchange contains a buffer, or queue, that stores messages. A queue is only bound by the host’s memory & disk limits, it’s essentially a large message buffer. Many producers can send messages that go to one queue, and many consumers can try to receive data from one queue. • Consumer - User application that receives messages.
  18. 18. Тема доклада Тема доклада Тема доклада .NET LEVEL UP .NET CONFERENCE #1 IN UKRAINE KYIV 2019 DEMO: Messaging infrastructure
  19. 19. Тема доклада Тема доклада Тема доклада .NET LEVEL UP .NET CONFERENCE #1 IN UKRAINE KYIV 2019 Lessons learned: 3. The API gateway
  20. 20. Тема доклада Тема доклада Тема доклада .NET LEVEL UP What should an API gateway do? .NET CONFERENCE #1 IN UKRAINE KYIV 2019 • Proxying • Service discovery • Response aggregation • Header translation • Protocol translation • Load balancing • Authorization • Rate limiting
  21. 21. Тема доклада Тема доклада Тема доклада .NET LEVEL UP Available options .NET CONFERENCE #1 IN UKRAINE KYIV 2019 • All the major cloud providers offer such services • Kubernetes has such a functionality Drawbacks • Technology debt • Additional complexity when setting up environments • Not very flexible
  22. 22. Тема доклада Тема доклада Тема доклада .NET LEVEL UP A possible solution in the .NET world… .NET CONFERENCE #1 IN UKRAINE KYIV 2019 • Meets all discussed requirements • Easy to configure • Can be extended with own functionality
  23. 23. Тема доклада Тема доклада Тема доклада .NET LEVEL UP .NET CONFERENCE #1 IN UKRAINE KYIV 2019 DEMO: Ocelot
  24. 24. Тема доклада Тема доклада Тема доклада .NET LEVEL UP Conclusions .NET CONFERENCE #1 IN UKRAINE KYIV 2019 • A microservices architecture adds a lot of complexity that we might tend to oversea in the planning phase • Are the benefits really outnumbering the complexities? • A microservices architecture is not only about software architecture, but also about the organization and how teams are set up
  25. 25. Тема доклада Тема доклада Тема доклада .NET LEVEL UP .NET CONFERENCE #1 IN UKRAINE KYIV 2019 Before deciding on going for a microservices architecture try to ask yourself if it’s worth
  26. 26. Тема доклада Тема доклада Тема доклада .NET LEVEL UP .NET CONFERENCE #1 IN UKRAINE KYIV 2019 Questions?
  27. 27. Тема доклада Тема доклада Тема доклада .NET LEVEL UP .NET CONFERENCE #1 IN UKRAINE KYIV 2019 Thank you!

×