SlideShare ist ein Scribd-Unternehmen logo
1 von 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

Weitere ähnliche Inhalte

Kürzlich hochgeladen

Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
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 AutomationSafe Software
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
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 WorkerThousandEyes
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 

Kürzlich hochgeladen (20)

Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
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
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
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
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 

Empfohlen

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 2024Albert Qian
 
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 InsightsKurio // The Social Media Age(ncy)
 
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 2024Search Engine Journal
 
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 summarySpeakerHub
 
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 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 Tessa Mero
 
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 IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
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 managementMindGenius
 
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...RachelPearson36
 
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...Applitools
 
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 WorkGetSmarter
 
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...DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationErica Santiago
 
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 wellSaba Software
 
Introduction to C Programming Language
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming LanguageSimplilearn
 

Empfohlen (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