SlideShare a Scribd company logo
1 of 54
Lessons learned when
building a microservice architecture
for a 100mio+ revenue company
28.04.2017
???
Summary – Takeaways
1. Microservices are no silver bullet!
2. Microservices come with a lot of
complexity that you don’t see at the first
glance!
3. Microservices are a tool. Check if it is the
right one!
About me
 Stephan Schulze
 CTO@Project A
 stephan.schulze@project-a.com
 https://www.linkedin.com/in/stephan-schulze-24115957/
 https://twitter.com/nahpeps
 https://insights.project-a.com/tagged/tech
Our Project
Introduction – Overview
 Developing a new eCommerce
Platform based on a microservice
architecture
 Current KPIs:
 Revenue: > 100mio€/year
 SKUs: 500k
 Expected KPIs:
 Revenue: > 200mio€/year
 SKUs: 1.5mio
 General Expectations:
 Scalable, flexible, developed
inhouse
 Should allow to run different
business models in parallel
 Should be suitable for online
and offline sales
Introduction – Our stack
 Infrastructure Stack:
 AWS
 Terraform
 Kubernetes
 Docker
 Application Stack:
 Java
 PHP
 Nginx
 Tomcat
 PostgreSql
 Redis
 …
Introduction – Our stack
Introduction – A common understanding of microservices
Microservices are a distributed System
Characteristics:
 isolated vertical infrastructure for each service
 communication only via APIs
 no referential integrity across services
 each service serves one business domain
 Service provides its own HTML (Customer Facing and Backoffice)
Introduction – The abstract architecture
R
o
u
t
i
n
g
/
R
e
n
d
e
r
i
n
g
S1
S5
S2
S6
S4
S7
S9
S3
S8
Lets start…
Preparation
Challenge – Preparation
 Think about and define basic parameters for your system
 Communication formats (Language; Protocol; Message Formats; Error Handling, …)
 Security Model
 Notifications and Configuration Mgmt.
 API Versioning
 Deployments
 Document your results
Examples
Challenge – Preparation – Examples
 API Request with Success:
Challenge – Preparation – Examples
 API Request with Error:
Challenge – Preparation – Examples
 API-Versioning
Challenge – Preparation – Examples
 Documentation
Challenge – Preparation – Takeaways
1. You will not be prepared enough!
2. Build PoC application infrastructure and
test it.
3. Have a common understanding and
documentation.
Global Data
Challenge – Global data types
 Rare changing data:
 Countries
 Languages
 Currencies
 can be part of the service
 should be cached
 Often changing data
 User/Customer Sessions
 Tracking
 Must not be part of the service
 Must not be cached
 Regular changing data
 URLs
 Configurations
 Permissions
 should not be part of the service
 should be cached
Examples
Challenge – Global data – How we share it
 Rare/Regular changing data is:
 Provided by a central registry
 Cached in the service
 Updated via deployment and notification
 Often changing data is:
 Part of the request/response of a service call
Challenge – Global data – Example: Session Data
 Routing/Rendering Service is session data master
R
o
u
t
i
n
g
/
R
e
n
d
e
r
i
n
g
S1
S5
S2
S6
S4
S7
S9
S3
S8
Challenge – Global data – Example: Session Data
 Routing/Rendering Service is session data master
 Each service has its namespace in the session
 There is a global part in the session which is well defined
 Session data is part of the request header, including:
 Global part
 Service specific part
 Updates to the session are part of the response of a service request
 Problem:
 Inconsistent Global Data in two different services
{{Header}}
{{Content}}
Template1
Routing/Rendering
Challenge – Global data – Example: Session Data
S1
S2
/url123
URL Template
/url123 Template1
/url1234 Template2
… …
URL Placeholder Service Endpoint
/url123 Header S1 /header
/url123 Content S2 /customer/login
… …
/header
/customer/login
 Problem: Inconsistent Global Data in two different services
Challenge – Global Data – Takeaways
1. Independent of what others say:
There will be global data and you will
depend on it.
2. Thinking about different data types and
the best implementation approach early,
helps a lot!
Security
Challenge – Security
 Rule #1: Don’t trust anybody else
 Roles and Permissions
 Must be part of your architecture from day one
 Tokens (e.g. JWT) or similar approaches are best practice
 token can contain permissions already
OR
 Permissions can be provided by a central registry
 Each service must care about its own security
