SlideShare uma empresa Scribd logo
1 de 34
Best Practices for Serverless
Microservice Architecture and Design
Josh Weaver
Software Engineer at LendingTree
1. What is a microservice and why is it useful?
2. Are microservices right for your application?
3. What are some common microservice architectures and
design patterns?
4. What are some best practices for microservice
architecture and design?
5. Why use serverless microservices?
–Sam Newman
“Small Autonomous (independently deployable)
Services that work together, modeled around a
business domain.”
credit: Sam Newman
Principles of Microservices
• Isolate Failure
• The failure of a single service should not impact any
others
• Security breaches can be isolated this way also
Principles of Microservices
• Highly Observable
• Each service should have easily readable logs and
alarms
Principles of Microservices
• Modeled Around Business Domain
• Products should be handled separately from Users etc
Users
Products
Inventory
Shipping
Principles of Microservices
• Culture of Automation
• Automated Testing
• Continuous Delivery
Principles of Microservices
• Hide The Implementation Details
• A database should be specific to a service and only
accessible by that service
• A common way to access the service, a simple api call
usable by front or backend
• Language agnostic
• Users shouldn’t see any difference in use
Principles of Microservices
• Decentralize Everything
• Monoliths always require the entire application
• Microservices are packaged separately and can be
deployed with or without the rest of the application
• Microservices cannot only be deployed independently,
but they can be scaled independently as well
Principles of Microservices
• Deploy Independently
• Each service should be completely self contained and
deployable
• Deploying a single service should not affect or be
affected by the deployment of other services
Benefits of Microservices
• Decreased coupling of services
• Failure isolation
• Simplified security (isolated breaches)
• Can code services in different languages***
• Ease in changing and adding functionality at any time
• Highly scalable and reusable
• Overall system architecture can emerge over time through refactoring
• Reduced need for upfront system design
• Allows for early and continuous deployment
• Independent (autonomous) teams/projects and faster deployment cycles
Uber’s Monolith vs SOA Architechture
Potential Drawbacks of Microservices
• Complexity in interaction of services
• To work well, teams/projects require more independence
and empowerment in technical decision making
• Organization and initial deployment can be complex
• More HTTP calls and network latency
Other Considerations with Microservices
• Migrating from a monolith architecture is expensive in time
and resources
• The best time to make the switch is when other large
infrastructure changes are necessary
• It may be useful and possible to start by creating new or
updated services as microservices
Are Microservices Right for Your Application?
• Are you currently maintaining a large monolithic
application with a modern stack?
• Are you maintaining a large monolith with an outdated or
end of life stack?
• Are you planning to make big changes to your stack to
your large application?
• Are you planning a small scale application?
• Are you planning a small scale application that will grow?
• Are you planning to build a large scale application?
Are Microservices Right for Your Application?
• Startups might benefit massively from microservices if
they are building an application that might grow.
• Microservices can also be a very inexpensive option for
low budget projects.
How You Can Get Started
• Your company wants to add a new feature
• An AI chat service
• An Alexa Skill
• A messaging service for account information
• A twitter bot for promoting company blog posts
• All great opportunities to get started with microservices
that can be used alongside your current infrastructure
• You don’t need to start by converting your entire stack!
Still Not Convinced?
microservices.io/articles/whoisusingmicroservices.html
Basic Microservice Architecture
Microservice Architecture: Web App
Microservice Architecture: Mobile Backend
Microservice Architecture: Tweet Leaderboard
Microservice Architecture: Image Resizing
Microservice Architecture Principles
• Reduce Inertia
• Choices should favor rapid feedback with reduced
dependencies between teams
• Eliminate Accidental Complexity
• Replace processes, systems, and integrations that are
overly complex; focus on essentials for each service
• Consistent Data Flows
• Eliminate duplication of data by having a single service
access any given part
Best Practices for Microservice Design
• Structuring applications can be tricky
• Designing microservices should be simple
• Design around business logic
• Each major component should be its own service
• e.g. Users should be handled independently of Products
• Let the features guide the design
Best Practices for Microservice Design
User
Interface
API
Gateway
Log In/Auth
User
Account
Products Inventory
Checkout/
Payment
Messaging can be used for
interactions between services
Best Practices for Microservice Design
Why Serverless for Microservices?
• No Administration! No instances or operating systems, just
deploy your code.
• Auto-scaling: Service providers manage scaling challenges.
Lulls or bursts? Don’t worry about it!
• Pay for what you use: with functions as a service, you pay for
the compute time you use and nothing else. This can lead to
big cost savings.
• Increased velocity: easy deployments and no need to
provision instances means fast turnaround from idea to
service
Focus on Your Business Logic,
Not Your Servers
Why Serverless for Microservices?
• The Serverless CLI provides tremendous simplification to
serverless build, test, and deployment
• Avoid vendor lock-in, Serverless can deploy to any cloud
provider (or all of them at the same time)
• Serverless is widely used, has a lot of resources, and a lot
of plugins (Serverless Offline FTW!)
Serverless for Microservices Example
• github.com/joshweaver23
More Resources
• Building Microservices - Sam Newman
• aws.amazon.com/lambda/
• aws.amazon.com/serverless/
• serverless.com
• github.com/anaibol/awesome-serverless
• github.com/joshweaver23/microservices
Shameless Plug
• LendingTree is Hiring!
• Charlotte: C#, .NET
• Charleston: Node.js, AWS
• Interested? Talk to me (or Jay Ivanov) now or have a beer
with me at happy hour!
Thanks!
• Josh Weaver
• Lending Tree
• linkedin.com/in/joshweaver23/
• github.com/joshweaver23
• github.com/joshweaver23/microservices

