SlideShare a Scribd company logo
1 of 87
Adventures of
building a multi-
tenant PaaS on
Microsoft Azure
Tom Kerkhove - Azure Architect at Codit, Azure MVP
Maintainer of Promitor,
Azure Architect
Microsoft Azure MVP & Advisor
Writes on blog.tomkerkhove.be
Maintainer of Promitor, KEDA & Arcus
Hi, I’m Tom Kerkhove
2
@TomKerkhove
tomkerkhove
Disclaimer
You’ll learn about my adventures & findings, not about silver bullets
3
Scale
4
Scale up/down
June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 5
Scale
| Easiest way of scaling is to get a bigger box
| The only trade-off is that it means your app will be unavailable for a while
| At some point you’ll run out of “bigger boxes”
Scale out / in
June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 6
Scale
| Provide multiple copies of your application based on your workload
| No impact on your uptime, but more complex
| My preferred way of scaling, but your application needs to be designed for it
Choose the right compute infrastructure
June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 7
Functions
Functions
Container
Instances
Service
Service
Fabric Mesh
Cloud
Services
App
Service
Fabric
Kubernetes
Cluster
VM Scale
Sets
VMs
Bare Metal
| As control increases, so does complexity
| Every service has it’s own characteristics
| How you run your application
| How you package your application
| How you scale your application
Designing for scale
June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 8
Scale
Order Function
Order Function
Order Function
Order Function
Order Function
Order Function
Azure Functions
Designing for scale with serverless
June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 9
Scale
| The good
| The service handles scaling for you
| The bad
| The service handles scaling for you
| Does not provide a lot of awareness
| The ugly
| Dangerous to burn a lot of money
June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 10
Source: http://blog.tdwright.co.uk/2018/09/06/beware-runonstartup-in-azure-functions-a-serverless-horror-story/
Designing for scale with PaaS
June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 11
Scale
Instance
Orders Role
Cloud Services
Instance
InstanceInstance
InstanceInstance
InstanceInstance
Autoscaler
Message
Count > 1,
Add instance
Scale!
Designing for scale with PaaS
June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 12
Scale
| The good
| You need to define how it scales
| Provides you with scaling awareness
| The bad
| You need to define how it scales
| Hard to determine the perfect scaling rules
| The ugly
| Be aware of “flapping” (http://bit.ly/monitor-autoscale-best-practices)
| Be aware of infinite scaling loops
Use an Azure Monitor Autoscale
13
Scale
Node 1
Cluster
Node 2 Node 3
Pod
Pod
Pod
Pod
Pod
Pod
Pod
Pod
Pod
Pod
Pod
Pod
Pod
Pod
Pod
Designing for scale with CPaaS
Custom Metric
Provider
Horizontal Pod
Autoscaler(s)
Cluster
Autoscaler
14
Node 1
Cluster
Node 2 Node 3
Pod
Pod Pod
Pod
Pod
Pod
Pod
PodPod
Custom Metric
Provider
Horizontal Pod
Autoscaler(s)
Virtual Kubelet
Azure Container Instances
Container Group
Pod
Container Group
Pod
Container Group
Pod
Designing for scale with CPaaS
June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 15
Scale
| The good
| Share resources across different teams
| Serverless scaling capabilities are available with Virtual Kubelet & Virtual Nodes
| The bad
| You are in charge of providing enough resources
| With great power, comes great responsibilities
| No autoscaling out-of-the-box
| Scaling on different levels
| Scaling can become complex(er)
| The ugly
| Takes a lot of effort to ramp up on how to scale
| There’s a lot to manage
16
Application autoscaling made simple with
Kubernetes Event-driven Autoscaling (KEDA)
Event-driven & Azure Functions Support
Vendor-Agnostic & Built-in Scalers
Save resources with scale to 0
Multiple Workload Types
Focus on your app scaling, not the scaling internals
17
Scale
Node 1
Cluster
Node 2 Node 3
Pod
Pod
Pod
Pod
Pod
Pod
Pod
Pod
Pod
Pod
Pod
Pod
Designing for scale with CPaaS
Cluster
Autoscaler
Custom Metric
Provider
Horizontal Pod
Autoscaler(s)
18
Use the tool that fits your needs
Don’t use a service because you know it, evaluate your options
Every technology has its trade-offs, learn them
Don’t overengineer, “because we’ll need it later”
You don’t need hyper scale from day I
Create awareness around your autoscaling
June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 19
Scale
| Avoid burning money, get notified before it’s too late!
| Gain insights in your autoscaling rules
| Either configured by you or managed by Azure (ie. Azure Functions)
| Learn from them and tweak them
| Detect autoscaling loops in TEST instead of during live-site issue
| Choose the approach that fits your needs
| Configure Azure Monitor notifications
| Use built-in metrics to visualize and alert on
| Provide your own tooling around it
Create awareness around your autoscaling
June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 20
Scale
Tips
June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 21
Scale
| Resource consolidation pattern does not play nice with autoscaling
| Configure maximum instance count for your autoscaling
| Provide representable metrics of your remaining work
| Azure Monitor Autoscale is a hidden gem in Azure, use it!
| Does all the great things an autoscaler should do
| Use budget alerts, if feasible
Tenancy
22
23
Multi-tenancy is all about choices
How will you deploy your application?
How much isolation does it require between tenants? How much customization will we allow?
Do our tenants need access to their data?
Will it run in multiple regions?
Will one region require multiple deployments?
What is our pricing model?
Do we need to reflect this in our tenancy?
Multi-tenancy is more than data sharding
Choosing a tenancy model
24
Tenancy
App Stamp A Stamp B
Stamp C Stamp D
App
Tenant A
App
Tenant B
#n…#1 #n…#1BA
Full isolation between tenants by
deploying everything for every tenant
Run a multi-tenant application, but use
sharded data layer
App deployed in multiple stamps &
geographies with sharded data layer
Choosing a sharding strategy
25
Tenancy
| Spread all your data across multiple smaller databases instead of one big one
| Good example of scaling out to handle load
| A shard key is used to determine the shard based on the chosen strategy
| Choose your strategy wisely and think about your query patterns
| Does your customer need access to it? Then you should shard per tenant!
| You cannot easily change your strategy later on
| More information: http://bit.ly/sharding-pattern
June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure
Locating shards
June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 26
Tenancy
Shard
Manager
How do I connect to “Sello”?
Order
Processor
#5#4#3#2#1 #6 #7 #8
Use this connection string
Get Secret
“Sql-Tenant-Sello”
Using shard managers
27
Tenancy
| Provide catalog of all shard in the platform
| Determine current shard based on shard key & chosen approach
| Metadata is stored in a store of choice
| Be careful where you store your secrets
| Choosing a good shard manager
| They should handle secrets in a secure manner
| Build your own, ie on top of Azure Key Vault
| Use existing tool, ie Azure SQL Database Elastic Tools
June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure
Cost-efficient sharding
28
Tenancy
#5#4#3#2#1 #6 #7 #8
Elastic Pool
| In a PaaS world you need to pay for every data store instance you have.
S1–5%
S1–15%
S1–5%
S1–25%
S1–50%
S1–7%
S1–21%
S1–41%
Use an Azure SQL Elastic Pools
| We pay ~€200 for 160 DTU, but only use ~20 % of it
Cost-efficient sharding
June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 29
Tenancy
#5#4#3#2#1 #6 #7 #8
Elastic Pool
| Resource pools have a resource limit for all shards
7DTU
15DTU
8DTU
25DTU
24DTU
7DTU
40DTU
21DTU
93DTU
I need more resources!!!
We ran out, we only
have 200 DTU
25DTU
Cost-efficient sharding
June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 30
Tenancy
#5#4#3#2#1 #6 #7 #8
Elastic Pool
| Enforce resource limitation on a per-shard level
7DTU
15DTU
8DTU
25DTU
24DTU
7DTU
40DTU
21DTU
50DTU
I need more resources!!!
You’ve had enough
37DTU
| Provide multiple resource pools to reduce impact of noisy neighbors
Cost-efficient sharding
June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 31
Tenancy
#5#4#3#2#1 #6 #7 #8
Resource Pool A Resource Pool B Resource Pool C
7DTU
15DTU
8DTU
24DTU
7DTU
21DTU
50DTU
37DTU
7DTU
15DTU
8DTU
24DTU
7DTU
37DTU
| Reflect your pricing model in your resource pooling
Cost-efficient sharding
June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 32
Tenancy
#5#4#3#2#1 #6 #7 #8
Basic Pool
37DTU
24DTU
5DTU
51DTU
63DTU
77DTU
158DTU
121DTU
Standard Pool Premium Pool
Provision 250 Standard DTUs , capped at 100Provision 100 Basic DTUs , capped at 50 Provision 500 Premium DTUs,
capped at 250
Cost-efficient sharding
June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 33
| Consider moving all shards in a resource pool
| Configure maximum consumption per database
| Consider using multiple resource pools to reduce impact of noisy neighbor
| Resource pools are a great way to reflect your pricing model
| Monitor your pools as you would do for individual databases
Tenancy
Determining tenants
June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 34
| Determining the tenant that is consuming your service via your API gateway
| Map the authentication key to the registered application and use its context
Tenancy
API
Gateway
API
DB
POST api/v1/orders
X-API-Key ABC
POST api/v1/orders
X-Tenant Sello
Shard
Manager
What shard is “Sello”?
Bill Bracket owns ABC.
Part of “Sello” group
Determining tenants
June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure
Tenancy
<policies>
<inbound>
<base/>
<set-header name="X-Tenant" exists-action="override">
<value>
@(string.Join(";", (from item in context.User.Groups where
item.Name.ToLower().Contains("sello -") select item.Name.Replace("Sello - ", String.Empty).Trim())))
</value>
</set-header>
</inbound>
<backend>
<base/>
</backend>
<outbound>
<base/>
</outbound>
<on-error>
<base/>
</on-error>
</policies>
Monitoring
36
37
38
39
Monitoring is a shared responsibility
You only value good monitoring, if you’ve been on the other side of the fence
Train your developers to use their own toolchain,
use automated tests on live infrastructure
40
Enrich your telemetry
Correlated all your telemetry to provide a logical flow, not just traces
Provide app-specific contextual information to all telemetry
Always return your correlation ids to your consumers
Never track personal identifiable information
Use different layers of correlation ids
Use consistent terminology
Correlate your telemetry
41
Monitoring
Frontend API
Order
Processor
DB
Get Products
Create Order
Operation ABC
Operation DEF
Transaction / Session XYZ
June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure
Correlate your telemetry
42
Monitoring
Frontend API
Order
Processor
DB
Get Products
Create Order
Operation ABC
Operation DEF
Transaction / Session XYZ
Cycle 123
June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure
43
Health checks
No direct business value, until it’s too late
Report status of your application - Is my application healthy? Is it ready?
Use them to verify deployments, measure latency, up time, cold start, …
Always provide throttling to block noisy consumers
Think about your connection management
Go as far as you want
44
Health checks
Handling alerts
June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 45
| Always automate alert creation, they are part of your infrastructure as well
| Build a centralized alert handling process
| Azure Logic Apps is a good fit for this
| Different alerts have different contracts
| Use adapters to receive notifications
| Map to internal metric contract
| Handle via centralized alert handler
Monitoring
Azure Monitor
Classic Alert
Adapter
Azure Monitor
Metrics Alert
Adapter
Centralized
Alert Handler
Azure Monitor
Common Alert
Adapter
Handling alerts
June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 46
| Use the Logic App template for Azure Monitor!
Monitoring
47
Write Root Cause Analysis (RCA)
Train your team for PROD outages, write RCAs in all environments
Did our alerts detect it? Did we have enough telemetry?
Provides a structured way of analysing your platform
Use as a knowledge transfer to customers & team
Define action points and follow-up on them
Use them to detect recurring issues
There is no such thing as failure, only opportunities to learn
Webhooks
48
Consuming webhooks
June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 49
| Generated URLs are evil, provide good DNS names of your services
| And this goes for everything, not only webhooks
Webhooks
API
(12345.provider.com)
3rd
Party
POST https://12345.provider.com/api/webhooks
Where did
123456 go?!
API
(67890.provider.com)
Use an API Gateway
Consuming webhooks
June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 50
| Do not reduce your API security because of your 3rd Party
Webhooks
API
(12345.provider.com)
3rd
Party
POST http://12345.provider.com/api/webhooks
Where is
your cert?
Use an API Gateway
Consuming webhooks
June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 51
| Always route webhooks through an API gateway
| This decouples the webhook from your internal architecture
Webhooks
API
Gateway
API
3rd
Party
POST http://sello.com/api/v1/webhooks POST https://sello.provider.com/api/v1/webhooks
Authentication: Certificate
Consuming webhooks
June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 52
| Always route webhooks through an API gateway
| This decouples the webhook from your internal architecture
Webhooks
API
Gateway
Orders
API
3rd
Party
POST http://sello.com/api/v1/webhooks
POST https://orders.sello.provider.com/api/v1/webhooks
Authentication: Certificate
Stock
APISome gateways support auth
key via query parameters
53
Provide user-friendly webhooks
Think as a webhook consumer, not publisher.
Provide a way for consumers to provide context during registration
Provide a self-service CRUD API to register new subscriptions
Pass your correlation id via Request-Id header
Provide an invocation history
Spaghetti infrastructure 2.0?
June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 54
Webhooks
Warehouse
Service
Order
Service
Stock
Service
Shipping
Service
Invoice
Service
Payment
Service
Spaghetti infrastructure 2.0?
June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 55
| Long-term this can start to become a burden
| A lot of bookkeeping to know who to update, how we should authenticate, etc
| No central place to route all webhooks through
| Your platform needs to be robust
| What if subscriber II is not responding? Let’s build a retry mechanism!
| Who says subscriber II owns foo.bar.com?
| Webhooks should use a “I don’t care, here’s an update” approach
Webhooks
Event Routers
June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 56
Webhooks
Warehouse
Service
Order
Service
Stock
Service
Shipping
Service
Invoice
Service
Payment
Service
Event
Router
Event Routers
June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 57
| Event Routers do all the heavy lifting for you
| Provide a centralized hub for all things events
| Bookkeeping of whom subscribes to what webhooks and events
| They will retry sending events when they did not reply
| They will perform webhook validations
| Publishers can publish events to the event router and takes it from there
| Great for for internal usage, but harder to use with 3rd parties
| Webhook validation is not always easy to setup
Webhooks
Tips
June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 58
| Webhooks are not durable, if you are not around you will miss it.
| If you need to ensure at-least-once delivery, consider using a broker instead
| Store audit entry of webhook that are being pushed
| Can be important in case of a dispute
| Optionally even include the response of the consumer
| Do not only allow global registrations, consider serving more granular updates
| For example, I want updates of one flight instead of all flights
| Provide rate limiting on your webhook endpoints
| Don’t let your platform go down by your 3rd party provider
| Webhooks are contracts as well
| Provide good documentation and version them
Webhooks
59
Use Webhooks & Events internally
Build fully automated reactive applications / data ingestion pipelines
Decouple teams from each other
Provide capability to extend
June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 60
Azure Event Grid, the heart of Azure
61
Example
| Azure Key Vault provides native Event Grid Events (preview)
| This provides the capability to fully automate certificate management
| The power of these events can leverage closer integration by other services such as
Azure App Services, API Management who can consume latest version of cert
https://www.codit.eu/blog/azure-event-grid-the-heart-of-azure/
62
No.
Embrace Change
63
64
65
How we used to ship
Stable releases every few years
Hard to shift product focus
66
And then came agile…
67
DevOps
Releasing Software to Production
multiple times a day
6868
DevOops
69
You are not Netflix
Manual interventions are evil, automate (as much as possible)
Create automated pipelines for shipping software
(deployment rings are awesome)
Use infrastructure/build as code
DevOps is a culture and requires a mind shift
70
We live in a world of constant change
Our underlying infrastructure is constantly moving & changing
Cloud vendors are competing to offer unique services
Staying up to date is a lot harder
71
Who knows these services?
Service Bus for Windows Server
Azure BizTalk Services
Azure Hybrid Connection
Azure Alerts
Azure Access Control Service
Azure Container Services
Azure Data Factory v1
Azure RemoteApp
The lifecycle of a service
72
Embrace Change
Private Preview
• Rough version of
product
• Shared under NDA to
limited group
Public Preview
• Available to the masses
General Available
• Covered by SLA
• Supported version
The End
• Deprecation
• Silent Sunsetting
• Reincarnation in 2.0
The end of the road
73
Embrace Change
| Official deprecation
| Officially announced as deprecated
| Migration is required before service shutdown
| Reincarnation
| A new version of the service arises in a new version
| Can be part of service or service in total
| Silent deprecation
| No further development in the product
| Service is still running smoothly
| Does not mean you should stop using it
Azure Access Control Service,
Azure Scheduler
Azure Data Factory (Service)
Azure Functions (Host)
Azure Cloud Services?
Can also be tooling cfr.
Azure DevOps Cloud-
based Loadtesting
74
Choosing an Alternative
75
Let’s use the shiny one, right?!
Maybe.
76
Choosing an Alternative
There is no silver bullet
Use the tool that fits your needs, not perse what you know
Be careful with the latest shiny technology
Decide as a team
Build or buy
77
Questions you should ask
What is the learning curve? Is it worthwhile?
Does it have a vendor lock-in?
Is it operable?
Does it have a future?
78
79
App portability is essential
80
Code - .NET Core
Packaging – Containers
Hosting - Open Application Model (OAM)
Eventing &
Webhooks
CloudEvents
Service-to-Service
Service Mesh
Interface (SMI)
App Portability Toolbelt
81
82
83
You learn by doing
And sometimes, you regret your choices.
84
Cloud platforms are never finished
Your platform evolves, and so does its needs
Prepare for your migrations
Nothing is written in stone
Use a product mindset
Change is coming, so you’d better be prepared
85
Stay up to date with Azure Deprecation Notic
Dashboard with deprecation notices concerning Azure services,
regions, features, APIs and SDKs
Search for services which you depend on
@AzureEndOfLife on Twitter
https://github.com/azure-deprecation/dashboard
Conclusion
86
87
Conclusion
Technologies have scalability capabilities & trade-offs
Provide user-friendly webhooks & route them via API gateways
Define & roll out a good monitoring strategy
Automate everything, it will save you one day
You build it, you run it
We live in a world of constant change, so be prepared

More Related Content

What's hot

AWS re:Invent 2019
AWS re:Invent 2019AWS re:Invent 2019
AWS re:Invent 2019
Craig Milroy
 
Track 6 Session 5_ 如何藉由物聯網 (IoT) 與機器學習提高預測性維修與產品良率.pptx
Track 6 Session 5_ 如何藉由物聯網 (IoT) 與機器學習提高預測性維修與產品良率.pptxTrack 6 Session 5_ 如何藉由物聯網 (IoT) 與機器學習提高預測性維修與產品良率.pptx
Track 6 Session 5_ 如何藉由物聯網 (IoT) 與機器學習提高預測性維修與產品良率.pptx
Amazon Web Services
 

What's hot (15)

Microsoft Azure News - Nov 2020
Microsoft Azure News - Nov 2020Microsoft Azure News - Nov 2020
Microsoft Azure News - Nov 2020
 
tell us which cloud you prefer
tell us which cloud you prefertell us which cloud you prefer
tell us which cloud you prefer
 
AWS Lambda: Best Practices and Common Mistakes - AWS Community Days 2019
AWS Lambda: Best Practices and Common Mistakes - AWS Community Days 2019AWS Lambda: Best Practices and Common Mistakes - AWS Community Days 2019
AWS Lambda: Best Practices and Common Mistakes - AWS Community Days 2019
 
Cloud Computing for the Enterprise
Cloud Computing for the EnterpriseCloud Computing for the Enterprise
Cloud Computing for the Enterprise
 
10 Best Practices for Reducing Spend in AWS
10 Best Practices for Reducing Spend in AWS10 Best Practices for Reducing Spend in AWS
10 Best Practices for Reducing Spend in AWS
 
Microsoft Azure News - October 2019
Microsoft Azure News - October 2019Microsoft Azure News - October 2019
Microsoft Azure News - October 2019
 
AWS re:Invent 2019
AWS re:Invent 2019AWS re:Invent 2019
AWS re:Invent 2019
 
Azure DevOps työkalut - Roundtable 14.3.2019
Azure DevOps työkalut - Roundtable 14.3.2019Azure DevOps työkalut - Roundtable 14.3.2019
Azure DevOps työkalut - Roundtable 14.3.2019
 
Track 6 Session 5_ 如何藉由物聯網 (IoT) 與機器學習提高預測性維修與產品良率.pptx
Track 6 Session 5_ 如何藉由物聯網 (IoT) 與機器學習提高預測性維修與產品良率.pptxTrack 6 Session 5_ 如何藉由物聯網 (IoT) 與機器學習提高預測性維修與產品良率.pptx
Track 6 Session 5_ 如何藉由物聯網 (IoT) 與機器學習提高預測性維修與產品良率.pptx
 
Amazon SageMaker workshop
Amazon SageMaker workshopAmazon SageMaker workshop
Amazon SageMaker workshop
 
The Future of Cloud Innovation, featuring Adrian Cockcroft
The Future of Cloud Innovation, featuring Adrian CockcroftThe Future of Cloud Innovation, featuring Adrian Cockcroft
The Future of Cloud Innovation, featuring Adrian Cockcroft
 
Amx202 l Building Your CA Service Management Solution on AWS
Amx202 l   Building Your CA Service Management Solution on AWSAmx202 l   Building Your CA Service Management Solution on AWS
Amx202 l Building Your CA Service Management Solution on AWS
 
Modernizing on EKS (Keynote)- AWS Container Day 2019 Barcelona
Modernizing on EKS (Keynote)- AWS Container Day 2019 BarcelonaModernizing on EKS (Keynote)- AWS Container Day 2019 Barcelona
Modernizing on EKS (Keynote)- AWS Container Day 2019 Barcelona
 
Data Summer Conf 2018, “Build, train, and deploy machine learning models at s...
Data Summer Conf 2018, “Build, train, and deploy machine learning models at s...Data Summer Conf 2018, “Build, train, and deploy machine learning models at s...
Data Summer Conf 2018, “Build, train, and deploy machine learning models at s...
 
Hello Cloud
Hello CloudHello Cloud
Hello Cloud
 

Similar to IglooConf 2020 - Adventures of building a multi-tenant PaaS on Microsoft Azure

Azure development
Azure developmentAzure development
Azure development
wseye
 

Similar to IglooConf 2020 - Adventures of building a multi-tenant PaaS on Microsoft Azure (20)

Integrate UK 2019 - Adventures of building a (multi-tenant) PaaS on Microsoft...
Integrate UK 2019 - Adventures of building a (multi-tenant) PaaS on Microsoft...Integrate UK 2019 - Adventures of building a (multi-tenant) PaaS on Microsoft...
Integrate UK 2019 - Adventures of building a (multi-tenant) PaaS on Microsoft...
 
Techdays Finland 2019 - Adventures of building a (multi-tenant) PaaS on Micro...
Techdays Finland 2019 - Adventures of building a (multi-tenant) PaaS on Micro...Techdays Finland 2019 - Adventures of building a (multi-tenant) PaaS on Micro...
Techdays Finland 2019 - Adventures of building a (multi-tenant) PaaS on Micro...
 
Cloud Computing and the Microsoft Developer - A Down-to-Earth Analysis
Cloud Computing and the Microsoft Developer - A Down-to-Earth AnalysisCloud Computing and the Microsoft Developer - A Down-to-Earth Analysis
Cloud Computing and the Microsoft Developer - A Down-to-Earth Analysis
 
Microsoft Azure News - December 2019
Microsoft Azure News - December 2019Microsoft Azure News - December 2019
Microsoft Azure News - December 2019
 
Modernizing Integrations
Modernizing IntegrationsModernizing Integrations
Modernizing Integrations
 
Architecting multi-cloud ready applications
Architecting multi-cloud ready applicationsArchitecting multi-cloud ready applications
Architecting multi-cloud ready applications
 
Better Software is Better than Worse Software - Vince Russo
Better Software is  Better than Worse Software - Vince RussoBetter Software is  Better than Worse Software - Vince Russo
Better Software is Better than Worse Software - Vince Russo
 
TechEvent 2019: More Agile, More AI, More Cloud! Less Work?!; Oliver Dörr - T...
TechEvent 2019: More Agile, More AI, More Cloud! Less Work?!; Oliver Dörr - T...TechEvent 2019: More Agile, More AI, More Cloud! Less Work?!; Oliver Dörr - T...
TechEvent 2019: More Agile, More AI, More Cloud! Less Work?!; Oliver Dörr - T...
 
Cloud Computing101 Azure, updated june 2017
Cloud Computing101 Azure, updated june 2017Cloud Computing101 Azure, updated june 2017
Cloud Computing101 Azure, updated june 2017
 
DevCamp - What can the cloud do for me
DevCamp - What can the cloud do for meDevCamp - What can the cloud do for me
DevCamp - What can the cloud do for me
 
Seven Criteria for Building an AWS Global Transit Network
Seven Criteria for Building an AWS Global Transit NetworkSeven Criteria for Building an AWS Global Transit Network
Seven Criteria for Building an AWS Global Transit Network
 
Level Up Your Amazon OpenSearch Cluster in a Week
Level Up Your Amazon OpenSearch Cluster in a WeekLevel Up Your Amazon OpenSearch Cluster in a Week
Level Up Your Amazon OpenSearch Cluster in a Week
 
Azure Data.pptx
Azure Data.pptxAzure Data.pptx
Azure Data.pptx
 
From legacy to Azure Service Fabric in 360h. Odessa.
From legacy to Azure Service Fabric in 360h. Odessa.From legacy to Azure Service Fabric in 360h. Odessa.
From legacy to Azure Service Fabric in 360h. Odessa.
 
Cloud architecture - Azure - AWS
Cloud architecture - Azure - AWSCloud architecture - Azure - AWS
Cloud architecture - Azure - AWS
 
Azure development
Azure developmentAzure development
Azure development
 
ITU Cekirdek Mini MBA Seminar - Business & Technology Perspectives for the Sc...
ITU Cekirdek Mini MBA Seminar - Business & Technology Perspectives for the Sc...ITU Cekirdek Mini MBA Seminar - Business & Technology Perspectives for the Sc...
ITU Cekirdek Mini MBA Seminar - Business & Technology Perspectives for the Sc...
 
Microsoft Azure - Planning your move to the cloud
Microsoft Azure - Planning your move to the cloudMicrosoft Azure - Planning your move to the cloud
Microsoft Azure - Planning your move to the cloud
 
AWS Summit Stockholm 2014 – B1 – Building a cloud ready it team
AWS Summit Stockholm 2014 – B1 – Building a cloud ready it teamAWS Summit Stockholm 2014 – B1 – Building a cloud ready it team
AWS Summit Stockholm 2014 – B1 – Building a cloud ready it team
 
Microsoft Azure News - 2018 June
Microsoft Azure News - 2018 JuneMicrosoft Azure News - 2018 June
Microsoft Azure News - 2018 June
 

More from Tom Kerkhove

More from Tom Kerkhove (20)

Techorama 2022 - Adventures of building Promitor, an open-source product
Techorama 2022 - Adventures of building Promitor, an open-source productTechorama 2022 - Adventures of building Promitor, an open-source product
Techorama 2022 - Adventures of building Promitor, an open-source product
 
Microsoft Partners - Application Autoscaling Made Easy With Kubernetes Event-...
Microsoft Partners - Application Autoscaling Made Easy With Kubernetes Event-...Microsoft Partners - Application Autoscaling Made Easy With Kubernetes Event-...
Microsoft Partners - Application Autoscaling Made Easy With Kubernetes Event-...
 
Introduction to Promitor
Introduction to PromitorIntroduction to Promitor
Introduction to Promitor
 
Azure Lowlands 2020 - API management for microservices in a hybrid and multi-...
Azure Lowlands 2020 - API management for microservices in a hybrid and multi-...Azure Lowlands 2020 - API management for microservices in a hybrid and multi-...
Azure Lowlands 2020 - API management for microservices in a hybrid and multi-...
 
NDC London 2021 - Application Autoscaling Made Easy With Kubernetes Event-Dri...
NDC London 2021 - Application Autoscaling Made Easy With Kubernetes Event-Dri...NDC London 2021 - Application Autoscaling Made Easy With Kubernetes Event-Dri...
NDC London 2021 - Application Autoscaling Made Easy With Kubernetes Event-Dri...
 
Global Azure Virtual - Application Autoscaling with KEDA
Global Azure Virtual - Application Autoscaling with KEDAGlobal Azure Virtual - Application Autoscaling with KEDA
Global Azure Virtual - Application Autoscaling with KEDA
 
AZUG Lightning Talk - Application autoscaling on Kubernetes with Kubernetes E...
AZUG Lightning Talk - Application autoscaling on Kubernetes with Kubernetes E...AZUG Lightning Talk - Application autoscaling on Kubernetes with Kubernetes E...
AZUG Lightning Talk - Application autoscaling on Kubernetes with Kubernetes E...
 
IglooConf 2020 - API management for microservices in a hybrid and multi-cloud...
IglooConf 2020 - API management for microservices in a hybrid and multi-cloud...IglooConf 2020 - API management for microservices in a hybrid and multi-cloud...
IglooConf 2020 - API management for microservices in a hybrid and multi-cloud...
 
Microsoft Ignite 2019 - API management for microservices in a hybrid and mult...
Microsoft Ignite 2019 - API management for microservices in a hybrid and mult...Microsoft Ignite 2019 - API management for microservices in a hybrid and mult...
Microsoft Ignite 2019 - API management for microservices in a hybrid and mult...
 
Azure Low Lands 2019 - Building secure cloud applications with Azure Key Vault
Azure Low Lands 2019 - Building secure cloud applications with Azure Key VaultAzure Low Lands 2019 - Building secure cloud applications with Azure Key Vault
Azure Low Lands 2019 - Building secure cloud applications with Azure Key Vault
 
Next Generation Data Integration with Azure Data Factory
Next Generation Data Integration with Azure Data FactoryNext Generation Data Integration with Azure Data Factory
Next Generation Data Integration with Azure Data Factory
 
Intelligent Cloud Conference 2018 - Automatically scaling Kubernetes pods bas...
Intelligent Cloud Conference 2018 - Automatically scaling Kubernetes pods bas...Intelligent Cloud Conference 2018 - Automatically scaling Kubernetes pods bas...
Intelligent Cloud Conference 2018 - Automatically scaling Kubernetes pods bas...
 
Intelligent Cloud Conference 2018 - Building secure cloud applications with A...
Intelligent Cloud Conference 2018 - Building secure cloud applications with A...Intelligent Cloud Conference 2018 - Building secure cloud applications with A...
Intelligent Cloud Conference 2018 - Building secure cloud applications with A...
 
Intelligent Cloud Conference 2018 - Next Generation of Data Integration with ...
Intelligent Cloud Conference 2018 - Next Generation of Data Integration with ...Intelligent Cloud Conference 2018 - Next Generation of Data Integration with ...
Intelligent Cloud Conference 2018 - Next Generation of Data Integration with ...
 
NDC Minnesota - Analyzing StackExchange data with Azure Data Lake
NDC Minnesota - Analyzing StackExchange data with Azure Data LakeNDC Minnesota - Analyzing StackExchange data with Azure Data Lake
NDC Minnesota - Analyzing StackExchange data with Azure Data Lake
 
Techdays Finland 2018 - Building secure cloud applications with Azure Key Vault
Techdays Finland 2018 - Building secure cloud applications with Azure Key VaultTechdays Finland 2018 - Building secure cloud applications with Azure Key Vault
Techdays Finland 2018 - Building secure cloud applications with Azure Key Vault
 
NDC Sydney - Analyzing StackExchange with Azure Data Lake
NDC Sydney - Analyzing StackExchange with Azure Data LakeNDC Sydney - Analyzing StackExchange with Azure Data Lake
NDC Sydney - Analyzing StackExchange with Azure Data Lake
 
TechDays NL 2016 - Building your scalable secure IoT Solution on Azure
TechDays NL 2016 - Building your scalable secure IoT Solution on AzureTechDays NL 2016 - Building your scalable secure IoT Solution on Azure
TechDays NL 2016 - Building your scalable secure IoT Solution on Azure
 
Integration Monday - Analysing StackExchange data with Azure Data Lake
Integration Monday - Analysing StackExchange data with Azure Data LakeIntegration Monday - Analysing StackExchange data with Azure Data Lake
Integration Monday - Analysing StackExchange data with Azure Data Lake
 
ITProceed 2015 - Securing Sensitive Data with Azure Key Vault
ITProceed 2015 - Securing Sensitive Data with Azure Key VaultITProceed 2015 - Securing Sensitive Data with Azure Key Vault
ITProceed 2015 - Securing Sensitive Data with Azure Key Vault
 

Recently uploaded

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
Safe Software
 
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
panagenda
 

Recently uploaded (20)

Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
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
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
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...
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
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
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
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
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
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...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
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
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

IglooConf 2020 - Adventures of building a multi-tenant PaaS on Microsoft Azure

  • 1. Adventures of building a multi- tenant PaaS on Microsoft Azure Tom Kerkhove - Azure Architect at Codit, Azure MVP Maintainer of Promitor,
  • 2. Azure Architect Microsoft Azure MVP & Advisor Writes on blog.tomkerkhove.be Maintainer of Promitor, KEDA & Arcus Hi, I’m Tom Kerkhove 2 @TomKerkhove tomkerkhove
  • 3. Disclaimer You’ll learn about my adventures & findings, not about silver bullets 3
  • 5. Scale up/down June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 5 Scale | Easiest way of scaling is to get a bigger box | The only trade-off is that it means your app will be unavailable for a while | At some point you’ll run out of “bigger boxes”
  • 6. Scale out / in June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 6 Scale | Provide multiple copies of your application based on your workload | No impact on your uptime, but more complex | My preferred way of scaling, but your application needs to be designed for it
  • 7. Choose the right compute infrastructure June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 7 Functions Functions Container Instances Service Service Fabric Mesh Cloud Services App Service Fabric Kubernetes Cluster VM Scale Sets VMs Bare Metal | As control increases, so does complexity | Every service has it’s own characteristics | How you run your application | How you package your application | How you scale your application
  • 8. Designing for scale June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 8 Scale Order Function Order Function Order Function Order Function Order Function Order Function Azure Functions
  • 9. Designing for scale with serverless June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 9 Scale | The good | The service handles scaling for you | The bad | The service handles scaling for you | Does not provide a lot of awareness | The ugly | Dangerous to burn a lot of money
  • 10. June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 10 Source: http://blog.tdwright.co.uk/2018/09/06/beware-runonstartup-in-azure-functions-a-serverless-horror-story/
  • 11. Designing for scale with PaaS June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 11 Scale Instance Orders Role Cloud Services Instance InstanceInstance InstanceInstance InstanceInstance Autoscaler Message Count > 1, Add instance Scale!
  • 12. Designing for scale with PaaS June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 12 Scale | The good | You need to define how it scales | Provides you with scaling awareness | The bad | You need to define how it scales | Hard to determine the perfect scaling rules | The ugly | Be aware of “flapping” (http://bit.ly/monitor-autoscale-best-practices) | Be aware of infinite scaling loops Use an Azure Monitor Autoscale
  • 13. 13 Scale Node 1 Cluster Node 2 Node 3 Pod Pod Pod Pod Pod Pod Pod Pod Pod Pod Pod Pod Pod Pod Pod Designing for scale with CPaaS Custom Metric Provider Horizontal Pod Autoscaler(s) Cluster Autoscaler
  • 14. 14 Node 1 Cluster Node 2 Node 3 Pod Pod Pod Pod Pod Pod Pod PodPod Custom Metric Provider Horizontal Pod Autoscaler(s) Virtual Kubelet Azure Container Instances Container Group Pod Container Group Pod Container Group Pod
  • 15. Designing for scale with CPaaS June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 15 Scale | The good | Share resources across different teams | Serverless scaling capabilities are available with Virtual Kubelet & Virtual Nodes | The bad | You are in charge of providing enough resources | With great power, comes great responsibilities | No autoscaling out-of-the-box | Scaling on different levels | Scaling can become complex(er) | The ugly | Takes a lot of effort to ramp up on how to scale | There’s a lot to manage
  • 16. 16 Application autoscaling made simple with Kubernetes Event-driven Autoscaling (KEDA) Event-driven & Azure Functions Support Vendor-Agnostic & Built-in Scalers Save resources with scale to 0 Multiple Workload Types Focus on your app scaling, not the scaling internals
  • 17. 17 Scale Node 1 Cluster Node 2 Node 3 Pod Pod Pod Pod Pod Pod Pod Pod Pod Pod Pod Pod Designing for scale with CPaaS Cluster Autoscaler Custom Metric Provider Horizontal Pod Autoscaler(s)
  • 18. 18 Use the tool that fits your needs Don’t use a service because you know it, evaluate your options Every technology has its trade-offs, learn them Don’t overengineer, “because we’ll need it later” You don’t need hyper scale from day I
  • 19. Create awareness around your autoscaling June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 19 Scale | Avoid burning money, get notified before it’s too late! | Gain insights in your autoscaling rules | Either configured by you or managed by Azure (ie. Azure Functions) | Learn from them and tweak them | Detect autoscaling loops in TEST instead of during live-site issue | Choose the approach that fits your needs | Configure Azure Monitor notifications | Use built-in metrics to visualize and alert on | Provide your own tooling around it
  • 20. Create awareness around your autoscaling June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 20 Scale
  • 21. Tips June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 21 Scale | Resource consolidation pattern does not play nice with autoscaling | Configure maximum instance count for your autoscaling | Provide representable metrics of your remaining work | Azure Monitor Autoscale is a hidden gem in Azure, use it! | Does all the great things an autoscaler should do | Use budget alerts, if feasible
  • 23. 23 Multi-tenancy is all about choices How will you deploy your application? How much isolation does it require between tenants? How much customization will we allow? Do our tenants need access to their data? Will it run in multiple regions? Will one region require multiple deployments? What is our pricing model? Do we need to reflect this in our tenancy? Multi-tenancy is more than data sharding
  • 24. Choosing a tenancy model 24 Tenancy App Stamp A Stamp B Stamp C Stamp D App Tenant A App Tenant B #n…#1 #n…#1BA Full isolation between tenants by deploying everything for every tenant Run a multi-tenant application, but use sharded data layer App deployed in multiple stamps & geographies with sharded data layer
  • 25. Choosing a sharding strategy 25 Tenancy | Spread all your data across multiple smaller databases instead of one big one | Good example of scaling out to handle load | A shard key is used to determine the shard based on the chosen strategy | Choose your strategy wisely and think about your query patterns | Does your customer need access to it? Then you should shard per tenant! | You cannot easily change your strategy later on | More information: http://bit.ly/sharding-pattern June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure
  • 26. Locating shards June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 26 Tenancy Shard Manager How do I connect to “Sello”? Order Processor #5#4#3#2#1 #6 #7 #8 Use this connection string Get Secret “Sql-Tenant-Sello”
  • 27. Using shard managers 27 Tenancy | Provide catalog of all shard in the platform | Determine current shard based on shard key & chosen approach | Metadata is stored in a store of choice | Be careful where you store your secrets | Choosing a good shard manager | They should handle secrets in a secure manner | Build your own, ie on top of Azure Key Vault | Use existing tool, ie Azure SQL Database Elastic Tools June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure
  • 28. Cost-efficient sharding 28 Tenancy #5#4#3#2#1 #6 #7 #8 Elastic Pool | In a PaaS world you need to pay for every data store instance you have. S1–5% S1–15% S1–5% S1–25% S1–50% S1–7% S1–21% S1–41% Use an Azure SQL Elastic Pools | We pay ~€200 for 160 DTU, but only use ~20 % of it
  • 29. Cost-efficient sharding June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 29 Tenancy #5#4#3#2#1 #6 #7 #8 Elastic Pool | Resource pools have a resource limit for all shards 7DTU 15DTU 8DTU 25DTU 24DTU 7DTU 40DTU 21DTU 93DTU I need more resources!!! We ran out, we only have 200 DTU 25DTU
  • 30. Cost-efficient sharding June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 30 Tenancy #5#4#3#2#1 #6 #7 #8 Elastic Pool | Enforce resource limitation on a per-shard level 7DTU 15DTU 8DTU 25DTU 24DTU 7DTU 40DTU 21DTU 50DTU I need more resources!!! You’ve had enough 37DTU
  • 31. | Provide multiple resource pools to reduce impact of noisy neighbors Cost-efficient sharding June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 31 Tenancy #5#4#3#2#1 #6 #7 #8 Resource Pool A Resource Pool B Resource Pool C 7DTU 15DTU 8DTU 24DTU 7DTU 21DTU 50DTU 37DTU 7DTU 15DTU 8DTU 24DTU 7DTU 37DTU
  • 32. | Reflect your pricing model in your resource pooling Cost-efficient sharding June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 32 Tenancy #5#4#3#2#1 #6 #7 #8 Basic Pool 37DTU 24DTU 5DTU 51DTU 63DTU 77DTU 158DTU 121DTU Standard Pool Premium Pool Provision 250 Standard DTUs , capped at 100Provision 100 Basic DTUs , capped at 50 Provision 500 Premium DTUs, capped at 250
  • 33. Cost-efficient sharding June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 33 | Consider moving all shards in a resource pool | Configure maximum consumption per database | Consider using multiple resource pools to reduce impact of noisy neighbor | Resource pools are a great way to reflect your pricing model | Monitor your pools as you would do for individual databases Tenancy
  • 34. Determining tenants June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 34 | Determining the tenant that is consuming your service via your API gateway | Map the authentication key to the registered application and use its context Tenancy API Gateway API DB POST api/v1/orders X-API-Key ABC POST api/v1/orders X-Tenant Sello Shard Manager What shard is “Sello”? Bill Bracket owns ABC. Part of “Sello” group
  • 35. Determining tenants June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure Tenancy <policies> <inbound> <base/> <set-header name="X-Tenant" exists-action="override"> <value> @(string.Join(";", (from item in context.User.Groups where item.Name.ToLower().Contains("sello -") select item.Name.Replace("Sello - ", String.Empty).Trim()))) </value> </set-header> </inbound> <backend> <base/> </backend> <outbound> <base/> </outbound> <on-error> <base/> </on-error> </policies>
  • 37. 37
  • 38. 38
  • 39. 39 Monitoring is a shared responsibility You only value good monitoring, if you’ve been on the other side of the fence Train your developers to use their own toolchain, use automated tests on live infrastructure
  • 40. 40 Enrich your telemetry Correlated all your telemetry to provide a logical flow, not just traces Provide app-specific contextual information to all telemetry Always return your correlation ids to your consumers Never track personal identifiable information Use different layers of correlation ids Use consistent terminology
  • 41. Correlate your telemetry 41 Monitoring Frontend API Order Processor DB Get Products Create Order Operation ABC Operation DEF Transaction / Session XYZ June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure
  • 42. Correlate your telemetry 42 Monitoring Frontend API Order Processor DB Get Products Create Order Operation ABC Operation DEF Transaction / Session XYZ Cycle 123 June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure
  • 43. 43 Health checks No direct business value, until it’s too late Report status of your application - Is my application healthy? Is it ready? Use them to verify deployments, measure latency, up time, cold start, … Always provide throttling to block noisy consumers Think about your connection management Go as far as you want
  • 45. Handling alerts June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 45 | Always automate alert creation, they are part of your infrastructure as well | Build a centralized alert handling process | Azure Logic Apps is a good fit for this | Different alerts have different contracts | Use adapters to receive notifications | Map to internal metric contract | Handle via centralized alert handler Monitoring Azure Monitor Classic Alert Adapter Azure Monitor Metrics Alert Adapter Centralized Alert Handler Azure Monitor Common Alert Adapter
  • 46. Handling alerts June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 46 | Use the Logic App template for Azure Monitor! Monitoring
  • 47. 47 Write Root Cause Analysis (RCA) Train your team for PROD outages, write RCAs in all environments Did our alerts detect it? Did we have enough telemetry? Provides a structured way of analysing your platform Use as a knowledge transfer to customers & team Define action points and follow-up on them Use them to detect recurring issues There is no such thing as failure, only opportunities to learn
  • 49. Consuming webhooks June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 49 | Generated URLs are evil, provide good DNS names of your services | And this goes for everything, not only webhooks Webhooks API (12345.provider.com) 3rd Party POST https://12345.provider.com/api/webhooks Where did 123456 go?! API (67890.provider.com) Use an API Gateway
  • 50. Consuming webhooks June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 50 | Do not reduce your API security because of your 3rd Party Webhooks API (12345.provider.com) 3rd Party POST http://12345.provider.com/api/webhooks Where is your cert? Use an API Gateway
  • 51. Consuming webhooks June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 51 | Always route webhooks through an API gateway | This decouples the webhook from your internal architecture Webhooks API Gateway API 3rd Party POST http://sello.com/api/v1/webhooks POST https://sello.provider.com/api/v1/webhooks Authentication: Certificate
  • 52. Consuming webhooks June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 52 | Always route webhooks through an API gateway | This decouples the webhook from your internal architecture Webhooks API Gateway Orders API 3rd Party POST http://sello.com/api/v1/webhooks POST https://orders.sello.provider.com/api/v1/webhooks Authentication: Certificate Stock APISome gateways support auth key via query parameters
  • 53. 53 Provide user-friendly webhooks Think as a webhook consumer, not publisher. Provide a way for consumers to provide context during registration Provide a self-service CRUD API to register new subscriptions Pass your correlation id via Request-Id header Provide an invocation history
  • 54. Spaghetti infrastructure 2.0? June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 54 Webhooks Warehouse Service Order Service Stock Service Shipping Service Invoice Service Payment Service
  • 55. Spaghetti infrastructure 2.0? June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 55 | Long-term this can start to become a burden | A lot of bookkeeping to know who to update, how we should authenticate, etc | No central place to route all webhooks through | Your platform needs to be robust | What if subscriber II is not responding? Let’s build a retry mechanism! | Who says subscriber II owns foo.bar.com? | Webhooks should use a “I don’t care, here’s an update” approach Webhooks
  • 56. Event Routers June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 56 Webhooks Warehouse Service Order Service Stock Service Shipping Service Invoice Service Payment Service Event Router
  • 57. Event Routers June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 57 | Event Routers do all the heavy lifting for you | Provide a centralized hub for all things events | Bookkeeping of whom subscribes to what webhooks and events | They will retry sending events when they did not reply | They will perform webhook validations | Publishers can publish events to the event router and takes it from there | Great for for internal usage, but harder to use with 3rd parties | Webhook validation is not always easy to setup Webhooks
  • 58. Tips June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 58 | Webhooks are not durable, if you are not around you will miss it. | If you need to ensure at-least-once delivery, consider using a broker instead | Store audit entry of webhook that are being pushed | Can be important in case of a dispute | Optionally even include the response of the consumer | Do not only allow global registrations, consider serving more granular updates | For example, I want updates of one flight instead of all flights | Provide rate limiting on your webhook endpoints | Don’t let your platform go down by your 3rd party provider | Webhooks are contracts as well | Provide good documentation and version them Webhooks
  • 59. 59 Use Webhooks & Events internally Build fully automated reactive applications / data ingestion pipelines Decouple teams from each other Provide capability to extend
  • 60. June 2019 Adventures of building a (multi-tenant) PaaS on Microsoft Azure 60
  • 61. Azure Event Grid, the heart of Azure 61 Example | Azure Key Vault provides native Event Grid Events (preview) | This provides the capability to fully automate certificate management | The power of these events can leverage closer integration by other services such as Azure App Services, API Management who can consume latest version of cert https://www.codit.eu/blog/azure-event-grid-the-heart-of-azure/
  • 64. 64
  • 65. 65 How we used to ship Stable releases every few years Hard to shift product focus
  • 66. 66 And then came agile…
  • 67. 67 DevOps Releasing Software to Production multiple times a day
  • 69. 69 You are not Netflix Manual interventions are evil, automate (as much as possible) Create automated pipelines for shipping software (deployment rings are awesome) Use infrastructure/build as code DevOps is a culture and requires a mind shift
  • 70. 70 We live in a world of constant change Our underlying infrastructure is constantly moving & changing Cloud vendors are competing to offer unique services Staying up to date is a lot harder
  • 71. 71 Who knows these services? Service Bus for Windows Server Azure BizTalk Services Azure Hybrid Connection Azure Alerts Azure Access Control Service Azure Container Services Azure Data Factory v1 Azure RemoteApp
  • 72. The lifecycle of a service 72 Embrace Change Private Preview • Rough version of product • Shared under NDA to limited group Public Preview • Available to the masses General Available • Covered by SLA • Supported version The End • Deprecation • Silent Sunsetting • Reincarnation in 2.0
  • 73. The end of the road 73 Embrace Change | Official deprecation | Officially announced as deprecated | Migration is required before service shutdown | Reincarnation | A new version of the service arises in a new version | Can be part of service or service in total | Silent deprecation | No further development in the product | Service is still running smoothly | Does not mean you should stop using it Azure Access Control Service, Azure Scheduler Azure Data Factory (Service) Azure Functions (Host) Azure Cloud Services? Can also be tooling cfr. Azure DevOps Cloud- based Loadtesting
  • 75. 75 Let’s use the shiny one, right?! Maybe.
  • 76. 76 Choosing an Alternative There is no silver bullet Use the tool that fits your needs, not perse what you know Be careful with the latest shiny technology Decide as a team Build or buy
  • 77. 77 Questions you should ask What is the learning curve? Is it worthwhile? Does it have a vendor lock-in? Is it operable? Does it have a future?
  • 78. 78
  • 80. 80 Code - .NET Core Packaging – Containers Hosting - Open Application Model (OAM) Eventing & Webhooks CloudEvents Service-to-Service Service Mesh Interface (SMI) App Portability Toolbelt
  • 81. 81
  • 82. 82
  • 83. 83 You learn by doing And sometimes, you regret your choices.
  • 84. 84 Cloud platforms are never finished Your platform evolves, and so does its needs Prepare for your migrations Nothing is written in stone Use a product mindset Change is coming, so you’d better be prepared
  • 85. 85 Stay up to date with Azure Deprecation Notic Dashboard with deprecation notices concerning Azure services, regions, features, APIs and SDKs Search for services which you depend on @AzureEndOfLife on Twitter https://github.com/azure-deprecation/dashboard
  • 87. 87 Conclusion Technologies have scalability capabilities & trade-offs Provide user-friendly webhooks & route them via API gateways Define & roll out a good monitoring strategy Automate everything, it will save you one day You build it, you run it We live in a world of constant change, so be prepared

Editor's Notes

  1. Get it out early and see if customers want this; if not, kill it
  2. Get it out early and see if customers want this; if not, kill it
  3. You will need to make big decisions up front, which can turn out to be bad ones – Be prepared!
  4. Ideally you have “session id”, “operation id” & “cycle id” Easier to troubleshoot in case of support cases
  5. Ideally you have “session id”, “operation id” & “cycle id” Easier to troubleshoot in case of support cases
  6. How could this have been prevented? Did we have enough telemetry & alerts? Who was impacted? Do we need to send out communications?
  7. This context will be delivered along with the effective payload Registering is one thing, opting-out or getting an overview is another story This can be important for migration reasons or in case of bugs causing bad subscriptions This helps consumers troubleshoot why events were not delivered Allow them to search on correlation id Would you like to consume your webhooks?
  8. Get it out early and see if customers want this; if not, kill it
  9. “This new technology fixes our problem!” and potentially gives you a lot of new ones Make sure it’s already stable
  10. “This new technology fixes our problem!” and potentially gives you a lot of new ones Make sure it’s already stable
  11. ADF vs SQL Agent