Examples
Challenge – Security – Example: API Permissions
Challenge – Security – Example: Permissions – Grants
 Permissions are not only for users but also for services
Challenge – Security – Token (in)validation
 How do I know whether a Token is still valid?
 Two approaches:
1. Authorize Token on every call
2. Cache permissions and token locally
 We go for approach 2
 If permissions behind a token changes or token becomes invalid
 Whole system is notified
 every Service must take care on its own
Challenge – Security – Example: Permissions at S2S
calls
 Situation
 User registers new Customer in Backoffice (via CustomerService)
 Registration requires Discount creation (DiscountService)
 Registrations requires sending a Welcome Mail with Discount (via Mailservice)
 Case 1: User Token is used for subsequent calls
 User must have permission to create Discounts and send welcome Mails also
 Case 2: CustomerService Token is used for subsequent calls
 User must have permission to create Customer
 CustomerService must have permissions to do all business steps
Challenge – Security – Takeaways
1. Security is crucial
2. Use tokens (and think about how to
authorize and invalidate them)
3. Take care of a chain of rights
Versioning
Challenge – Versioning
 What need to be versioned?
 Whole services
 Service APIs
 Service Frontends and so Assets, Sessions, Permissions, …
 Things get more complicated:
 Services must provide more than one API version at once
 Different API Versions of a Service can have a dependency to different API Versions
of other services
 Different API Versions will operate on the same database
Examples
Challenge – Versioning – our Approach for APIs
 API Version is part of the request header
 One Service release must support multiple API/Frontend versions
 Every service expose the API versions it offers and it consumes (in code)
Challenge – Versioning – our Approach for APIs
 How does that look at runtime?
Release 1
API: 1.2.3
Release 2
API: 1.2.3
API: 2.0.0
Release 3
API: 1.2.3
API: 2.0.0
API: 2.1.0
Challenge – Versioning – our Approach for APIs
Release 3
API: 1.2.3
API: 2.0.0
API: 2.1.0
X-Api-Version: 1.2
X-Api-Version-Used: 1.2.3
X-Api-Version: 1.2.3
X-Api-Version-Used: 1.2.3
X-Api-Version: 2
X-Api-Version-Used: 2.1.0
X-Api-Version: 3.1.0
ERROR
Challenge – Versioning – Takeaways
1. Versioning is a pain but necessary
2. A lot parts in the application
can/should/must be versioned
3. Validating API/Service dependencies
should happen before deployment
Logging
Challenge – Logging – Areas
 Infrastructure centric: everything necessary to run a service
(Docker, Kubernetes, …)
 Service centric: everything that is related to a specific service
(Webserver, ApplicationEngine)
 Application centric: everything that is related to the application itself
(Exceptions, Warnings, Notices, …)
 Major Question: How should be logged and what?
Examples
Challenge – Logging – Our stack
 Logs are going to stdout
 Using Fluentd as logshipper to elasticsearch setup
 Why not logstash?
 Much faster ramp up
 Native kubernetes integration
 Each log entry includes:
 Instance-Id (always)
 Service release (if available)
 API-Version (if available)
 Correlation-Id (if available)
 Visitor-Id (if available)
Challenge – Logging – Correlation and Visitor Id
 Correlation Id  forwarded by each service or created if none is available
 See the way of a request through the whole application
 Is valid for one request
 Visitor Id  forwarded by each service if received
 Group all calls of a specific User/Customer
 Stored at the User/Customer for longterm usage
Challenge – Logging – Correlation and Visitor Id
Challenge – Logging – Takeaways
1. You need to know everything!
2. Infrastructure vs. Applications vs. Request
Logs  each of them matter
3. Using Correlation-Ids and Visitor-Ids is
recommended
4. Service-Identifier, -release, -instance and
API Version must be part of every
application log entry
What comes next?
I could continue for a while…
The question is still…
Questions?
Contact
Stephan Schulze
CTO
Project A Services GmbH & Co. KG
Julie-Wolfthorn-Str. 1
10115 Berlin
Tel: + 49 30 340 606 300
Fax: + 49 30 340 606 399
stephan.schulze@project-a.com
www.project-a.com
facebook.com/projectaberlin
twitter.com/projectacom

More Related Content

What's hot

Online Meetup - MuleSoft - June 2020
 Online Meetup - MuleSoft - June 2020  Online Meetup - MuleSoft - June 2020
Online Meetup - MuleSoft - June 2020 Royston Lobo
 