Mais conteúdo relacionado

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Último (20)

04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 

Destaque

Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Saba Software
 
Introduction to C Programming Language
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming Language
Simplilearn
 

Destaque (20)

How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
 
Introduction to C Programming Language
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming Language
 

Best Practices for Serverless Microservice Architecture and Design

  • 1. Best Practices for Serverless Microservice Architecture and Design Josh Weaver Software Engineer at LendingTree
  • 2. 1. What is a microservice and why is it useful? 2. Are microservices right for your application? 3. What are some common microservice architectures and design patterns? 4. What are some best practices for microservice architecture and design? 5. Why use serverless microservices?
  • 3. –Sam Newman “Small Autonomous (independently deployable) Services that work together, modeled around a business domain.”
  • 5. Principles of Microservices • Isolate Failure • The failure of a single service should not impact any others • Security breaches can be isolated this way also
  • 6. Principles of Microservices • Highly Observable • Each service should have easily readable logs and alarms
  • 7. Principles of Microservices • Modeled Around Business Domain • Products should be handled separately from Users etc Users Products Inventory Shipping
  • 8. Principles of Microservices • Culture of Automation • Automated Testing • Continuous Delivery
  • 9. Principles of Microservices • Hide The Implementation Details • A database should be specific to a service and only accessible by that service • A common way to access the service, a simple api call usable by front or backend • Language agnostic • Users shouldn’t see any difference in use
  • 10. Principles of Microservices • Decentralize Everything • Monoliths always require the entire application • Microservices are packaged separately and can be deployed with or without the rest of the application • Microservices cannot only be deployed independently, but they can be scaled independently as well
  • 11. Principles of Microservices • Deploy Independently • Each service should be completely self contained and deployable • Deploying a single service should not affect or be affected by the deployment of other services
  • 12. Benefits of Microservices • Decreased coupling of services • Failure isolation • Simplified security (isolated breaches) • Can code services in different languages*** • Ease in changing and adding functionality at any time • Highly scalable and reusable • Overall system architecture can emerge over time through refactoring • Reduced need for upfront system design • Allows for early and continuous deployment • Independent (autonomous) teams/projects and faster deployment cycles
  • 13. Uber’s Monolith vs SOA Architechture
  • 14. Potential Drawbacks of Microservices • Complexity in interaction of services • To work well, teams/projects require more independence and empowerment in technical decision making • Organization and initial deployment can be complex • More HTTP calls and network latency
  • 15. Other Considerations with Microservices • Migrating from a monolith architecture is expensive in time and resources • The best time to make the switch is when other large infrastructure changes are necessary • It may be useful and possible to start by creating new or updated services as microservices
  • 16. Are Microservices Right for Your Application? • Are you currently maintaining a large monolithic application with a modern stack? • Are you maintaining a large monolith with an outdated or end of life stack? • Are you planning to make big changes to your stack to your large application? • Are you planning a small scale application? • Are you planning a small scale application that will grow? • Are you planning to build a large scale application?
  • 17. Are Microservices Right for Your Application? • Startups might benefit massively from microservices if they are building an application that might grow. • Microservices can also be a very inexpensive option for low budget projects.
  • 18. How You Can Get Started • Your company wants to add a new feature • An AI chat service • An Alexa Skill • A messaging service for account information • A twitter bot for promoting company blog posts • All great opportunities to get started with microservices that can be used alongside your current infrastructure • You don’t need to start by converting your entire stack!
  • 25. Microservice Architecture Principles • Reduce Inertia • Choices should favor rapid feedback with reduced dependencies between teams • Eliminate Accidental Complexity • Replace processes, systems, and integrations that are overly complex; focus on essentials for each service • Consistent Data Flows • Eliminate duplication of data by having a single service access any given part
  • 26. Best Practices for Microservice Design • Structuring applications can be tricky • Designing microservices should be simple • Design around business logic • Each major component should be its own service • e.g. Users should be handled independently of Products • Let the features guide the design
  • 27. Best Practices for Microservice Design User Interface API Gateway Log In/Auth User Account Products Inventory Checkout/ Payment Messaging can be used for interactions between services
  • 28. Best Practices for Microservice Design
  • 29. Why Serverless for Microservices? • No Administration! No instances or operating systems, just deploy your code. • Auto-scaling: Service providers manage scaling challenges. Lulls or bursts? Don’t worry about it! • Pay for what you use: with functions as a service, you pay for the compute time you use and nothing else. This can lead to big cost savings. • Increased velocity: easy deployments and no need to provision instances means fast turnaround from idea to service Focus on Your Business Logic, Not Your Servers
  • 30. Why Serverless for Microservices? • The Serverless CLI provides tremendous simplification to serverless build, test, and deployment • Avoid vendor lock-in, Serverless can deploy to any cloud provider (or all of them at the same time) • Serverless is widely used, has a lot of resources, and a lot of plugins (Serverless Offline FTW!)
  • 31. Serverless for Microservices Example • github.com/joshweaver23
  • 32. More Resources • Building Microservices - Sam Newman • aws.amazon.com/lambda/ • aws.amazon.com/serverless/ • serverless.com • github.com/anaibol/awesome-serverless • github.com/joshweaver23/microservices
  • 33. Shameless Plug • LendingTree is Hiring! • Charlotte: C#, .NET • Charleston: Node.js, AWS • Interested? Talk to me (or Jay Ivanov) now or have a beer with me at happy hour!
  • 34. Thanks! • Josh Weaver • Lending Tree • linkedin.com/in/joshweaver23/ • github.com/joshweaver23 • github.com/joshweaver23/microservices