Building a SaaS based product in Azure - Challenges and decisions made

38
Saravana Kumar Microsoft Azure MVP (since 2007) Founder – BizTalk360, ServiceBus360 @saravanam v [email protected]

Transcript of Building a SaaS based product in Azure - Challenges and decisions made

Page 1: Building a SaaS based product in Azure - Challenges and decisions made

Saravana KumarMicrosoft Azure MVP (since 2007)Founder – BizTalk360, ServiceBus360@saravana

mv

[email protected]

Page 2: Building a SaaS based product in Azure - Challenges and decisions made

Building a SaaS based product in AzureChallenges and decisions made…

Page 3: Building a SaaS based product in Azure - Challenges and decisions made

Our SaaS Products

https://biztalk360.cloud https://servicesbus360.com

Page 4: Building a SaaS based product in Azure - Challenges and decisions made

What is a SaaS product?

Page 5: Building a SaaS based product in Azure - Challenges and decisions made

Key characteristics of SaaS products• Scalable – both technically and financially• Reliable - Cannot afford to have a downtime• Smooth on-boarding• Tenants are isolated• Less Time to troubleshoot and fix• Continuous delivery• Less friction on payment

Page 6: Building a SaaS based product in Azure - Challenges and decisions made

Main Azure Building Blocks

Azure App Services Azure Event Hubs

Azure WebjobsAzure SQL Elastic Pool

Azure Storage Azure Key Vault

Azure SQL Database

Page 7: Building a SaaS based product in Azure - Challenges and decisions made

External Building Blocks

Page 8: Building a SaaS based product in Azure - Challenges and decisions made

BizTalk360 Cloud (High Level Design)

Event HubProcessor

CustomerProvision

Email Manager

PurgeManager

PaymentManager

PurgeManager

HealthManager

UserManager

Core Web Jobs

Customer Specific Web Jobs SQL Elastic pool (per customer)

Core Database

Web Interface (Azure App Service)

Customer

Customer

Customer

Customer

Customer

Page 9: Building a SaaS based product in Azure - Challenges and decisions made

ServiceBus360 (High Level Design)

CustomerProvision

Email Manager

PurgeManager

PaymentManager

PurgeManager

HealthManager

UserManager

Core Web Jobs

Customer Specific Web Jobs SQL Elastic pool (per customer)

Core Database

Web Interface (Azure App Service)

Customer

Customer

Customer

Customer

Customer

Customer Azure Subscription

Customer Azure Subscription

Customer Azure Subscription

Page 10: Building a SaaS based product in Azure - Challenges and decisions made

Agent – Event Hub

BizTalk Agent

Event Hub ProcessorsInstance 1

Event Hub ProcessorsInstance 2

Core Database

SQL Elastic pool (per customer)

Page 11: Building a SaaS based product in Azure - Challenges and decisions made

Event Hub –What problem does it solve?• You don’t need to worry about message

ingestion into Azure

• Without Event Hubs the solution would have been complex with • Load balanced Web API• Scaling based on demand

Page 12: Building a SaaS based product in Azure - Challenges and decisions made

Agent - challenges to address

• Two-way communication•Ability to Force shut down•Ability to push updates•Ability to change Event Hub end points•Ability to notify local errors to the server•Ability to inform self health

Page 13: Building a SaaS based product in Azure - Challenges and decisions made

Event Hub Processor (challenges)• 2 Instances of Event Hub Processors

• Partitions are leased between these two instances

• When one goes down, all the partition leases are allocated to the active Instance automatically by the Event Hub Processor Factory

Page 14: Building a SaaS based product in Azure - Challenges and decisions made

Storing Customer(s) Data

Page 15: Building a SaaS based product in Azure - Challenges and decisions made

What are the options?• Single Database – all tenants in one database• PROS: Easy to implement, Fast deployment• CONS: Security, Scalability

• Isolated Databases – single database per tenant• PROS: Security, Scalability• CONS: Harder to Deploy, Manage, Cost

predictability

Page 16: Building a SaaS based product in Azure - Challenges and decisions made

We decided to go with Isolated Databases

Challenges to Address• Ability to run jobs (custom scripts) against all