Service Mesh - Why? How? What?
Service Mesh - Why? How? What?Service Mesh - Why? How? What?
Service Mesh - Why? How? What?Orkhan Gasimov
 
How to migrate an application in IBM APIc, and preserve its client credential
How to migrate an application in IBM APIc, and preserve its client credentialHow to migrate an application in IBM APIc, and preserve its client credential
How to migrate an application in IBM APIc, and preserve its client credentialShiu-Fun Poon
 
Integration patterns and practices for cloud and mobile computing
Integration patterns and practices for cloud and mobile computingIntegration patterns and practices for cloud and mobile computing
Integration patterns and practices for cloud and mobile computingSHAKIL AKHTAR
 
Microservices with mule
Microservices with muleMicroservices with mule
Microservices with muleGovind Mulinti
 
What is an API Gateway?
What is an API Gateway?What is an API Gateway?
What is an API Gateway?LunchBadger
 
A Decade of Microservices
A Decade of MicroservicesA Decade of Microservices
A Decade of MicroservicesRuman Khan
 
MuleSoft Surat Virtual Meetup#19 - Identity and Client Management With MuleSoft
MuleSoft Surat Virtual Meetup#19 - Identity and Client Management With MuleSoftMuleSoft Surat Virtual Meetup#19 - Identity and Client Management With MuleSoft
MuleSoft Surat Virtual Meetup#19 - Identity and Client Management With MuleSoftJitendra Bafna
 
Microservices Best Practices
Microservices Best PracticesMicroservices Best Practices
Microservices Best PracticesAliasgar Muchhala
 
Standard Issue: Preparing for the Future of Data Management
Standard Issue: Preparing for the Future of Data ManagementStandard Issue: Preparing for the Future of Data Management
Standard Issue: Preparing for the Future of Data ManagementInside Analysis
 
Object Store V2 Workshop
Object Store V2 WorkshopObject Store V2 Workshop
Object Store V2 WorkshopMuleSoft
 
Introduction to Mulesoft
Introduction to MulesoftIntroduction to Mulesoft
Introduction to Mulesoftvenkata20k
 
What's New with Anypoint Platform? Unified Platform Management
What's New with Anypoint Platform? Unified Platform ManagementWhat's New with Anypoint Platform? Unified Platform Management
What's New with Anypoint Platform? Unified Platform ManagementMuleSoft
 
MuleSoft Surat Virtual Meetup#20 - Unleash the power of Anypoint DataGraph
MuleSoft Surat Virtual Meetup#20 - Unleash the power of Anypoint DataGraphMuleSoft Surat Virtual Meetup#20 - Unleash the power of Anypoint DataGraph
MuleSoft Surat Virtual Meetup#20 - Unleash the power of Anypoint DataGraphJitendra Bafna
 
Mulesoft Meetups - Salesforce & Mulesoft Integrations, Anypoint Security Poli...
Mulesoft Meetups - Salesforce & Mulesoft Integrations, Anypoint Security Poli...Mulesoft Meetups - Salesforce & Mulesoft Integrations, Anypoint Security Poli...
Mulesoft Meetups - Salesforce & Mulesoft Integrations, Anypoint Security Poli...Ricardo Rodríguez
 
Deep-dive into Microservice Outer Architecture
Deep-dive into Microservice Outer ArchitectureDeep-dive into Microservice Outer Architecture
Deep-dive into Microservice Outer ArchitectureWSO2
 
Microservices with .Net - NDC Sydney, 2016
Microservices with .Net - NDC Sydney, 2016Microservices with .Net - NDC Sydney, 2016
Microservices with .Net - NDC Sydney, 2016Richard Banks
 
WSO2Con EU 2016: Identity Management – A Cornerstone for the Connected Enter...
WSO2Con EU 2016: Identity Management –  A Cornerstone for the Connected Enter...WSO2Con EU 2016: Identity Management –  A Cornerstone for the Connected Enter...
WSO2Con EU 2016: Identity Management – A Cornerstone for the Connected Enter...WSO2
 
Microservices & anypoint service mesh calgary mule soft meetup
Microservices & anypoint service mesh   calgary mule soft meetupMicroservices & anypoint service mesh   calgary mule soft meetup
Microservices & anypoint service mesh calgary mule soft meetupJimmy Attia
 

What's hot (20)

Online Meetup - MuleSoft - June 2020
 Online Meetup - MuleSoft - June 2020  Online Meetup - MuleSoft - June 2020
