One month
Azure
&
Champions League
Who am I?
Piotr Stapp
- Unique name - just sing a song: "Don't Stapp me know" ;)
- CEO @ Dotnetomaniak
- VP @ devWarsztaty
- ex - Senior software/DevOps/Architect @mBank/@FinAi/@Allegro
- Software Architect @ Demant Technology Center
- M.Sc (distction) Oxford Brooks University in Web Tech
- M.Sc. Warsaw University of Technology in Computer Science
- And ......
Context
Numbers
- 5k - 50k - 500k ? (Wembley Stadium == 90k)
- A few important LIVE sessions (e.g. contest finals)
- Peak usage
- $$$ is very important
Architecture
TODO list
- Hosting
- Database
- Users data
- To SPA or not to SPA? That is the question!
- Man power
User Data Storage
Old days
Receipe
- Take one technology that you <3
- Apply the first tutorial about user accounts
- Or copy some stuff from previous project
My case
- .NET Framework (a good one)
- Avoided problems:
- Passwords with base64
- SQL injection
- In PHP, NodeJS, Java, .... - situation is simmilar
Seriously!
Today
The incomplete list
- Dedicated tools for user management:
- Active Directory
- OpenLDAP
- ...
- Ready to deploy and use:
- Keycloak,
- Identity Server 4
- ...
- SaaS:
- Auth0
- Userbase
- Azure B2C
Elimination
- $$$ - now and in the future
- Implementation problems with UI/UX requirements ;)
- The escape path (or migration possibility)
- Administration cost
Elimination time
Candidates
- Active Directory / OpenLDAP / ...
- My own with NuGet / Maven / NPM / pip / ... support
- Keycloak / Identity Server 4 / ...
- SaaS: Auth0, Userbase, Azure B2C
Candidates
Active Directory / OpenLDAP / ...- My own with NuGet / Maven / NPM / pip / ... support
- Keycloak / Identity Server 4 / ...
- SaaS: Auth0, Userbase, Azure B2C
Candidates
Active Directory / OpenLDAP / ...My own with NuGet / Maven / NPM / pip / ... support- Keycloak / Identity Server 4 / ...
- SaaS: Auth0, Userbase, Azure B2C
Candidates
Active Directory / OpenLDAP / ...My own with NuGet / Maven / NPM / pip / ... supportKeycloak / Identity Server 4 / ...- SaaS: Auth0, Userbase, Azure B2C
Candidates
- Auth0
- Azure B2C
- Userbase
Trust
- Auth0
- Azure B2C
Userbase
Features
- Facebook / Twitter / Github / .... login
- MFA with application and SMS
- FIDO2
- Custom domain
- Custom CSS
- ....
Money
Result
Hosting
The incomplete list
- Azure Storage + Azure CDN + ...
- Azure Functions
- Azure SignalR + static web page + X
- Virtual Machine
- Azure Container Instances
- Azure Kubernetes Service (AKS)
- Azure Web App in 3 flavors
The incomplete list
Azure Storage + Azure CDN + ...- Azure Functions
- Azure SignalR + static web page + X
- Virtual Machine
- Azure Container Instances
- Azure Kubernetes Service (AKS)
- Azure Web App in 3 flavors
The incomplete list
Azure Storage + Azure CDN + ...- Azure Functions
Azure SignalR + static web page + X- Virtual Machine
- Azure Container Instances
- Azure Kubernetes Service (AKS)
- Azure Web App in 3 flavors
The incomplete list
Azure Storage + Azure CDN + ...- Azure Functions
Azure SignalR + static web page + XVirtual Machine- Azure Container Instances
- Azure Kubernetes Service (AKS)
- Azure Web App in 3 flavors
The incomplete list
Azure Storage + Azure CDN + ...- Azure Functions
Azure SignalR + static web page + XVirtual MachineAzure Container Instances- Azure Kubernetes Service (AKS)
- Azure Web App in 3 flavors
The incomplete list
Azure Storage + Azure CDN + ...- Azure Functions
Azure SignalR + static web page + XVirtual MachineAzure Container InstancesAzure Kubernetes Service (AKS)- Azure Web App in 3 flavors
The incomplete list
Azure Storage + Azure CDN + ...Azure FunctionsAzure SignalR + static web page + XVirtual MachineAzure Container InstancesAzure Kubernetes Service (AKS)- Azure Web App in 3 flavors
The incomplete list
Azure Storage + Azure CDN + ...Azure FunctionsAzure SignalR + static web page + XVirtual MachineAzure Container InstancesAzure Kubernetes Service (AKS)Azure Web App in 3 flavors
What?
Database
Small recap
- Usage won't be "stable"
- There will be usage peaks
- A few days will have much more load than the rest of month/year
Conclusions
- We cannot predict what will happen
- Performance should be stable, but usage is a time function
- Probably a lot of data will be static and can be handled by cache
NoSQL
- Great, isn't it?
- New, isn't it?
SQL
- Solid, isn't it?
- Well known, isn't it?
Options
- Self-hosted "custom" one on VM's
- Azure Storage
- Cosmos DB
- "Native"
- Mongo
- GraphQL
- ....
- SQL as a Service
- MSSQL
- Postgres
- MySQL
- MariaDB
Custom stuff on VM's
Before you decide, you should know
- why PaaS DB won't work for you
- how to manage this custom stuff
ย
Azure Storage
- Very cheap
- Simple key-value or "file database"
- Limit for maximum number of operations
- Used by https://haveibeenpwned.com/
In other words, if I want 100GB of storage and I want to hit it 10 million times, itโll cost me $8 a month.
Azure SQL for ...
Cosmos DB
- "SQL", API for MongoDB, Gremlin, Cassandra, Table, ...
- Key-vaule, Column-Family, Documents, Graph
- Pricing:
- Standard
- Auto-scale
- Serverless
- Dynamic scaling? Yes!!
- No relations ๐๐๐
Options
- Self-hosted "custom" one on VM's
- Azure Storage
- Cosmos DB
- SQL as a Service
Small things
14 Rules by Steve Sounders
- Make Fewer HTTP Requests
- Use a Content Delivery Network
- Add an Expires Header
- Gzip Components
- Put Stylesheets at the Top
- Put Scripts at the Bottom
- Avoid CSS Expressions
- Make JavaScript and CSS External
- Reduce DNS Lookups
- Minify JavaScript
- Avoid Redirects
- Remove Duplicate Scripts
- Configure ETags
- Make AJAX Cacheable
Small "things"
- HTTP/2 (or even HTTP/3)
- SSL certificate
- First Contentful Paint
- CDN++
- And some points from 14 Rules for Faster-Loading Web Sites
Costs
Cloudflare
- Make Fewer HTTP Requests - โ
- Use a Content Delivery Network - โ ย
- Add an Expires Header - โ
- Gzip Components - โ
- Put Stylesheets at the Top - โ ๏ธ
- Put Scripts at the Bottom - โ ๏ธ
- Avoid CSS Expressions - โ
- Make JavaScript and CSS External - โ
- Reduce DNS Lookups - โ
- Minify JavaScript - โ
- Avoid Redirects - โ /โ ๏ธ
- Remove Duplicate Scripts - โ
- Configure ETags - โ
- Make AJAX Cacheable - โ
Cloudflare - cost
- For above - 0$
- Results:
- Static page (from GitHub pages) is 16% faster
- Dotnetomaniak - serves 50% request from cache
- "Have I been pwned?" - crazy results - don't even ask
The end?
One month Azure & Champions League
By Piotr Stapp
One month Azure & Champions League
- 103