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.

Building data-driven microservices

291 views

Published on

Dr. Karthik Ramasamy of Streamlio draws on his experience building data products at companies including Pivotal, Twitter, and Streamlio to discuss technology and best practices for designing and implementing data-driven microservices:
* The key principles of microservices and microservice architecture
* The implications of microservices for data
* The role of messaging and processing technology in connecting microservices

Published in: Software
  • I have always found it hard to meet the requirements of being a student. Ever since my years of high school, I really have no idea what professors are looking for to give good grades. After some google searching, I found this service ⇒ www.HelpWriting.net ⇐ who helped me write my research paper. The final result was amazing, and I highly recommend ⇒ www.HelpWriting.net ⇐ to anyone in the same mindset as me.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Building data-driven microservices

  1. 1. February 22, 2018 Building Data-Driven Microservices
  2. 2. Karthik Ramasamy Database and real-time architect at Greenplum, Locomatix, Twitter Co-creator of Heron real-time engine Co-founder, Streamlio @karthikz Today’s presenter
  3. 3. • Understanding microservices • Best practices for connecting microservices • Approaches to microservices design • Streamlio technology and approach Agenda
  4. 4. Understanding microservices
  5. 5. Comparison: “Monolith” vs “Microservices” Monolith Puts all functionality into a single process Scales by replicating monolith across nodes Microservices Each element of functionality in a different service Scales by distributing & replicating each service across nodes
  6. 6. Challenges with monolithic software Difficult to scale Long Build/ Test/Release Cycles Operations nightmares Architecture is hard to maintain and evolve New releases take months Long time to add new features Lack of agility Lack of Innovation
  7. 7. Anatomy of a microservice Data Store (e.g) Postgres, Cassandra Application/ Logic code, libraries, etc, POST GET Public API
  8. 8. Connecting microservices
  9. 9. Comparison Monolithic • Most connections internal to application • Limited external connections • Internal connections loosely defined Microservices • Most connections external • Greater stability of connection interfaces required
  10. 10. Breaking the “monolith” Structure application as a set of loosely coupled, collaborating services Services communicate using synchronous or asynchronous protocols Services can be developed and deployed independent of one another Each service has its own database in order to be decoupled from other services
  11. 11. • Decompose by use case and define services that are responsible for particular actions (e.g) a shipping service responsible for shipping complete orders • Decompose by resources by defining a service that is responsible for all operations on entities/resources of a given type (e.g. account service that is responsible for managing user accounts) Decomposing into services Option 1 Option 2
  12. 12. Approaches to microservices
  13. 13. • Takes orders from customers • Verifies inventory • Checks credit • Ships the order E-Commerce application (monolithic architecture) Inventory Shipping Account API Gateway Webfront UI
  14. 14. Approaches to micro services Heavyweight services Single queue per service Shared queue across services Streamlio platform approach 1 2 3 4
  15. 15. Approach 1: Heavyweight services Inventory micro-service Shipping micro-service Account micro-service API Gateway Webfront UI
  16. 16. Approach 1: Pros and cons Inventory micro-service Shipping micro-service Account micro-service API Gateway Webfront UI Pros • End-to-end service ownership with the team Cons • Gateway has to manage connections to services • Possible diverse connection types - makes coordination harder • Heavy weight processing still happens in the gateway
  17. 17. Approach 2: Single queue per service Inventory micro-service Shipping micro-service Account micro-service API Gateway Webfront UI Queue Queue Queue
  18. 18. Inventory micro-service Shipping micro-service Account micro-service API Gateway Webfront UI Queue Queue Queue Approach 2: Pros and cons Pros • e2e service ownership with the team • Single connection type to message queue Cons • Heavy weight processing still happens at the gateway • One message queue cluster per service • Too many message queue clusters to manage • Messaging expertise needed for every team • More complex and expensive to manage
  19. 19. Approach 3: Shared queue across services Inventory micro-service Shipping micro-service Account micro-service API Gateway Webfront UI Message Queue
  20. 20. Approach 3: Pros and cons Inventory micro-service Shipping micro-service Account micro-service API Gateway Webfront UI Message Queue Pros • Single message cluster shared across multiple teams • No messaging expertise needed per team Cons • Heavy weight processing still happens at the gateway • Messaging cluster has to scale for several services • Without isolation capabilities, contention across teams
  21. 21. Streamlio approach
  22. 22. Key technologies Orchestration Messaging Storage Process communicate and pass information among services transform, aggregate and enrich data flow save state for micro- services, calculations and message replay schedule, run, scale up and scale down microservices Microservices
  23. 23. Interfaces APIs Libraries & Connectivity Streamlio platform Real-time processing Messaging & queuing Stream storage ConnectorsClientData SourceStormKafka Functional Management Resource Management Metadata Security Monitoring Orchestration Powered by Powered by Powered by
  24. 24. Built on proven open-source technology • Deployed in production for 3+ years at Yahoo • Handling >2M topics • Processing >100B messages / day • Deployed across 8 datacenters globally • Deployed in production at Twitter for 2+ years • Used by ~50 teams • Processing >2T events, >20 PB / day • In production at Twitter, Yahoo, Salesforce, Huawei • Processing >1.5T records, >15PB / day at Yahoo
  25. 25. Using Streamlio to tie together microservices Inventory micro-service Shipping micro-service Account micro-service API Gateway Webfront UI Requests/ Responses Requests/ Responses
  26. 26. Streamlio approach: Advantages • Single platform shared across multiple teams • Single platform provides messaging, compute and storage capabilities • No heavy weight processing at the gateway - offloaded to platform • Single platform can scale to 1000’s of microservices • Isolation capabilities for each team to manage their service in the platform • Enterprise class features builtin - resilient, self healing, security, data protection • Ease of operations thereby reducing total cost of ownership
  27. 27. Using Streamlio for multiple applications API Gateway Requests/ Responses Application 1 Application 2 Application 3
  28. 28. Using Streamlio across data centers API Gateway Requests/ Responses Application 1 Application 2 API Gateway Requests/ Responses Application 1 Application 2
  29. 29. Karthik Ramasamy Cofounder Streamlio @karthikz Q&A
  30. 30. • Microservices • Video Series: “Microservices: perceptions and myths” (streaml.io/blog) • Streamlio • Streamlio Solution Brief: streaml.io/ resources • Intro to Apache Pulsar: streaml.io/ product/messaging How to learn more

×