Online Meetup - MuleSoft - June 2020
 
Service Mesh - Why? How? What?
Service Mesh - Why? How? What?Service Mesh - Why? How? What?
Service Mesh - Why? How? What?
 
How to migrate an application in IBM APIc, and preserve its client credential
How to migrate an application in IBM APIc, and preserve its client credentialHow to migrate an application in IBM APIc, and preserve its client credential
How to migrate an application in IBM APIc, and preserve its client credential
 
Integration patterns and practices for cloud and mobile computing
Integration patterns and practices for cloud and mobile computingIntegration patterns and practices for cloud and mobile computing
Integration patterns and practices for cloud and mobile computing
 
Microservices with mule
Microservices with muleMicroservices with mule
Microservices with mule
 
What is an API Gateway?
What is an API Gateway?What is an API Gateway?
What is an API Gateway?
 
A Decade of Microservices
A Decade of MicroservicesA Decade of Microservices
A Decade of Microservices
 
Architecting SaaS
Architecting SaaSArchitecting SaaS
Architecting SaaS
 
MuleSoft Surat Virtual Meetup#19 - Identity and Client Management With MuleSoft
MuleSoft Surat Virtual Meetup#19 - Identity and Client Management With MuleSoftMuleSoft Surat Virtual Meetup#19 - Identity and Client Management With MuleSoft
MuleSoft Surat Virtual Meetup#19 - Identity and Client Management With MuleSoft
 
Microservices Best Practices
Microservices Best PracticesMicroservices Best Practices
Microservices Best Practices
 
Standard Issue: Preparing for the Future of Data Management
Standard Issue: Preparing for the Future of Data ManagementStandard Issue: Preparing for the Future of Data Management
Standard Issue: Preparing for the Future of Data Management
 
Object Store V2 Workshop
Object Store V2 WorkshopObject Store V2 Workshop
Object Store V2 Workshop
 
Introduction to Mulesoft
Introduction to MulesoftIntroduction to Mulesoft
Introduction to Mulesoft
 
What's New with Anypoint Platform? Unified Platform Management
What's New with Anypoint Platform? Unified Platform ManagementWhat's New with Anypoint Platform? Unified Platform Management
What's New with Anypoint Platform? Unified Platform Management
 
MuleSoft Surat Virtual Meetup#20 - Unleash the power of Anypoint DataGraph
MuleSoft Surat Virtual Meetup#20 - Unleash the power of Anypoint DataGraphMuleSoft Surat Virtual Meetup#20 - Unleash the power of Anypoint DataGraph
MuleSoft Surat Virtual Meetup#20 - Unleash the power of Anypoint DataGraph
 
Mulesoft Meetups - Salesforce & Mulesoft Integrations, Anypoint Security Poli...
Mulesoft Meetups - Salesforce & Mulesoft Integrations, Anypoint Security Poli...Mulesoft Meetups - Salesforce & Mulesoft Integrations, Anypoint Security Poli...
Mulesoft Meetups - Salesforce & Mulesoft Integrations, Anypoint Security Poli...
 
Deep-dive into Microservice Outer Architecture
Deep-dive into Microservice Outer ArchitectureDeep-dive into Microservice Outer Architecture
Deep-dive into Microservice Outer Architecture
 
Microservices with .Net - NDC Sydney, 2016
Microservices with .Net - NDC Sydney, 2016Microservices with .Net - NDC Sydney, 2016
Microservices with .Net - NDC Sydney, 2016
 
WSO2Con EU 2016: Identity Management – A Cornerstone for the Connected Enter...
WSO2Con EU 2016: Identity Management –  A Cornerstone for the Connected Enter...WSO2Con EU 2016: Identity Management –  A Cornerstone for the Connected Enter...
WSO2Con EU 2016: Identity Management – A Cornerstone for the Connected Enter...
 
Microservices & anypoint service mesh calgary mule soft meetup
Microservices & anypoint service mesh   calgary mule soft meetupMicroservices & anypoint service mesh   calgary mule soft meetup
Microservices & anypoint service mesh calgary mule soft meetup
 

Similar to Building a microservice architecture for a 100mio# revenue company

O2 Presentation Sdp Event
O2 Presentation Sdp EventO2 Presentation Sdp Event
O2 Presentation Sdp Eventjameskenney
 
Ws Soa V6 Theory And Practice
Ws Soa V6 Theory And PracticeWs Soa V6 Theory And Practice
Ws Soa V6 Theory And PracticePini Cohen
 