databases• Ability to query consolidated data across all

databases• Avoid unnecessary cost for unused accounts• Cost Predictability

Page 17: Building a SaaS based product in Azure - Challenges and decisions made

Azure SQL Elastic Pool – is the Solution

Page 18: Building a SaaS based product in Azure - Challenges and decisions made

Azure SQL Elastic Pool – core benefits

• Designed for SaaS applications

• Can have mixture of small and large databases within the pool depending on customer size

• Simple costing model

Page 19: Building a SaaS based product in Azure - Challenges and decisions made

• There are limits on total number of databases you can have in the pool

•Cost is something to note, even though it’s consumption only model, the base price itself is quite high, maintaining staging, dev environments are challenging

Things to note with SQL Elastic Pool

Page 20: Building a SaaS based product in Azure - Challenges and decisions made

Techniques for smooth customer on-boarding

Page 21: Building a SaaS based product in Azure - Challenges and decisions made

Event Hub Processor Instances

Customer Provisions

EmailManager Purge

Manager

Payment Manager

SQL PoolManager

Utility User Manager

Core WebjobsCustomer Webjobs

DataBases

Pool Provisioned

Customer DB PoolCore DB

Customer DB Provisioned

Provisioning When New Customer Sign up and activate the account

New Customers

Page 22: Building a SaaS based product in Azure - Challenges and decisions made

Payment Processing

Page 23: Building a SaaS based product in Azure - Challenges and decisions made

•Not storing the credit card details PCI compliance

•Ability to handle • Recurring billing, • Cancellations, • Refunds, • Upgrade/downgrades,• Dunning (retry payment)• VAT

Things to look

Page 24: Building a SaaS based product in Azure - Challenges and decisions made

Don’t build your own

ChargeBee (subscription billing)

PaymentGateway

Page 25: Building a SaaS based product in Azure - Challenges and decisions made

Bank Account

Web API Notifications like successful payment, failed

payment, card expired are posted to our application via the Web API from ChargeBee

How does it work?

Page 26: Building a SaaS based product in Azure - Challenges and decisions made
Page 27: Building a SaaS based product in Azure - Challenges and decisions made

EmailProcessing

Page 28: Building a SaaS based product in Azure - Challenges and decisions made

Host InstancesOrchestrationsReceive LocationsSend Ports

Customer DB

Monitoring Service

(CustomerWebjob)

Core DB

Email Manager(Core Webjob)

Page 29: Building a SaaS based product in Azure - Challenges and decisions made

Deployment Process - Visual Studio Team Services

Page 30: Building a SaaS based product in Azure - Challenges and decisions made

• Full development build• Front End Back End Development• Full Staging build• Front End Back End Staging• Full master staging – Sync up• Full Production Build• Front End Back End Production

Multiple Build Definitions

Page 31: Building a SaaS based product in Azure - Challenges and decisions made
Page 32: Building a SaaS based product in Azure - Challenges and decisions made
Page 33: Building a SaaS based product in Azure - Challenges and decisions made

Naming Conventions

Page 34: Building a SaaS based product in Azure - Challenges and decisions made

Follow correct naming conventions right from the beginning• sb360-prod-rg• sb360-prod-appsvc-frontend• sb360-prod-appsvc-backend• sb360-prod-appsvc-backend-mon• sb360-prod-appsvcplan-frontent • sb360-prod-appsvcplan-backent• sb360-prod-appsvcplan-backend-mon • sb360-prod-servicebus• sb360-prod-servicebus-eventhub• sb360-prod-sql-elasticpool• sb360-prod-sql-server• sb360-prod-sql-coredb• sb360-prod-storage

Page 35: Building a SaaS based product in Azure - Challenges and decisions made

Active Directory or Simple Username/Password

Page 36: Building a SaaS based product in Azure - Challenges and decisions made

36Integrating with Active Directory Authentication

Page 37: Building a SaaS based product in Azure - Challenges and decisions made

37Resorted back to Forms Authentication

Page 38: Building a SaaS based product in Azure - Challenges and decisions made

Thank You – Get Started

One Platform.Operations, Monitoring, Analytics software for Azure Service Bus

Get started with a free accountwww.servicebus360.

com