Building a SaaS based product in Azure - Challenges and decisions made
-
Upload
biztalk360 -
Category
Technology
-
view
227 -
download
0
Transcript of Building a SaaS based product in Azure - Challenges and decisions made
Saravana KumarMicrosoft Azure MVP (since 2007)Founder – BizTalk360, ServiceBus360@saravana
mv
Building a SaaS based product in AzureChallenges and decisions made…
Our SaaS Products
https://biztalk360.cloud https://servicesbus360.com
What is a SaaS product?
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
Main Azure Building Blocks
Azure App Services Azure Event Hubs
Azure WebjobsAzure SQL Elastic Pool
Azure Storage Azure Key Vault
Azure SQL Database
External Building Blocks
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
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
Agent – Event Hub
BizTalk Agent
Event Hub ProcessorsInstance 1
Event Hub ProcessorsInstance 2
Core Database
SQL Elastic pool (per customer)
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
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
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
Storing Customer(s) Data
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
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
Azure SQL Elastic Pool – is the Solution
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
• 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
Techniques for smooth customer on-boarding
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
Payment Processing
•Not storing the credit card details PCI compliance
•Ability to handle • Recurring billing, • Cancellations, • Refunds, • Upgrade/downgrades,• Dunning (retry payment)• VAT
Things to look
Don’t build your own
ChargeBee (subscription billing)
PaymentGateway
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?
EmailProcessing
Host InstancesOrchestrationsReceive LocationsSend Ports
Customer DB
Monitoring Service
(CustomerWebjob)
Core DB
Email Manager(Core Webjob)
Deployment Process - Visual Studio Team Services
• 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
Naming Conventions
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
Active Directory or Simple Username/Password
36Integrating with Active Directory Authentication
37Resorted back to Forms Authentication
Thank You – Get Started
One Platform.Operations, Monitoring, Analytics software for Azure Service Bus
Get started with a free accountwww.servicebus360.
com