Over view of software artitecture
Over view of software artitectureOver view of software artitecture
Over view of software artitectureABDEL RAHMAN KARIM
 
Microservices architecture
Microservices architectureMicroservices architecture
Microservices architectureFaren faren
 
Monitoring as an entry point for collaboration
Monitoring as an entry point for collaborationMonitoring as an entry point for collaboration
Monitoring as an entry point for collaborationJulien Pivotto
 
Agile Gurugram 2023 | Observability for Modern Applications. How does it help...
Agile Gurugram 2023 | Observability for Modern Applications. How does it help...Agile Gurugram 2023 | Observability for Modern Applications. How does it help...
Agile Gurugram 2023 | Observability for Modern Applications. How does it help...AgileNetwork
 
Observability for Application Developers (1)-1.pptx
Observability for Application Developers (1)-1.pptxObservability for Application Developers (1)-1.pptx
Observability for Application Developers (1)-1.pptxOpsTree solutions
 
An Introduction to Microservices
An Introduction to MicroservicesAn Introduction to Microservices
An Introduction to MicroservicesAd van der Veer
 
Patterns&Antipatternsof SOA
Patterns&Antipatternsof SOAPatterns&Antipatternsof SOA
Patterns&Antipatternsof SOAMohamed Samy
 
N - Tier Applications, Enterprise Java Beans, Component technologies
N - Tier Applications, Enterprise Java Beans, Component technologiesN - Tier Applications, Enterprise Java Beans, Component technologies
N - Tier Applications, Enterprise Java Beans, Component technologiesMartin A
 
Introduction to Event-Driven Architecture
Introduction to Event-Driven Architecture Introduction to Event-Driven Architecture
Introduction to Event-Driven Architecture Solace
 
Data Microservices with Spring Cloud
Data Microservices with Spring CloudData Microservices with Spring Cloud
Data Microservices with Spring CloudOrkhan Gasimov
 

Similar to Building a microservice architecture for a 100mio# revenue company (20)

O2 Presentation Sdp Event
O2 Presentation Sdp EventO2 Presentation Sdp Event
O2 Presentation Sdp Event
 
Ws Soa V6 Theory And Practice
Ws Soa V6 Theory And PracticeWs Soa V6 Theory And Practice
Ws Soa V6 Theory And Practice
 
Over view of software artitecture
Over view of software artitectureOver view of software artitecture
Over view of software artitecture
 
Microservices
MicroservicesMicroservices
Microservices
 
Reqs analysis
Reqs analysisReqs analysis
Reqs analysis
 
Microservices architecture
Microservices architectureMicroservices architecture
Microservices architecture
 
Monitoring as an entry point for collaboration
Monitoring as an entry point for collaborationMonitoring as an entry point for collaboration
Monitoring as an entry point for collaboration
 
Symantec I3 Presentation
Symantec I3 PresentationSymantec I3 Presentation
Symantec I3 Presentation
 
Agile Gurugram 2023 | Observability for Modern Applications. How does it help...
Agile Gurugram 2023 | Observability for Modern Applications. How does it help...Agile Gurugram 2023 | Observability for Modern Applications. How does it help...
Agile Gurugram 2023 | Observability for Modern Applications. How does it help...
 
Observability for Application Developers (1)-1.pptx
Observability for Application Developers (1)-1.pptxObservability for Application Developers (1)-1.pptx
Observability for Application Developers (1)-1.pptx
 
An Introduction to Microservices
An Introduction to MicroservicesAn Introduction to Microservices
An Introduction to Microservices
 
Kafka/SMM Crash Course
Kafka/SMM Crash CourseKafka/SMM Crash Course
Kafka/SMM Crash Course
 
Patterns&Antipatternsof SOA
Patterns&Antipatternsof SOAPatterns&Antipatternsof SOA
Patterns&Antipatternsof SOA
 
N - Tier Applications, Enterprise Java Beans, Component technologies
N - Tier Applications, Enterprise Java Beans, Component technologiesN - Tier Applications, Enterprise Java Beans, Component technologies
N - Tier Applications, Enterprise Java Beans, Component technologies
 
PM Club session 6
PM Club session 6PM Club session 6
PM Club session 6
 
Introduction to Event-Driven Architecture
Introduction to Event-Driven Architecture Introduction to Event-Driven Architecture
Introduction to Event-Driven Architecture
 
