SlideShare una empresa de Scribd logo
1 de 29
Descargar para leer sin conexión
SERVICE-ORIENTED
ARCHITECTURE
By Samantha Geitz
LET’STALK ABOUT A PROJECT
(A HYPOTHETICAL ONE)
THE API ENGINEER
THE PROJECT
SOUNDS SIMPLE, RIGHT?
LET’S DO IT IN LARAVEL!
THE ENTITIES
• Users
• Admins
• Shirts
• Images
• Orders
• Shipping
• Payment Methods
• (Blog) posts
• Comments
• Mugs
• Laptop Stickers
• 3rd-party prices
• Search indexing
• Customer Service
• Reviews
• Videos
• ???
• 16 entities means (at minimum):
• 16-22 database tables
• 80-160 classes
• 800-1600+ unit tests
• A routes file that makes you want to
throw your computer out of a window
AND IF SOMETHING BREAKS,
IT ALL GOES DOWN
THIS IS A
MONOLITH
Keep building on top
of the project you
already have
SO WHAT IS
SERVICE-ORIENTED
ARCHITECTURE?
Lots of little separate
pieces (that talk to
each other when they
need to)
BOTH APPROACHES HAVE
THEIR PROS AND CONS
Just don’t do this
LET’S LOOK ATTHIS AGAIN
• Users
• Admins
• Shirts
• Images
• Orders
• Shipping
• Payment Methods
• (Blog) posts
• Comments
• Mugs
• Laptop Stickers
• 3rd-party prices
• Search indexing
• Customer Service
• Reviews
• Videos
• ???
SO WHAT MIGHTTHIS LOOK
LIKE USING SOA?
• Users
• Admins
Users API
• Shirts
• Images
• Mugs
• Laptop Stickers
• Reviews
Products API
• (Blog) posts
• Comments
• Videos
News API Orders API
• Orders
• Payment
Methods
• Customer
Service
• Shipping
Price Collector
• Price collecting
• Add prices to
product API
Search API
• Search indexing
• Search results
MICROSERVICES
• APIs organized around business capability /
function
• Only call other APIs when needed
• Single-responsibility principle
THE GOOD!
• Less code = easier to onboard new developers
• Fewer merge conflicts
• Easier to make changes and upgrades
• Improved fault isolation
• Running the test suite is far quicker
• Easier to scale and load-balance servers
THE BAD :(
• Deployment / Dev Ops complexity
• Cost
• Time investment for new microservices
• Shared code between projects can be a hassle
• More planning required
SO HOW DO I ACTUALLY
BUILD USING SOA?
LARAVELVS. LUMEN
• Lumen is great if you are building:
• APIs
• Small worker services (such as the search indexer)
• Use Laravel if:
• You don’t want to manually install front-end niceties like Elixir or
Bootstrap
• You know you’ll be using packages that don’t support Lumen
• You want/need Symfony’s more powerful routing component
• You’ve never built a Laravel application before
MAKINGYOUR
MICROSERVICES PLAY NICE
• Build APIs with a standard formatting schema
• JSON API / JSend / Other — just be consistent!
• Standardize HTTP codes / errors
• APIs call ONLY the endpoints they need using cURL or Guzzle
• Front-end clients (JavaScript application or Laravel project with
Blade templates) call endpoints they need
EXAMPLE
• Order API needs user info to print shipping label
• Send GET request to http://user-api.artisanalswag.com/
api/v1/user/{id} with user ID
• Check for API response
• If 200, return user
• If 400 / 404 / 500 / etc., pass along error message
AUTHENTICATION
• A few problems:
• How do you know what user is logged in?
• How do you keep unauthorized users out?
• Can you share session data? Should you?
USE OAUTH2!
• Authentication should be *stateless*
• You send user credentials to an authentication endpoint in User
API (along with client ID and secret)
• User API sends back two things — access token and refresh token
• Access token — short expiration time
• Refresh token — longer expiration time
• You send access token in header with your API requests
• User API confirms access token is still valid
• If access token is expired, the client should
send refresh token instead
• If refresh token is still valid, User API sends new
tokens (and deletes old ones)
• If refresh token is expired, require user to log
in again
SCOPES
• OAuth2 supports scopes (client permissions)
• Different clients can have different scopes
• Use with roles to protect your APIs
LOCAL DEVELOPMENT
• Homestead for local
• All software you need to run Laravel is included
• Same versions as your team / Forge
• List all applications in Homestead.yaml and hosts file
• Database — local or remote?
DEPLOY
• Laravel Forge
• Your Dev Ops guy
• Same cost no matter how many projects
• Taylor Otwell support
• Continuous integration (Travis, Codeship, etc.)
• Envoyer
AREYOU SAYING
MONOLITHS ARE BAD?
No! Do what makes sense for your application.
QUESTIONS?
Twitter: @samanthageitz
Email: samanthamichele7@gmail.com

Más contenido relacionado

La actualidad más candente

Oracle BPEL Presentation
Oracle BPEL PresentationOracle BPEL Presentation
Oracle BPEL Presentationshub54
 
Introduction to Service Oriented Architecture
Introduction to Service Oriented ArchitectureIntroduction to Service Oriented Architecture
Introduction to Service Oriented ArchitectureDATA Inc.
 
Software Evolution: From Legacy Systems, Service Oriented Architecture to Clo...
Software Evolution: From Legacy Systems, Service Oriented Architecture to Clo...Software Evolution: From Legacy Systems, Service Oriented Architecture to Clo...
Software Evolution: From Legacy Systems, Service Oriented Architecture to Clo...PET Computação
 
Introducing SOA and Oracle SOA Suite 11g for Database Professionals
Introducing SOA and Oracle SOA Suite 11g for Database ProfessionalsIntroducing SOA and Oracle SOA Suite 11g for Database Professionals
Introducing SOA and Oracle SOA Suite 11g for Database ProfessionalsLucas Jellema
 
How the WSO2 ESB outperforms other major open source esb vendors
How the WSO2 ESB outperforms other major open source esb vendorsHow the WSO2 ESB outperforms other major open source esb vendors
How the WSO2 ESB outperforms other major open source esb vendorsWSO2
 
Representational State Transfer
Representational State TransferRepresentational State Transfer
Representational State TransferAlexei Skachykhin
 
[WSO2Con EU 2017] Ballerina Connectors for Seamless Integration
[WSO2Con EU 2017] Ballerina Connectors for Seamless Integration[WSO2Con EU 2017] Ballerina Connectors for Seamless Integration
[WSO2Con EU 2017] Ballerina Connectors for Seamless IntegrationWSO2
 
SOA - Unit 2 - Service Oriented Architecture
SOA - Unit   2 - Service Oriented ArchitectureSOA - Unit   2 - Service Oriented Architecture
SOA - Unit 2 - Service Oriented Architecturehamsa nandhini
 
SOA for PL/SQL Developer (OPP 2010)
SOA for PL/SQL Developer (OPP 2010)SOA for PL/SQL Developer (OPP 2010)
SOA for PL/SQL Developer (OPP 2010)Lucas Jellema
 
Mobile Web Network
Mobile Web NetworkMobile Web Network
Mobile Web Networkchenjennan
 
Soa Overview
Soa OverviewSoa Overview
Soa OverviewTerry Cho
 
SOA - Unit 3 - SOA and Web Services
SOA - Unit   3 - SOA and Web ServicesSOA - Unit   3 - SOA and Web Services
SOA - Unit 3 - SOA and Web Serviceshamsa nandhini
 
Web Services Foundation Technologies
Web Services Foundation TechnologiesWeb Services Foundation Technologies
Web Services Foundation TechnologiesPankaj Saharan
 
Web- and Mobile-Oriented Architectures with Oracle Fusion Middleware (OOW 2014)
Web- and Mobile-Oriented Architectures with Oracle Fusion Middleware (OOW 2014)Web- and Mobile-Oriented Architectures with Oracle Fusion Middleware (OOW 2014)
Web- and Mobile-Oriented Architectures with Oracle Fusion Middleware (OOW 2014)Lucas Jellema
 

La actualidad más candente (20)

Oracle BPEL Presentation
Oracle BPEL PresentationOracle BPEL Presentation
Oracle BPEL Presentation
 
Introduction to Service Oriented Architecture
Introduction to Service Oriented ArchitectureIntroduction to Service Oriented Architecture
Introduction to Service Oriented Architecture
 
Software Evolution: From Legacy Systems, Service Oriented Architecture to Clo...
Software Evolution: From Legacy Systems, Service Oriented Architecture to Clo...Software Evolution: From Legacy Systems, Service Oriented Architecture to Clo...
Software Evolution: From Legacy Systems, Service Oriented Architecture to Clo...
 
Introducing SOA and Oracle SOA Suite 11g for Database Professionals
Introducing SOA and Oracle SOA Suite 11g for Database ProfessionalsIntroducing SOA and Oracle SOA Suite 11g for Database Professionals
Introducing SOA and Oracle SOA Suite 11g for Database Professionals
 
Web-Scale Library Management Services (Paul Harvey)
Web-Scale Library Management Services (Paul Harvey)Web-Scale Library Management Services (Paul Harvey)
Web-Scale Library Management Services (Paul Harvey)
 
How the WSO2 ESB outperforms other major open source esb vendors
How the WSO2 ESB outperforms other major open source esb vendorsHow the WSO2 ESB outperforms other major open source esb vendors
How the WSO2 ESB outperforms other major open source esb vendors
 
Web services
Web servicesWeb services
Web services
 
Representational State Transfer
Representational State TransferRepresentational State Transfer
Representational State Transfer
 
[WSO2Con EU 2017] Ballerina Connectors for Seamless Integration
[WSO2Con EU 2017] Ballerina Connectors for Seamless Integration[WSO2Con EU 2017] Ballerina Connectors for Seamless Integration
[WSO2Con EU 2017] Ballerina Connectors for Seamless Integration
 
SOA - Unit 2 - Service Oriented Architecture
SOA - Unit   2 - Service Oriented ArchitectureSOA - Unit   2 - Service Oriented Architecture
SOA - Unit 2 - Service Oriented Architecture
 
SOA for PL/SQL Developer (OPP 2010)
SOA for PL/SQL Developer (OPP 2010)SOA for PL/SQL Developer (OPP 2010)
SOA for PL/SQL Developer (OPP 2010)
 
Soa bpel-123
Soa bpel-123Soa bpel-123
Soa bpel-123
 
Mobile Web Network
Mobile Web NetworkMobile Web Network
Mobile Web Network
 
Web Service Basics and NWS Setup
Web Service  Basics and NWS SetupWeb Service  Basics and NWS Setup
Web Service Basics and NWS Setup
 
Soa Overview
Soa OverviewSoa Overview
Soa Overview
 
SOA - Unit 3 - SOA and Web Services
SOA - Unit   3 - SOA and Web ServicesSOA - Unit   3 - SOA and Web Services
SOA - Unit 3 - SOA and Web Services
 
Soa & Bpel With Web Sphere
Soa & Bpel With Web SphereSoa & Bpel With Web Sphere
Soa & Bpel With Web Sphere
 
Understanding Web services
Understanding Web servicesUnderstanding Web services
Understanding Web services
 
Web Services Foundation Technologies
Web Services Foundation TechnologiesWeb Services Foundation Technologies
Web Services Foundation Technologies
 
Web- and Mobile-Oriented Architectures with Oracle Fusion Middleware (OOW 2014)
Web- and Mobile-Oriented Architectures with Oracle Fusion Middleware (OOW 2014)Web- and Mobile-Oriented Architectures with Oracle Fusion Middleware (OOW 2014)
Web- and Mobile-Oriented Architectures with Oracle Fusion Middleware (OOW 2014)
 

Similar a Service-Oriented Architecture

apidays LIVE Paris 2021 - Lessons from the API Stewardship Journey in Azure b...
apidays LIVE Paris 2021 - Lessons from the API Stewardship Journey in Azure b...apidays LIVE Paris 2021 - Lessons from the API Stewardship Journey in Azure b...
apidays LIVE Paris 2021 - Lessons from the API Stewardship Journey in Azure b...apidays
 
Lessons learned on the Azure API Stewardship Journey.pptx
Lessons learned on the Azure API Stewardship Journey.pptxLessons learned on the Azure API Stewardship Journey.pptx
Lessons learned on the Azure API Stewardship Journey.pptxapidays
 
APIs distribuidos con alta escalabilidad
APIs distribuidos con alta escalabilidadAPIs distribuidos con alta escalabilidad
APIs distribuidos con alta escalabilidadSoftware Guru
 
Escaping the yellow bubble - rewriting Domino using MongoDb and Angular
Escaping the yellow bubble - rewriting Domino using MongoDb and AngularEscaping the yellow bubble - rewriting Domino using MongoDb and Angular
Escaping the yellow bubble - rewriting Domino using MongoDb and AngularMark Leusink
 
Azure Functions Real World Examples
Azure Functions Real World Examples Azure Functions Real World Examples
Azure Functions Real World Examples Yochay Kiriaty
 
Swagger APIs for Humans and Robots (Gluecon)
Swagger APIs for Humans and Robots (Gluecon)Swagger APIs for Humans and Robots (Gluecon)
Swagger APIs for Humans and Robots (Gluecon)Tony Tam
 
Tech Talk on Cloud Computing
Tech Talk on Cloud ComputingTech Talk on Cloud Computing
Tech Talk on Cloud ComputingITviec
 
Building a REST API for Longevity
Building a REST API for LongevityBuilding a REST API for Longevity
Building a REST API for LongevityMuleSoft
 
#SPSNYC 2018 Migrate your custom components to the #SharePoint Framework #SPFX
#SPSNYC 2018 Migrate your custom components to the #SharePoint Framework #SPFX#SPSNYC 2018 Migrate your custom components to the #SharePoint Framework #SPFX
#SPSNYC 2018 Migrate your custom components to the #SharePoint Framework #SPFXVincent Biret
 
(ATS6-DEV02) Web Application Strategies
(ATS6-DEV02) Web Application Strategies(ATS6-DEV02) Web Application Strategies
(ATS6-DEV02) Web Application StrategiesBIOVIA
 
Serverless Meetup - Event Sourcing
Serverless Meetup - Event SourcingServerless Meetup - Event Sourcing
Serverless Meetup - Event SourcingLuca Bianchi
 
Integrate Applications into IBM Connections Cloud and On Premises (AD 1632)
Integrate Applications into IBM Connections Cloud and On Premises (AD 1632)Integrate Applications into IBM Connections Cloud and On Premises (AD 1632)
Integrate Applications into IBM Connections Cloud and On Premises (AD 1632)TIMETOACT GROUP
 
code talks Commerce: The API Economy as an E-Commerce Operating System
code talks Commerce: The API Economy as an E-Commerce Operating Systemcode talks Commerce: The API Economy as an E-Commerce Operating System
code talks Commerce: The API Economy as an E-Commerce Operating SystemAdelina Todeva
 
Build Modern Web Apps Using ASP.NET Web API and AngularJS
Build Modern Web Apps Using ASP.NET Web API and AngularJSBuild Modern Web Apps Using ASP.NET Web API and AngularJS
Build Modern Web Apps Using ASP.NET Web API and AngularJSTaiseer Joudeh
 
API Gateways are going through an identity crisis
API Gateways are going through an identity crisisAPI Gateways are going through an identity crisis
API Gateways are going through an identity crisisChristian Posta
 
Application Insights for Integration Developers
Application Insights for Integration DevelopersApplication Insights for Integration Developers
Application Insights for Integration DevelopersSriram Hariharan
 

Similar a Service-Oriented Architecture (20)

apidays LIVE Paris 2021 - Lessons from the API Stewardship Journey in Azure b...
apidays LIVE Paris 2021 - Lessons from the API Stewardship Journey in Azure b...apidays LIVE Paris 2021 - Lessons from the API Stewardship Journey in Azure b...
apidays LIVE Paris 2021 - Lessons from the API Stewardship Journey in Azure b...
 
Lessons learned on the Azure API Stewardship Journey.pptx
Lessons learned on the Azure API Stewardship Journey.pptxLessons learned on the Azure API Stewardship Journey.pptx
Lessons learned on the Azure API Stewardship Journey.pptx
 
APIs distribuidos con alta escalabilidad
APIs distribuidos con alta escalabilidadAPIs distribuidos con alta escalabilidad
APIs distribuidos con alta escalabilidad
 
SGCE 2015 REST APIs
SGCE 2015 REST APIsSGCE 2015 REST APIs
SGCE 2015 REST APIs
 
Escaping the yellow bubble - rewriting Domino using MongoDb and Angular
Escaping the yellow bubble - rewriting Domino using MongoDb and AngularEscaping the yellow bubble - rewriting Domino using MongoDb and Angular
Escaping the yellow bubble - rewriting Domino using MongoDb and Angular
 
Azure Functions Real World Examples
Azure Functions Real World Examples Azure Functions Real World Examples
Azure Functions Real World Examples
 
Swagger APIs for Humans and Robots (Gluecon)
Swagger APIs for Humans and Robots (Gluecon)Swagger APIs for Humans and Robots (Gluecon)
Swagger APIs for Humans and Robots (Gluecon)
 
Tech Talk on Cloud Computing
Tech Talk on Cloud ComputingTech Talk on Cloud Computing
Tech Talk on Cloud Computing
 
Building a REST API for Longevity
Building a REST API for LongevityBuilding a REST API for Longevity
Building a REST API for Longevity
 
#SPSNYC 2018 Migrate your custom components to the #SharePoint Framework #SPFX
#SPSNYC 2018 Migrate your custom components to the #SharePoint Framework #SPFX#SPSNYC 2018 Migrate your custom components to the #SharePoint Framework #SPFX
#SPSNYC 2018 Migrate your custom components to the #SharePoint Framework #SPFX
 
(ATS6-DEV02) Web Application Strategies
(ATS6-DEV02) Web Application Strategies(ATS6-DEV02) Web Application Strategies
(ATS6-DEV02) Web Application Strategies
 
Serverless Meetup - Event Sourcing
Serverless Meetup - Event SourcingServerless Meetup - Event Sourcing
Serverless Meetup - Event Sourcing
 
Platforms FTW!
Platforms FTW!Platforms FTW!
Platforms FTW!
 
Platforms FTW!
Platforms FTW!Platforms FTW!
Platforms FTW!
 
Integrate Applications into IBM Connections Cloud and On Premises (AD 1632)
Integrate Applications into IBM Connections Cloud and On Premises (AD 1632)Integrate Applications into IBM Connections Cloud and On Premises (AD 1632)
Integrate Applications into IBM Connections Cloud and On Premises (AD 1632)
 
code talks Commerce: The API Economy as an E-Commerce Operating System
code talks Commerce: The API Economy as an E-Commerce Operating Systemcode talks Commerce: The API Economy as an E-Commerce Operating System
code talks Commerce: The API Economy as an E-Commerce Operating System
 
Build Modern Web Apps Using ASP.NET Web API and AngularJS
Build Modern Web Apps Using ASP.NET Web API and AngularJSBuild Modern Web Apps Using ASP.NET Web API and AngularJS
Build Modern Web Apps Using ASP.NET Web API and AngularJS
 
Scaling
ScalingScaling
Scaling
 
API Gateways are going through an identity crisis
API Gateways are going through an identity crisisAPI Gateways are going through an identity crisis
API Gateways are going through an identity crisis
 
Application Insights for Integration Developers
Application Insights for Integration DevelopersApplication Insights for Integration Developers
Application Insights for Integration Developers
 

Último

Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
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 DiscoveryTrustArc
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
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...apidays
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 

Último (20)

Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
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
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
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...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 

Service-Oriented Architecture

  • 2. LET’STALK ABOUT A PROJECT (A HYPOTHETICAL ONE)
  • 5. SOUNDS SIMPLE, RIGHT? LET’S DO IT IN LARAVEL!
  • 6. THE ENTITIES • Users • Admins • Shirts • Images • Orders • Shipping • Payment Methods • (Blog) posts • Comments • Mugs • Laptop Stickers • 3rd-party prices • Search indexing • Customer Service • Reviews • Videos • ???
  • 7. • 16 entities means (at minimum): • 16-22 database tables • 80-160 classes • 800-1600+ unit tests • A routes file that makes you want to throw your computer out of a window
  • 8. AND IF SOMETHING BREAKS, IT ALL GOES DOWN
  • 9. THIS IS A MONOLITH Keep building on top of the project you already have
  • 10. SO WHAT IS SERVICE-ORIENTED ARCHITECTURE? Lots of little separate pieces (that talk to each other when they need to)
  • 11. BOTH APPROACHES HAVE THEIR PROS AND CONS Just don’t do this
  • 12. LET’S LOOK ATTHIS AGAIN • Users • Admins • Shirts • Images • Orders • Shipping • Payment Methods • (Blog) posts • Comments • Mugs • Laptop Stickers • 3rd-party prices • Search indexing • Customer Service • Reviews • Videos • ???
  • 13. SO WHAT MIGHTTHIS LOOK LIKE USING SOA? • Users • Admins Users API • Shirts • Images • Mugs • Laptop Stickers • Reviews Products API • (Blog) posts • Comments • Videos News API Orders API • Orders • Payment Methods • Customer Service • Shipping
  • 14. Price Collector • Price collecting • Add prices to product API Search API • Search indexing • Search results
  • 15. MICROSERVICES • APIs organized around business capability / function • Only call other APIs when needed • Single-responsibility principle
  • 16. THE GOOD! • Less code = easier to onboard new developers • Fewer merge conflicts • Easier to make changes and upgrades • Improved fault isolation • Running the test suite is far quicker • Easier to scale and load-balance servers
  • 17. THE BAD :( • Deployment / Dev Ops complexity • Cost • Time investment for new microservices • Shared code between projects can be a hassle • More planning required
  • 18. SO HOW DO I ACTUALLY BUILD USING SOA?
  • 19. LARAVELVS. LUMEN • Lumen is great if you are building: • APIs • Small worker services (such as the search indexer) • Use Laravel if: • You don’t want to manually install front-end niceties like Elixir or Bootstrap • You know you’ll be using packages that don’t support Lumen • You want/need Symfony’s more powerful routing component • You’ve never built a Laravel application before
  • 20. MAKINGYOUR MICROSERVICES PLAY NICE • Build APIs with a standard formatting schema • JSON API / JSend / Other — just be consistent! • Standardize HTTP codes / errors • APIs call ONLY the endpoints they need using cURL or Guzzle • Front-end clients (JavaScript application or Laravel project with Blade templates) call endpoints they need
  • 21. EXAMPLE • Order API needs user info to print shipping label • Send GET request to http://user-api.artisanalswag.com/ api/v1/user/{id} with user ID • Check for API response • If 200, return user • If 400 / 404 / 500 / etc., pass along error message
  • 22. AUTHENTICATION • A few problems: • How do you know what user is logged in? • How do you keep unauthorized users out? • Can you share session data? Should you?
  • 23. USE OAUTH2! • Authentication should be *stateless* • You send user credentials to an authentication endpoint in User API (along with client ID and secret) • User API sends back two things — access token and refresh token • Access token — short expiration time • Refresh token — longer expiration time • You send access token in header with your API requests
  • 24. • User API confirms access token is still valid • If access token is expired, the client should send refresh token instead • If refresh token is still valid, User API sends new tokens (and deletes old ones) • If refresh token is expired, require user to log in again
  • 25. SCOPES • OAuth2 supports scopes (client permissions) • Different clients can have different scopes • Use with roles to protect your APIs
  • 26. LOCAL DEVELOPMENT • Homestead for local • All software you need to run Laravel is included • Same versions as your team / Forge • List all applications in Homestead.yaml and hosts file • Database — local or remote?
  • 27. DEPLOY • Laravel Forge • Your Dev Ops guy • Same cost no matter how many projects • Taylor Otwell support • Continuous integration (Travis, Codeship, etc.) • Envoyer
  • 28. AREYOU SAYING MONOLITHS ARE BAD? No! Do what makes sense for your application.