S9 Slides
S9 Slides
Memi Lavi
www.memilavi.com
Data in Azure
• Full flexibility
• Full control
Database on VM
• Works like any other SQL Server using the same tools
Elastic Pool
Managed Instance
Azure SQL Database
• Security:
• IP firewall rules
• Service Endpoints
• Backup:
• Retention Period:
• Availability:
• Active geo-replication
• Compute Tiers:
Provisioned Serverless
• Pay for allocated resources • Pay for actual use – vCore + RAM /
second
regardless of actual use
• Automatically paused when inactive (pay
• Can be reserved just for storage)
• Slight delay when warming up
• Can’t be reserved
Elastic Pool
spikes
Elastic Pool
Elastic Pool
Elastic Pool
• Cost effective
• Main differences:
Instance
Pools
General 8…80
Purpose
Single
Managed
Instance
Instance Business
Critical
Azure SQL
Purchase Instance
Flavor Type Model
Service Tier Compute Tier (vCores / DTUs)
Basic
vCores /
Standard DTUs
Managed DTU* Premium
Instance Single Serverless
vCores General Purpose
Database
Azure SQL Business Critical
DTU* Provisioned
Elastic Pool
Hyperscale
vCores
Managed DTU*
Instance Basic
Single
vCores
Database Standard
Azure SQL
vCores /
DTU* Premium
Elastic Pool DTUs
vCores General Purpose
Business Critical
• Globally distributed
• Multiple APIS:
• Hierarchical:
JSON
Document
Cosmos DB Availability
• IP firewall rules
• Service Endpoints
• Private Endpoints
• Azure AD Authentication
• Cannot be modified
Recording of L7S5 from the
Architecture course
Cosmos DB Consistency Levels
• Traditionally:
• Bounded Staleness
• Session
• Consistent Prefix
• Region Y will get the last version of the item updated in region X
Region X
Writes
Region Y
Reads
Timeline
Bounded Staleness
• Region Y will lag behind region X by K versions or T time
• Keeps the order of the versions
• Used for low write latency and when order is important
Region X
Writes
K=2
Region Y
Reads
Timeline
Session
• In a client session – Strong consistency
• Other clients – Consistent Prefix (sometimes Eventual)
Consistent Prefix
• Keeps the order of the versions
• No guarantee of the lag size (as opposed to Bounded Context)
• Used for low write latency and when reads are infrequent
Region X
Writes
Region Y
Reads
Timeline
Eventual
• No order guarantee
• No guarantee of the lag size (as opposed to Bounded Context)
• Used for count of Retweets, Likes, etc.
Region X
Writes
Region Y
Reads
Timeline
Cosmos DB Consistency Levels
• Based on RU/s
• You can see the actual RU consumed in the response header of the
results
Cosmos Pricing
• Write Regions
• Database Operations:
• Works like any other MySQL database using the same tools
• Security:
• IP firewall rules
• Service Endpoints
• Private Endpoints
• Regular & Azure AD Authentication
• Secure communication (TLS)
• Data encrypted by default
Azure MySQL
• Backup:
• Depends on Service Tier:
• Basic – Full backup: daily
• General Purpose up to 4GB:
• Full backup: once a week
• Differential backup: twice a day
• Transaction log backup: every 5 minutes
Azure MySQL
• Backup:
• Depends on Service Tier:
• General Purpose up to 16GB:
• Full backup: Once created
• Differential backup: once a day
• Transaction log backup: every 5 minutes
Azure MySQL
• Retention Period:
• Availability:
• SLA: 99.99%
Azure MySQL Pricing
• Tier:
recommended
• Reservations exist
Azure PostgreSQL
• Works like any other PostgreSQL database using the same tools
• Security:
• IP firewall rules
• Service Endpoints
• Private Endpoints
• Regular & Azure AD Authentication
• Secure communication (TLS)
• Data encrypted by default
Azure PostgreSQL
• Backup:
• Depends on storage size:
• up to 4GB:
• Full backup: once a week
• Differential backup: twice a day
• Transaction log backup: every 5 minutes
Azure PostgreSQL
• Backup:
• Depends on storage size:
• up to 16GB:
• Full backup: Once created
• Differential backup: thrice a day
• Transaction log backup: every 5 minutes
Azure PostgreSQL
• Retention Period:
• Availability:
• SLA: 99.99%
Azure Storage
• Object store
• Massively scalable
• Security:
• IP firewall rules
• Service Endpoints
• Private Endpoints
• Shared Access Signatures
• Access Keys & Azure AD Authentication
• Secure communication (TLS)
• Data encrypted by default
Azure Blobs Storage
• Structure:
Azure Blobs Storage Redundancy
• 6 options:
LRS ZRS GRS
Locally Redundant Storage Zone Redundant Storage Geo Redundant Storage
Data is synchronously copied 3 Data is synchronously copied to Data is synchronously copied 3 times
times within the same zone 3 zones in the Region within the same zone, and then copied
asynchronously to paired Region.
Data in the secondary Region is
accessible only after Failover process
• Normal circumstances:
Azure Blobs Storage Failover
• Portal
• Azure CLI
• PowerShell
Azure Blobs Storage Tiers
• Archive tier does not support ZRS, GRS and RA-GRS redundancy
• Based on:
• Redundancy option
• Access tier
• Capacity
Azure Redis
• Security:
• IP firewall rules
• Service Endpoints
• Private Endpoints
• Secure communication (TLS)
Azure Redis Service Tiers
• Based on:
• Tier
• Memory
Cloud Architecture
Service Peering
Endpoint
App Gateway
NSG NSG
NSG
ACR Redis
Cosmos DB Cart Docker
Azure SQL
Are we done?
• Nope ☺
• The Orders Function is publicly available and synchronous
• The inventory page is open for everyone
• We don’t really know how the app is functioning
• The website is not redundant – what happens if the whole region
goes down?
Selecting Data Store Solution