Resumeupdated
ResumeupdatedResumeupdated
Resumeupdated
 
Resumeupdated
ResumeupdatedResumeupdated
Resumeupdated
 
WEB API Gateway
WEB API GatewayWEB API Gateway
WEB API Gateway
 
Data Microservices with Spring Cloud
Data Microservices with Spring CloudData Microservices with Spring Cloud
Data Microservices with Spring Cloud
 

Recently uploaded

Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZABSYZ Inc
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLionel Briand
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf31events.com
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 

Recently uploaded (20)

Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and Repair
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 

Building a microservice architecture for a 100mio# revenue company

  • 1. Lessons learned when building a microservice architecture for a 100mio+ revenue company 28.04.2017
  • 2. ???
  • 3. Summary – Takeaways 1. Microservices are no silver bullet! 2. Microservices come with a lot of complexity that you don’t see at the first glance! 3. Microservices are a tool. Check if it is the right one!
  • 4. About me  Stephan Schulze  CTO@Project A  stephan.schulze@project-a.com  https://www.linkedin.com/in/stephan-schulze-24115957/  https://twitter.com/nahpeps  https://insights.project-a.com/tagged/tech
  • 6. Introduction – Overview  Developing a new eCommerce Platform based on a microservice architecture  Current KPIs:  Revenue: > 100mio€/year  SKUs: 500k  Expected KPIs:  Revenue: > 200mio€/year  SKUs: 1.5mio  General Expectations:  Scalable, flexible, developed inhouse  Should allow to run different business models in parallel  Should be suitable for online and offline sales
  • 7. Introduction – Our stack  Infrastructure Stack:  AWS  Terraform  Kubernetes  Docker  Application Stack:  Java  PHP  Nginx  Tomcat  PostgreSql  Redis  …
  • 9. Introduction – A common understanding of microservices Microservices are a distributed System Characteristics:  isolated vertical infrastructure for each service  communication only via APIs  no referential integrity across services  each service serves one business domain  Service provides its own HTML (Customer Facing and Backoffice)
  • 10. Introduction – The abstract architecture R o u t i n g / R e n d e r i n g S1 S5 S2 S6 S4 S7 S9 S3 S8
  • 13. Challenge – Preparation  Think about and define basic parameters for your system  Communication formats (Language; Protocol; Message Formats; Error Handling, …)  Security Model  Notifications and Configuration Mgmt.  API Versioning  Deployments  Document your results
  • 15. Challenge – Preparation – Examples  API Request with Success:
  • 16. Challenge – Preparation – Examples  API Request with Error:
  • 17. Challenge – Preparation – Examples  API-Versioning
  • 18. Challenge – Preparation – Examples  Documentation
  • 19. Challenge – Preparation – Takeaways 1. You will not be prepared enough! 2. Build PoC application infrastructure and test it. 3. Have a common understanding and documentation.
  • 21. Challenge – Global data types  Rare changing data:  Countries  Languages  Currencies  can be part of the service  should be cached  Often changing data  User/Customer Sessions  Tracking  Must not be part of the service  Must not be cached  Regular changing data  URLs  Configurations  Permissions  should not be part of the service  should be cached
  • 23. Challenge – Global data – How we share it  Rare/Regular changing data is:  Provided by a central registry  Cached in the service  Updated via deployment and notification  Often changing data is:  Part of the request/response of a service call
  • 24. Challenge – Global data – Example: Session Data  Routing/Rendering Service is session data master R o u t i n g / R e n d e r i n g S1 S5 S2 S6 S4 S7 S9 S3 S8
  • 25. Challenge – Global data – Example: Session Data  Routing/Rendering Service is session data master  Each service has its namespace in the session  There is a global part in the session which is well defined  Session data is part of the request header, including:  Global part  Service specific part  Updates to the session are part of the response of a service request  Problem:  Inconsistent Global Data in two different services
  • 26. {{Header}} {{Content}} Template1 Routing/Rendering Challenge – Global data – Example: Session Data S1 S2 /url123 URL Template /url123 Template1 /url1234 Template2 … … URL Placeholder Service Endpoint /url123 Header S1 /header /url123 Content S2 /customer/login … … /header /customer/login  Problem: Inconsistent Global Data in two different services
  • 27. Challenge – Global Data – Takeaways 1. Independent of what others say: There will be global data and you will depend on it. 2. Thinking about different data types and the best implementation approach early, helps a lot!
  • 29. Challenge – Security  Rule #1: Don’t trust anybody else  Roles and Permissions  Must be part of your architecture from day one  Tokens (e.g. JWT) or similar approaches are best practice  token can contain permissions already OR  Permissions can be provided by a central registry  Each service must care about its own security
  • 31. Challenge – Security – Example: API Permissions
  • 32. Challenge – Security – Example: Permissions – Grants  Permissions are not only for users but also for services
  • 33. Challenge – Security – Token (in)validation  How do I know whether a Token is still valid?  Two approaches: 1. Authorize Token on every call 2. Cache permissions and token locally  We go for approach 2  If permissions behind a token changes or token becomes invalid  Whole system is notified  every Service must take care on its own
  • 34. Challenge – Security – Example: Permissions at S2S calls  Situation  User registers new Customer in Backoffice (via CustomerService)  Registration requires Discount creation (DiscountService)  Registrations requires sending a Welcome Mail with Discount (via Mailservice)  Case 1: User Token is used for subsequent calls  User must have permission to create Discounts and send welcome Mails also  Case 2: CustomerService Token is used for subsequent calls  User must have permission to create Customer  CustomerService must have permissions to do all business steps
  • 35. Challenge – Security – Takeaways 1. Security is crucial 2. Use tokens (and think about how to authorize and invalidate them) 3. Take care of a chain of rights
  • 37. Challenge – Versioning  What need to be versioned?  Whole services  Service APIs  Service Frontends and so Assets, Sessions, Permissions, …  Things get more complicated:  Services must provide more than one API version at once  Different API Versions of a Service can have a dependency to different API Versions of other services  Different API Versions will operate on the same database
  • 39. Challenge – Versioning – our Approach for APIs  API Version is part of the request header  One Service release must support multiple API/Frontend versions  Every service expose the API versions it offers and it consumes (in code)
  • 40. Challenge – Versioning – our Approach for APIs  How does that look at runtime? Release 1 API: 1.2.3 Release 2 API: 1.2.3 API: 2.0.0 Release 3 API: 1.2.3 API: 2.0.0 API: 2.1.0
  • 41. Challenge – Versioning – our Approach for APIs Release 3 API: 1.2.3 API: 2.0.0 API: 2.1.0 X-Api-Version: 1.2 X-Api-Version-Used: 1.2.3 X-Api-Version: 1.2.3 X-Api-Version-Used: 1.2.3 X-Api-Version: 2 X-Api-Version-Used: 2.1.0 X-Api-Version: 3.1.0 ERROR
  • 42. Challenge – Versioning – Takeaways 1. Versioning is a pain but necessary 2. A lot parts in the application can/should/must be versioned 3. Validating API/Service dependencies should happen before deployment
  • 44. Challenge – Logging – Areas  Infrastructure centric: everything necessary to run a service (Docker, Kubernetes, …)  Service centric: everything that is related to a specific service (Webserver, ApplicationEngine)  Application centric: everything that is related to the application itself (Exceptions, Warnings, Notices, …)  Major Question: How should be logged and what?
  • 46. Challenge – Logging – Our stack  Logs are going to stdout  Using Fluentd as logshipper to elasticsearch setup  Why not logstash?  Much faster ramp up  Native kubernetes integration  Each log entry includes:  Instance-Id (always)  Service release (if available)  API-Version (if available)  Correlation-Id (if available)  Visitor-Id (if available)
  • 47. Challenge – Logging – Correlation and Visitor Id  Correlation Id  forwarded by each service or created if none is available  See the way of a request through the whole application  Is valid for one request  Visitor Id  forwarded by each service if received  Group all calls of a specific User/Customer  Stored at the User/Customer for longterm usage
  • 48. Challenge – Logging – Correlation and Visitor Id
  • 49. Challenge – Logging – Takeaways 1. You need to know everything! 2. Infrastructure vs. Applications vs. Request Logs  each of them matter 3. Using Correlation-Ids and Visitor-Ids is recommended 4. Service-Identifier, -release, -instance and API Version must be part of every application log entry
  • 51. I could continue for a while…
  • 52. The question is still…
  • 54. Contact Stephan Schulze CTO Project A Services GmbH & Co. KG Julie-Wolfthorn-Str. 1 10115 Berlin Tel: + 49 30 340 606 300 Fax: + 49 30 340 606 399 stephan.schulze@project-a.com www.project-a.com facebook.com/projectaberlin twitter.com/projectacom