Azure SQL Database: A Fully Managed Relational Database That Runs, Heals and Scales Itself

Azure SQL Database: A Fully Managed Relational Database That Runs, Heals and Scales Itself

A complete, plain-English guide to servers, databases and elastic pools, the three service tiers, how data stays safe and available, how to scale and secure it, what it costs, and how to avoid the classic mistakes.

Picture an online shop on a busy evening. Customers are adding items to baskets, paying, checking where their parcels are. Behind every one of those clicks, a program has to remember something precisely: this order belongs to that customer, this payment is complete, only three of those shoes are left in stock. If the memory is wrong even once, money is lost and trust is damaged. For more than fifty years, the standard tool for this kind of exact memory has been the relational database.

Running a relational database well used to be a job in itself. Somebody had to buy the servers, install the database software, apply security patches at night, schedule backups, test the restores, plan for hardware failures and watch the disk space. Azure SQL Database takes all of that off your plate. You ask for a database, Microsoft runs it, and you spend your time on tables, queries and the application. In this guide you will learn what it is, how it works inside, how to choose between its options, how to keep it fast, safe and affordable, and what to do when something goes wrong.

1What Azure SQL Database Is and Why It Exists

Start with the plain meaning of each word, then see where this product sits among Microsoft’s other database choices.

What a relational database is

A relational database stores information in tables, which look like spreadsheets. Each table has columns that describe the kind of data, such as a customer name or an order date, and rows that hold one record each. Tables are connected to one another by shared values. An order row carries a customer number, which points to a row in the customer table. You ask questions of the data using a language called SQL, short for Structured Query Language, for example “show me all orders from this customer in the last month, newest first”. The database finds the answer for you and promises that the data stays consistent even when many people change it at the same time.

What “Azure SQL Database” adds

Azure SQL Database is a platform as a service, often shortened to PaaS. It means the cloud provider runs the platform underneath, and you use only the top layer. It is built on the same database engine as Microsoft SQL Server, the long-established product used in offices and data centers worldwide, so the language is the same Transact-SQL, or T-SQL, and most tools and skills carry over. The difference is that Azure manages the machines, the operating system, the database software, the updates, the backups and the failover. The engine is kept on a current version, which means new features arrive without you running upgrade projects.

Everyday analogy

Running your own database server is like owning a restaurant building: you pay for the kitchen equipment, repair the oven, hire the cleaners and handle the fire inspections. Azure SQL Database is like renting a table at a restaurant that does all that for you. You still choose what to order and how to eat, but you never touch the oven.

The Azure SQL family

Azure offers three main ways to run SQL Server technology, and choosing the right one is the first design decision.

PaaS

Azure SQL Database

One database, or many in a pool, fully managed. Best for new cloud applications and for software-as-a-service products. Gives the least administration work but a few SQL Server features are not available.

PaaS

Azure SQL Managed Instance

A managed copy of a whole SQL Server instance with nearly full compatibility. Best for moving existing applications that use instance-level features with little change.

IaaS

SQL Server on Azure VMs

A normal SQL Server installed on a virtual machine that you control. Best when you need full control of the operating system or a feature the managed options lack. You do the patching and backups.

What problems it solves

It removes routine administration: patching, backups, health monitoring and hardware replacement. It provides built-in high availability, so a failing server does not mean an outage. It lets you resize in minutes instead of ordering hardware. It offers intelligent features such as automatic plan correction and tuning advice. And it ties into the rest of Azure for identity, networking, monitoring and security.

99.99%
availability SLA for most configurations, higher with zone redundancy
3
service tiers: General Purpose, Business Critical and Hyperscale
up to 128 TB
size of a Hyperscale database
i
Rule of thumb

If you are building something new and your data is structured with relationships, start with Azure SQL Database. Reach for Managed Instance when a migration needs instance-level features, and for a virtual machine only when nothing else fits.

2Where It Came From: A Short History of Databases

Every feature of Azure SQL Database answers a problem that earlier systems struggled with. A brief look back explains the design.

Files, then relations

Early business programs kept data in plain files, each program with its own format. Changing a format broke every program that read it, and two programs could easily disagree about the same customer. In 1970 a researcher named Edgar Codd proposed the relational model, which separates what the data means from how it is stored, and makes questions about the data independent of storage details. Within a decade, products built on the idea appeared, and the language SQL became the common way to talk to them.

The promise of transactions

Relational databases became trusted because of transactions. A transaction is a group of changes that must all happen or none happen. Moving money from one bank account to another subtracts from one row and adds to another. If the system crashes between the two steps, the database must undo the first, otherwise money disappears. The usual guarantees are summarized as ACID: Atomicity, meaning all or nothing; Consistency, meaning rules stay true; Isolation, meaning simultaneous users do not see each other’s half-finished work; and Durability, meaning a confirmed change survives a crash.

SQL Server and the move to the cloud

Microsoft SQL Server grew from the late 1980s into a mainstream engine in offices and data centers. When cloud computing arrived, running SQL Server on rented virtual machines was the first step, but it kept all the administration work. Microsoft then built a database service where the engine itself is hosted and operated for you, which became Azure SQL Database. Over the years the service gained elastic pools for sharing resources between many databases, serverless compute that pauses when idle, and the Hyperscale architecture for very large databases.

StageHow databases were runMain pain
Flat filesEvery program had its own data fileDuplicate and conflicting data
Own serverBuy hardware, install SQL Server, run it yourselfCapital cost, patching, backups, failures
Virtual machinesRent a VM, install the software yourselfSame administration, less hardware worry
Managed databaseCloud provider runs the engine and platformLearning limits, tiers and cost levers
?
Why this matters

Many odd-looking Azure SQL behaviors, such as the brief connection drop after a scale operation or the retry advice for transient errors, follow directly from running a transactional engine on shared, replaceable machines.

3Core Concepts: Servers, Databases and Elastic Pools

A few names appear in every conversation about Azure SQL Database. Learn them once and the portal, the documentation and error messages become readable.

Container

Logical server

An administrative anchor, not a real machine. It owns the network name, the sign-in settings, firewall rules, auditing and failover settings for the databases attached to it.

Data

Database

Your tables, indexes and programs, plus its own compute and storage settings. A server can hold many databases.

Sharing

Elastic pool

A shared bucket of compute that many databases draw from, so quiet ones help pay for busy ones.

Access

Firewall and endpoints

The rules and private connections that decide who can even attempt to connect.

Identity

Logins and users

Accounts created inside the server or database, or mapped to Microsoft Entra identities.

Copies

Replicas and backups

Extra copies kept for availability, scaling reads, disaster recovery and restoring to an earlier time.

The logical server

The name is slightly misleading. A logical server does not run your queries. It is the address and the rulebook. Every logical server has a name that ends in .database.windows.net, and applications connect to that name. The server stores who the administrators are, which network addresses are allowed in, where audit logs go, and which databases belong together. Think of it as the building’s front desk, while the databases are the apartments inside.

Single database and elastic pool

A single database has its own dedicated amount of compute and storage, chosen by you. An elastic pool is useful when you have many databases with unpredictable, uneven activity, such as one per customer in a software-as-a-service product. At any moment only a few are busy. Pooling lets all of them share one budget of compute, with limits you set per database so none can take everything.

Everyday analogy

A single database is a private car: always yours, always there, and you pay for it whether you drive or not. An elastic pool is a company car pool. Fifty employees share ten cars, because they rarely all need a car at the same moment.

The two ways to buy compute

Azure SQL Database offers two purchasing models. The vCore model lets you pick the number of virtual cores, the memory size and the storage separately, with a clear view of hardware. The older DTU model bundles compute, memory and input and output into a single blended unit, the Database Transaction Unit, with fixed packages named Basic, Standard and Premium. The vCore model is more flexible and is the one most new designs use. The DTU model remains useful for simple, small workloads where a ready-made package is easier to reason about.

QuestionvCore modelDTU model
What you chooseCores, memory, storage, tier, hardware generationA package such as Basic, Standard S0 or Premium P1
Serverless availableYesNo
Hyperscale availableYesNo
License savings for existing SQL Server licensesYes, through Azure Hybrid BenefitNo
Best forMost production systems and anything needing control or savingsSmall, simple databases with predictable needs

4Service Tiers and Compute Options

The tier you choose decides how data is stored, how copies are kept, how fast it feels and how much it costs. This is the most important sizing decision after the model itself.

General Purpose

The General Purpose tier is the balanced, budget-friendly choice for most business applications. Compute runs on a node, and the data files live on highly available remote storage that is separate from the compute. If the node fails, Azure starts another node, attaches the same storage and the database is back, usually within a short time. Because storage is remote, each storage operation takes a little longer than local disks would.

Business Critical

The Business Critical tier is built for heavy transaction loads and the lowest delay. Data lives on fast local solid-state disks attached to the compute node. Four copies of the database run on four nodes in a cluster: one primary that accepts writes and three secondaries that continuously replay every change. A write is confirmed only after enough secondaries have safely received it. If the primary fails, one of the secondaries takes over almost immediately. One secondary can also answer read-only queries, so reports do not slow down the main workload. This tier supports in-memory features designed for very fast transactions.

Hyperscale

The Hyperscale tier separates the pieces of a database into independent services so that each can grow on its own. Compute nodes run the engine. A log service receives and hardens every change. A set of page servers each hold a slice of the data files and serve pages to the compute nodes. The durable data lives in Azure storage. Because backups are snapshots of storage and restores copy references rather than every byte, a very large database can be backed up and restored in minutes, and growth to 128 terabytes does not slow these operations. Extra read replicas can be added to scale out reading.

flowchart TD
  subgraph GP["General Purpose"]
    GC["Compute node"] --> GS["Remote data and log files in Azure storage"]
  end
  subgraph BC["Business Critical"]
    BP["Primary with local SSD"] --> B1["Secondary 1"]
    BP --> B2["Secondary 2"]
    BP --> B3["Secondary 3 readable"]
  end
  subgraph HS["Hyperscale"]
    HC["Primary compute"] --> LS["Log service"]
    LS --> PS1["Page server 1"]
    LS --> PS2["Page server 2"]
    HC --> PS1
    HC --> PS2
    PS1 --> ST["Durable Azure storage"]
    PS2 --> ST
    HC --> HR["Read replicas"]
  end
Figure 1: How data and compute are arranged in each of the three service tiers
FeatureGeneral PurposeBusiness CriticalHyperscale
Storage designRemote storage, separate from computeLocal SSD with four replicasDistributed page servers with log service
Typical size ceilingSeveral terabytesSeveral terabytesUp to 128 TB
Storage delayLow to moderateLowestLow, with caching on compute
Built-in readable replicaNoYes, oneYes, add as needed
Failover speedModerateFastestFast with high-availability replicas
Backup and restore timeGrows with sizeGrows with sizeMinutes for very large databases
Best forMost business appsHeavy transactions and low delayVery large or fast-growing data

Provisioned versus serverless compute

Inside the vCore model, compute can be provisioned, meaning a fixed number of cores running and billed all the time, or serverless, available in General Purpose and Hyperscale. Serverless lets you set a minimum and maximum number of cores. The database scales between them automatically as load changes, and compute is billed per second for the cores actually used. After a quiet period you choose, a General Purpose serverless database can pause, in which case you pay only for storage. The next connection wakes it, which takes a short time, so the first user after a pause waits a little.

!
The first request after a pause

An auto-paused database needs time to resume, and applications with short connection timeouts may fail on that first try. Build in retries, or turn off auto-pause for anything that must answer instantly at all hours.

5Architecture and Components: The Path of a Connection

Your application only knows a server name. Behind that name sits a small set of cooperating services that find your database and keep it healthy.

flowchart LR
  APP["Application with connection string"] -->|"1 Resolve server name and connect to port 1433"| GW["Regional gateway"]
  GW -->|"2 Authenticate and check firewall"| CTRL["Control plane: placement, health, failover"]
  GW -->|"3 Proxy or redirect to the node that hosts the database"| NODE["Database node running the SQL engine"]
  APP -.->|"3b Redirect mode connects straight to the node"| NODE
  NODE --> STOR["Data and log storage for the chosen tier"]
  CTRL -.-> NODE
  CTRL -.-> REP["Replicas on other nodes"]
  NODE --> REP
  NODE --> MON["Telemetry, backups and audit streams"]
Figure 2: The gateway, control plane and database node involved in a connection

The gateway

When your program connects to the server name, DNS points it to a gateway in the database’s region. The gateway is a fleet of stateless machines that accept connections on the standard SQL port, 1433. It checks the request against the server’s firewall, confirms which database you want, and finds the node that currently hosts that database. Because gateways keep no important state of their own, there can be many, and a failed gateway is simply replaced. The set of gateway addresses for each region is published, which matters when you write firewall rules.

Connection policy: proxy or redirect

After the gateway finds your database it can either keep sitting in the middle, passing every message back and forth, or it can step aside and let your application talk to the node directly. These are the proxy and redirect connection policies. Redirect gives lower delay and higher throughput because there is one less hop, but it needs a range of extra ports to be open between the application and Azure. Proxy needs only port 1433. By default, connections that come from inside Azure use redirect and connections from outside use proxy. You can set the policy on the server to force either behavior.

The database node and the engine

The database itself runs on a node, which is a virtual machine inside a managed cluster. On it runs the SQL engine, the same family of code as SQL Server. Azure uses a cluster management service to place databases on nodes, watch their health, and move a database elsewhere when a node fails or when you change its size. You never log in to a node. You see only the database.

The control plane and the data plane

Two worlds exist side by side. The control plane is the management side: creating a database, changing its tier, setting backup retention, configuring replication. You reach it through the Azure portal, command line tools, templates and the Azure Resource Manager. The data plane is the work side: connecting, running queries and changing rows. Permissions are separate for each. Someone who can resize a database does not automatically gain the right to read the tables inside it, and the other way around.

i
Practical impact

Because of the proxy and redirect options, a firewall or network appliance that only allows port 1433 will force the slower proxy path. If you use redirect, make sure the extra port range for your region is open.

6Internal Working: Inside the Engine

A short tour of what the database does with each query explains almost every performance tip you will ever read.

From text to answer

When you send a query, the engine goes through steps. It first parses the text to check the grammar. It then asks the query optimizer to build a plan, which is a recipe for finding the answer cheaply: which indexes to use, in which order to join tables, how to sort. The optimizer decides using statistics, small summaries of how values are spread in each column. The plan is cached so the same query can reuse it. Finally the executor follows the plan, reading data pages and producing rows. If statistics are out of date, the optimizer can pick a poor plan, which is why the engine refreshes statistics automatically.

Memory first, disk second

Data is stored in fixed-size pages of eight kilobytes. The engine keeps recently used pages in a memory area called the buffer pool. A read that finds its page in memory is far faster than one that must fetch it from storage. Therefore more memory and good indexes, which reduce the number of pages touched, are the two best friends of read speed.

Write-ahead logging

Changes do not go straight to the data files. First, the engine writes a description of the change to the transaction log and makes sure that log record is stored safely. Only then does it confirm the commit to you. The modified data page in memory is written to the data file later, in the background. This rule, called write-ahead logging, is why a crash cannot lose a confirmed transaction: on restart the engine replays the log to redo committed work and undo unfinished work. Azure SQL Database enables a feature called accelerated database recovery, which keeps older row versions so that rolling back and recovering finish quickly even after very long transactions.

Everyday analogy

A shop assistant writes every sale in a receipt book before moving the goods and updating the big ledger. If the lights go out, the receipt book tells exactly what was sold and what must still be recorded. The book is slow to lose, the ledger can be rebuilt.

Locks, versions and isolation

When many people work at once, the engine must stop them from trampling each other. The traditional method uses locks: a writer blocks other writers on the same row. A reader might also have to wait. Azure SQL Database turns on read committed snapshot isolation by default, which keeps old versions of changed rows so readers see the last committed version and do not wait for writers. This greatly reduces blocking in typical applications. Writers still block each other, so a long transaction that holds locks can pile up a queue behind it.

Query Store and automatic tuning

The engine records the plans and run-time statistics of every query in a built-in history called the Query Store, which is enabled by default in Azure SQL Database. This history allows the platform to notice a plan regression, a case where a query suddenly becomes slower because the optimizer picked a worse plan after a statistics change or an upgrade. The automatic tuning feature can force the previous good plan back, and it is on by default. Optional settings can also create indexes that would help and drop indexes that are never used, and they validate the effect, undoing a change that makes things worse.

Compatibility levels

Each database has a compatibility level, a setting that controls which behaviors of the optimizer and language it follows. New databases use the newest level, but a database restored from an older system may keep an older one. Raising the level gives access to newer optimizer improvements, called intelligent query processing, but should be tested because plans can change.

MechanismPurposeWhat it means for you
Optimizer and statisticsChoose a cheap planKeep statistics fresh and write queries the optimizer can understand
Buffer poolCache pages in memoryMore memory and good indexes reduce disk reads
Write-ahead logMake commits durable and recoverableLog write speed limits how fast you can commit
Row versioningLet readers avoid waiting for writersFewer blocks, but keep transactions short
Query StoreRemember plans and performanceFind regressions and top resource users
Automatic tuningFix bad plans and suggest indexesReview its actions, do not rely on it blindly

7Data Flow and Lifecycle: From Click to Committed Row

Follow a single order from the web page through the database and out to the replicas, and the rest of the design becomes concrete.

sequenceDiagram
  participant App as Application
  participant GW as Gateway
  participant P as Primary node
  participant S as Secondary replicas
  App->>GW: Connect, sign in, choose database
  GW->>P: Route session
  App->>P: Begin transaction, insert order, update stock
  P->>P: Write log records to local log
  P->>S: Send log records
  S-->>P: Acknowledge hardened log
  P-->>App: Commit confirmed
  P->>P: Write data pages to files in the background
  Note over P,S: Replicas replay the log to stay current
Figure 3: A transaction commit in a tier that keeps synchronous replicas

Step by step

1

Connect and authenticate

The application opens a connection, usually from a pool of reusable connections, and signs in with a password, a Microsoft Entra identity or a managed identity.

2

Send the work

The application starts a transaction and sends statements, ideally as parameterized queries or calls to stored procedures.

3

Plan and execute

The engine finds or builds a plan, takes needed locks or versions, and changes pages in memory.

4

Harden the log

Log records are written to durable storage and, in tiers with synchronous replicas, to enough copies on other nodes.

5

Confirm

Only now does the engine tell the application the commit succeeded.

6

Flush later

Modified pages are written to data files in the background, and the log is used by backups and replicas.

Transient errors and retry logic

In a cloud service, brief interruptions are normal. A scale operation, a failover to another node, a platform update or a short overload can make a connection drop or a request fail for a few seconds. These are called transient faults. They come back with specific error numbers such as 40613, meaning the database is not currently available, or 40501, meaning the service is busy. A well-built application treats them as expected. It retries the operation after a short wait, doubling the wait each time up to a limit, and it opens a new connection when the old one is broken. Most official drivers and libraries include this behavior, and it must be turned on and tested.

!
Retry only what is safe

Retrying a read is harmless. Retrying a payment insert can charge twice if the first attempt actually succeeded but the answer was lost. Give such operations a unique request identifier and check it before inserting again, so the retry is safe.

Connection pooling

Opening a connection is relatively expensive: network handshakes, sign-in and setup. Application libraries keep a pool of open connections and hand them out to requests, taking them back when finished. Without pooling, a busy site can drown the database with sign-ins. With careless pooling, too many connections can pile up and hit the limit on workers and sessions, so size pools sensibly and always release connections quickly.

Lifecycle of the data itself

Rows are created, updated and eventually archived or deleted. Over time tables grow, indexes fragment and statistics age. A healthy lifecycle includes regular maintenance such as index and statistics upkeep, an archive plan that moves old rows to cheaper storage or a separate table, and size monitoring so growth never surprises you. Azure handles backups and engine updates on its own, but data design and housekeeping remain yours.

8High Availability and Disaster Recovery

Two different questions are hiding in the word “reliable”. What happens when one machine breaks? And what happens when a whole region goes dark? Azure SQL Database answers them with different tools.

Built-in high availability

Every database has an availability design built in at no extra price. In General Purpose, the database files are stored redundantly on remote storage, and a failed node is replaced by a fresh node that mounts the same files. In Business Critical and Hyperscale, replicas of the engine already run and one takes over quickly. Failovers during maintenance and hardware faults are normal events that applications see only as a short reconnect. The service level agreement is 99.99 percent for most configurations.

Zone redundancy

In regions that have availability zones, which are separate buildings with independent power and cooling, you can enable zone redundancy. The replicas of the database are then spread across zones, so the loss of an entire zone does not cause an outage. The service level agreement improves, and the application changes nothing except the retry behavior it should already have.

Active geo-replication and failover groups

To survive the loss of a whole region, you keep a copy in another region. Active geo-replication creates up to four readable secondary databases in other regions, fed asynchronously from the primary. A failover group goes a step further. It groups many databases from a primary server and a secondary server, and gives your application two stable names: a read-write listener that always points to the current primary, and a read-only listener that points to a secondary. When failover happens, the names move, so connection strings need not change. Failover can be manual, or automatic after a grace period you choose.

flowchart LR
  subgraph R1["Primary region"]
    S1["Primary logical server"]
    D1["Primary databases with zone redundancy"]
  end
  subgraph R2["Secondary region"]
    S2["Secondary logical server"]
    D2["Readable secondary databases"]
  end
  APP["Application"] -->|"Read write listener name"| FG["Failover group endpoints"]
  APP2["Reporting tool"] -->|"Read only listener name"| FG
  FG --> D1
  FG -.-> D2
  D1 -.->|"Asynchronous replication"| D2
Figure 4: A failover group exposes stable names that follow the current primary and secondary

Understanding the gap

Because geo-replication is asynchronous, a small amount of the newest committed data may not have reached the secondary when the primary region fails. Documentation describes the typical gap in seconds, but it is not a promise, and it grows when the primary is under heavy write load. A forced failover accepts that possible data loss. A planned, manual failover first waits until the secondary is fully caught up, so no data is lost. Always practice the failover so your team knows which one it is performing.

ProtectionSurvivesTypical data gapTypical recovery speed
Built-in availabilityNode and disk failureNoneSeconds to a minute or so
Zone redundancyZone failureNoneSeconds to a minute or so
Failover group or geo-replicationRegion failureSeconds of recent dataMinutes
Geo-restore from backupRegion failure with no replicaUp to about an hourHours
Point-in-time restoreHuman or software errorBack to a chosen momentMinutes to hours depending on size
?
Replicas are not backups

A replica copies every change instantly, including a mistaken delete. For human mistakes you need backups and point-in-time restore, described next.

9Backup, Restore and Retention

Backups happen automatically and need no scheduling from you. What you control is how long they stay, where they are copied and how you restore from them.

What is backed up and how often

Azure takes full backups about once a week, differential backups every twelve hours or so that capture the changes since the last full, and transaction log backups every few minutes. Together they let the service rebuild the database at nearly any second inside the retention period. This ability is called point-in-time restore. For Hyperscale, backups use storage snapshots instead, which is why they do not slow with database size.

Retention

The short-term retention window defaults to seven days and can be set between one and thirty-five days. For longer needs, long-term retention keeps weekly, monthly and yearly full backups for up to ten years, which suits legal and audit rules. You choose a schedule, such as “keep one backup per month for twelve months and one per year for seven years”.

Where backups are stored

Backups live in storage that Azure manages for you, and you pick its redundancy: locally redundant, zone redundant, geo-redundant or geo-zone-redundant. Geo-redundant backups, the usual default, are copied to the paired region. They are what makes geo-restore possible, which lets you create the database in a different region from the latest replicated backup if the home region is gone. Backup storage up to the size of your database is generally included in the price, with extra billed beyond that.

Restoring is always to a new database

A restore does not overwrite the existing database. It creates a new database from a chosen point in time, from a deleted database, from a long-term backup or from a geo-redundant backup. You then compare, copy the needed rows back or swap names. This is safer, because a wrong choice can be repeated with another time, and it also means you must have room and budget for the new database during the work.

Restore type

Point in time

Bring back a database as it was a minute, an hour or days ago, within retention. The standard answer to “someone ran the wrong update”.

Restore type

Deleted database

Recover a database that was dropped, as long as its backups are still within retention.

Restore type

Long-term backup

Create a database from a weekly, monthly or yearly archive, for audits or old investigations.

Restore type

Geo-restore

Rebuild in another region from geo-redundant backups when the home region is unavailable and no replica exists.

i
Rehearse the restore

Choose a day each quarter to restore a copy into a test server and check that the application can use it. The first time you restore should not be during an emergency.

10Performance and Scalability

A database slows down for only a handful of reasons: too little compute, too much work per query, waiting on locks, or a slow path to the storage. Scaling treats the first; good design treats the rest.

Scaling up and down

You can change the number of cores, the tier or the storage size of a database while it stays online. Behind the scenes Azure prepares a new set of resources, copies state, and then switches over. The switch causes a short interruption where connections are dropped, so the application must reconnect, again showing why retry logic matters. For General Purpose and Business Critical, the time taken may depend on the database size. For Hyperscale, resizing compute is fast because the data lives in the shared page servers and need not be copied.

Scaling out reads

Many applications read far more than they write. Reports, dashboards and search pages can be sent to a readable replica so they do not compete with the main workload. In Business Critical, one built-in secondary accepts read-only connections when the connection string says the intent is read only. In Hyperscale you can add several replicas, including named replicas that have their own sizes, so one team’s analytics cannot disturb another’s. Geo-replicas in other regions also serve reads close to remote users, with a small delay in freshness.

Elastic pools

Pools make sense when many databases are mostly idle. Suppose a software product serves 300 customers, each with their own database. Giving every database enough power for its busiest moment would waste money, because the busy moments rarely coincide. A pool gives all of them a shared total, and settings for the minimum guaranteed and maximum allowed for each database, so a noisy neighbor cannot starve the rest. Watching the pool’s overall use tells you when the shared total must grow.

The worst performance problems are usually in the queries

Buying more cores for a badly written query is like buying a bigger truck to carry a load that should have been split in two. The common causes are missing or unused indexes, queries that fetch more columns and rows than needed, loops that run one query per row instead of one set-based query, and implicit data type conversions that stop an index from being used. Fixing a single top query often cuts total load by more than doubling the compute.

Index

Right indexes

An index is like a book’s index: it finds rows without reading the whole table. Too few indexes make reads slow, too many make writes slow and waste space.

Query shape

Only what you need

Select needed columns, filter early, and page large lists instead of returning everything.

Batching

Set-based work

One statement that changes a thousand rows beats a thousand statements that change one row each.

Columnstore

Analytics storage

For big reporting tables, columnstore indexes compress data and scan it quickly, often many times faster for aggregation.

Memory

In-memory tables

In Business Critical, memory-optimized tables speed up very high-rate transaction patterns.

Partitioning

Split large tables

Dividing a table by date makes maintenance and archiving manageable and can limit the data scanned.

Limits you meet before you run out of cores

Each size has ceilings: the number of concurrent workers that run requests, the number of sessions, the data and log input and output rate, and the size of temporary storage. Log throughput is governed, so a bulk load of millions of rows can be held back by log rate before CPU is busy. The portal shows these as percentages, so you can see which one is the real wall. When a query waits, the reason is recorded as a wait type, and the top waits tell you whether the cause is locks, log writes, reading data from storage or CPU.

A small worked example

A web store sees 2,000 database requests per second at peak, and each takes on average 10 milliseconds. By Little’s law, the average number of requests in progress equals arrival rate times time in system, which is 2,000 times 0.01, or 20 at once. If each request keeps one worker busy while it runs, you need to be sure the chosen size supports comfortably more than 20 concurrent workers, with headroom for spikes and slow moments. If a spike pushes average time from 10 to 50 milliseconds, concurrency jumps to 100, which is why a small slowdown can suddenly exhaust workers and make everything stall.

11Security: Network, Identity, Encryption and Auditing

A database holds the most valuable data in a company, so it deserves several independent locks. Each layer below assumes the previous one might be bypassed.

Layer 1: who can reach the server

By default a new server accepts no traffic until you allow it. The server firewall lists the public IP addresses that may connect, and a switch lets trusted Azure services in. Virtual network rules allow chosen subnets. The strongest option is a private endpoint, which gives the server a private IP address inside your virtual network, so applications and connected corporate networks reach it without crossing the public internet. When private endpoints are in place, you can disable public network access entirely.

flowchart LR
  subgraph VN["Your virtual network"]
    APP["Application with managed identity"]
    PE["Private endpoint with private IP"]
  end
  CORP["Corporate network via VPN or ExpressRoute"] --> PE
  APP --> PE
  PE --> SRV["Logical server with public access disabled"]
  SRV --> DB["Database with TDE, auditing and Defender"]
  NET["Public internet"] -.->|"Blocked"| SRV
  DB -.->|"Audit logs"| LA["Log Analytics and storage"]
  ENTRA["Microsoft Entra ID"] -.->|"Tokens and roles"| SRV
Figure 5: A locked-down layout with private connectivity, Entra authentication and audit streaming

Layer 2: who are you

Authentication proves identity. SQL authentication uses a user name and password stored in the database. Microsoft Entra authentication uses the company’s central identity system, so access follows people joining or leaving, multi-factor sign-in applies, and no passwords live in config files. Applications running in Azure should use managed identities, which let the service prove who it is with no secret at all. A server can be set to Entra-only authentication, which switches SQL passwords off completely.

Layer 3: what may you do

Authorization decides actions. Database roles such as reader and writer give broad rights, and permissions on individual tables, views and procedures give narrow ones. Good practice is least privilege: the web application account gets only the rights it needs, not owner rights. Two features go further. Row-level security filters rows by who is asking, so a user from one tenant never sees another tenant’s rows even if the query forgets a filter. Dynamic data masking hides part of sensitive values, such as showing only the last four digits of a card number, for users without special permission.

Layer 4: protecting the data itself

Transparent data encryption, or TDE, encrypts data files, backups and logs at rest, and it is turned on by default for new databases. You can let Azure manage the key or use a customer-managed key held in Azure Key Vault. Connections use TLS, and you can set a minimum version. For especially sensitive columns there is Always Encrypted, where the application encrypts data before sending it and only holds the key itself, so even database administrators and Microsoft staff see only scrambled values. Ledger tables add tamper evidence, keeping a cryptographic record that proves rows have not been altered behind the scenes.

Layer 5: seeing and detecting

Auditing records events such as sign-ins, queries and permission changes to storage, a log analytics workspace or an event hub. Microsoft Defender for SQL adds vulnerability assessments, which scan for risky settings, and threat detection, which warns about patterns such as injection attempts or sign-ins from unusual places. Data discovery and classification labels columns that hold personal or financial information so reports and policies can find them.

ThreatMain defense
Stranger scanning the internetFirewall rules, private endpoint, disabled public access
Stolen or reused passwordEntra authentication with multi-factor sign-in, Entra-only mode, managed identities
Over-powered application accountLeast-privilege roles, separate accounts per application
One tenant seeing another’s dataRow-level security and tested tenant filters
Stolen backup or diskTransparent data encryption, customer-managed keys
Administrator reading secretsAlways Encrypted for chosen columns, auditing
SQL injectionParameterized queries, threat detection, least privilege
Quiet tamperingLedger tables, audit logs sent to protected storage
!
Never concatenate user input into queries

SQL injection happens when text typed by a user becomes part of the query text itself. Always pass user values as parameters so the database treats them as data, never as commands. This single habit blocks one of the oldest and most common attacks.

12Monitoring, Logging and Metrics

Four views answer almost every question: what the platform measures, what the engine remembers, what the logs say, and what alerts tell you before users do.

Platform metrics in Azure Monitor

Without any setup you receive numbers for each database: CPU percentage, data input and output percentage, log write percentage, workers and sessions percentage, storage used, deadlocks, connection counts and failed connections. For DTU databases, a single DTU percentage blends the main resources. For serverless, you also see the cores used and whether the database is paused. These can be charted, put on a dashboard and used for alerts.

Query-level insight

Platform numbers tell you the database is busy. Query-level views tell you why. Query Performance Insight in the portal lists the queries that use the most CPU, time or reads. The Query Store keeps their history and plans so you can compare today with last week. Dynamic management views, called DMVs, are built-in system views that show current requests, waits, blocking chains and missing index suggestions. Intelligent Insights and automatic tuning recommendations point out patterns such as plan regressions or resource limits being hit.

Logs and diagnostics

Diagnostic settings can stream metrics, blocked-process reports, deadlock details, errors, timeouts and query statistics into a Log Analytics workspace, a storage account or an event hub. Streaming the audit log to a protected location gives a trail for security investigations. Extended Events let you capture detailed events for a short period to study a specific problem.

Alerts that matter

Alert

Sustained high CPU

CPU above 80 percent for ten minutes means capacity or a bad query. Look at top queries before resizing.

Alert

Log or worker pressure

High log write or worker percentage signals bulk writes or too many concurrent requests.

Alert

Storage near the limit

When used space nears the size cap, writes fail. Alert at 80 percent and grow ahead of time.

Alert

Failed connections and deadlocks

A jump points to network rules, credentials, retry bugs or lock design problems.

Alert

Replication lag

A growing gap between primary and secondary shows how much data a failover could lose.

Alert

Security events

Defender alerts and unusual sign-ins should reach a person fast.

A calm way to investigate slowness

1

Which resource is high?

Check CPU, data input and output, log rate and workers in the metrics view.

2

Which queries use it?

Open Query Performance Insight or Query Store and sort by the resource that is high.

3

What are they waiting for?

Look at wait types to separate locks from log writes from data reads.

4

Did something change?

Compare plans over time, and look at deployments, statistics updates and traffic patterns.

5

Fix the cause, then size

Tune the query or index first. Resize only if the healthy workload truly needs more.

13Understanding the Bill

The monthly cost is built from a small number of meters. If you know them, you can predict, reduce and explain the bill.

Meter 1

Compute

Provisioned cores billed per hour while the database exists, or serverless cores billed per second of use. In the DTU model, the package price includes compute.

Meter 2

Data storage

Billed for the maximum size you configured in some tiers, and for the space used in others. It is charged even while a serverless database is paused.

Meter 3

Backup storage

Backup space up to the size of your database is generally included. More is billed, including long-term retention and geo copies.

Meter 4

Replicas

Each geo-replica and extra read replica is a full compute and storage cost of its own.

Meter 5

Add-ons

Defender for SQL, log analytics ingestion and zone redundancy have separate prices.

Meter 6

Network

Data leaving Azure or crossing regions is billed per gigabyte, which matters for large exports and cross-region replicas.

Ways to pay less

Match the tier to the need instead of defaulting to the most powerful. Use serverless for databases that sit idle for hours. Use elastic pools for many small databases with uneven use. Apply the Azure Hybrid Benefit if you already own SQL Server licenses with Software Assurance, which removes the license part of the vCore price for provisioned compute. Buy reserved capacity for one or three years for steady production databases at a discount. Delete forgotten test databases. Reduce the backup retention of non-critical databases. Microsoft also offers a limited free monthly allowance for new databases, whose terms change, so check the current page before relying on it.

A serverless versus provisioned example

The prices below are invented round numbers for illustration. Imagine a provisioned database with 4 cores at 0.25 dollars per core-hour. It runs all month, 730 hours, so the compute bill is 4 times 0.25 times 730, or 730 dollars. Now take a reporting database that really needs up to 4 cores but is only busy about six hours a day. Serverless charges a higher rate per core-second, say 0.35 dollars per core-hour, but only for cores in use. Six hours at 4 cores is 24 core-hours a day, which over 30 days is 720 core-hours, and at 0.35 that is 252 dollars. That is about 65 percent less, plus the same storage cost as before. If the same database were busy sixteen hours a day, serverless would cost 4 times 16 times 30 times 0.35, or 672 dollars, much closer to the provisioned price. The saving depends entirely on idle time.

i
Costs hide in the copies

A production database with a geo-replica, a read replica and a long-term retention policy can cost three times a single copy. Make sure each copy has a reason that someone can state out loud.

14Compatibility and Migration

Because Azure SQL Database shares its engine with SQL Server, many applications move easily. A few differences, though, decide whether a migration is quick or painful.

What is different from a full SQL Server

Azure SQL Database provides the database, not the whole instance. Anything that belongs to the instance rather than the database is unavailable or handled differently. There is no SQL Server Agent for scheduling jobs, so scheduled work moves to elastic jobs, to Azure Functions, Data Factory or other schedulers. Queries that join tables across two databases on the same server are not generally allowed, and the limited elastic query feature or a redesign takes its place. Linked servers, some uses of the common language runtime, and some server-level settings are not offered. If your application depends heavily on these, Managed Instance may be the better home.

CapabilityAzure SQL DatabaseManaged InstanceSQL Server on a VM
Administration effortLowestLowHighest
SQL Agent jobsNo, use elastic jobs or other schedulersYesYes
Cross-database queriesLimitedYesYes
Linked serversNoLimited supportYes
Operating system accessNoneNoneFull
Serverless and HyperscaleYesNoNot applicable
Elastic poolsYesInstance poolsNot applicable
Best forNew apps and multi-tenant productsLifting existing apps with little changeFull control and special features

Planning a migration

1

Assess

Run Microsoft’s migration assessment tools against the source to list unsupported features and compatibility issues, and to suggest a size.

2

Choose the target

Decide between SQL Database, Managed Instance and a virtual machine, then pick tier, size and redundancy.

3

Fix the blockers

Replace the agent jobs, rewrite cross-database queries and update connection and sign-in code.

4

Move the data

Small databases can use a BACPAC export and import. Larger or live systems use the Azure Database Migration Service, which can keep the target synchronized until the final switch.

5

Test and cut over

Compare results and speed under realistic load, rehearse the switch, then redirect the application and keep the old system until you are sure.

!
Test performance, not just correctness

The same query can use a different plan on a new engine version or with different storage speed. Test with real data volumes before cutover, and check Query Store for plans that changed.

15Built-in Features Worth Knowing

Beyond tables and queries, the engine ships with several features that remove whole categories of custom code. Knowing they exist saves weeks of building and maintaining your own versions.

Temporal tables: a built-in history

A temporal table, also called a system-versioned table, automatically keeps every earlier version of each row in a paired history table, with start and end times. When a row is updated or deleted, the old version is moved into history by the engine itself. You can then ask “show me this customer’s address as it was on the first of March” or “what changed in the last hour”. This is excellent for audit trails, for undoing mistakes at row level and for analyzing trends, and it needs no triggers or custom code. The history grows over time, so set a retention period that deletes very old versions.

JSON, graph, spatial and text

Not all data is a neat grid. The engine can store, validate and query JSON text, so a flexible document can sit in a column next to ordinary ones, and parts of it can be read or indexed. Graph tables model many-to-many relationships such as “who follows whom” or “which parts belong to which assemblies”. Spatial types handle map coordinates and distance searches. Full-text search finds words and phrases inside long text columns faster and more flexibly than simple pattern matching. These let one database serve several shapes of data without extra services.

Tracking changes for other systems

Many systems need to know what changed since they last looked, for example to refresh a search index or feed a data warehouse. Change tracking records which rows changed, so a reader can ask for all rows altered since a given version. Change data capture goes further and records the actual before and after values for each change in separate tables. Both avoid the clumsy method of scanning whole tables and comparing them. Microsoft also offers ways to mirror data from Azure SQL Database into Microsoft Fabric for analytics, so reporting can run on a copy without loading the transactional database; check the current documentation for the exact status and limits.

Elastic jobs and elastic query

Because there is no SQL Agent, elastic jobs fill the gap for running a script on a schedule against one database, many databases or a whole pool. They are the usual tool for applying a schema update to hundreds of tenant databases, collecting maintenance results or rebuilding indexes on a timetable. Elastic query lets one database read tables from another, which covers limited cross-database reporting, though it is not a full replacement for same-instance queries.

Intelligent query processing

Newer compatibility levels switch on a family of optimizer improvements. For example, the engine can adjust the memory it grants to a query based on how much the last run really used, and can choose a better join method while the query is running if the first estimate proved wrong. These improvements require no code change, only the right compatibility level and some testing.

FeatureWhat it doesTypical use
Temporal tablesKeep every old version of rows automaticallyAudit, row-level undo, trend analysis
JSON supportStore and query flexible documents in columnsSemi-structured attributes, API payloads
Graph tablesModel nodes and many-to-many linksSocial links, recommendations, hierarchies
Full-text searchFast word and phrase search in textProduct search, document lookup
Change tracking and change data captureReport which rows changed and howFeeding search, warehouses and caches
Elastic jobsScheduled scripts across many databasesTenant schema updates, maintenance
Ledger tablesCryptographic proof of untampered historyFinancial and compliance records
Columnstore indexesCompressed column storage for scanningReporting tables and aggregations
Everyday analogy

Think of a well-equipped kitchen. You can chop vegetables with a plain knife, but a food processor, a timer and a thermometer remove hours of fiddly work and mistakes. These engine features are the appliances. You can cook without them, but cooking with them is quicker and more reliable.

i
Use the platform before you build your own

Before writing triggers, home-made history tables or custom schedulers, check whether a built-in feature does the job. Built-in features are tested at scale, work with backups and replication, and are understood by new teammates.

16Advantages, Disadvantages and Trade-offs

A fair look at strengths and limits helps you decide when Azure SQL Database is the right answer and when something next to it is better.

Advantages

  • No servers, operating systems or database software to patch
  • Built-in high availability, backups and point-in-time restore
  • Familiar SQL Server language, tools and skills
  • Three tiers plus serverless and elastic pools to fit many workloads
  • Strong security features: private endpoints, Entra sign-in, encryption, auditing, Defender
  • Intelligent features: Query Store, automatic plan correction, tuning advice
  • Easy integration with Azure monitoring, identity, networking and analytics

Disadvantages

  • Less control than an instance: no agent, limited cross-database queries
  • Resource limits per size mean bulk jobs can hit log or worker ceilings
  • Scaling causes a brief disconnect that applications must handle
  • Cost grows with every replica, long retention and add-on
  • Single writer design: writes scale up, not out, outside Hyperscale readers
  • Vendor-specific features create some lock-in
  • Poor queries still cost money no matter how smart the platform is

How it compares with nearby choices

OptionStrengthPick it when
Azure SQL DatabaseManaged relational engine with strong transactionsStructured data with relationships and a need for SQL Server compatibility
Azure SQL Managed InstanceNearly full SQL Server feature set as a serviceMoving existing instance-level applications
Azure Cosmos DBGlobally distributed, flexible-schema data with low delayMassive scale-out writes, JSON documents, multi-region writes
Azure Database for PostgreSQL or MySQLManaged open-source relational enginesTeams standardized on those engines and extensions
Azure Synapse or Fabric warehouseMassive parallel analyticsHeavy reporting across huge historical data
Amazon RDS and Aurora, Google Cloud SQLComparable managed databases on other cloudsYour application stack lives there

The three main trade-offs

Control versus convenience. Every feature Azure manages for you is one you cannot tune yourself. Performance versus cost. A faster tier with more replicas gives lower delay and more safety at a higher price. Consolidation versus isolation. Packing many databases in a pool is cheap, but a noisy tenant can still affect others, while a database per tenant on its own compute is safe and expensive. Decide per workload, and revisit the decision as the numbers change.

17Design Patterns and Anti-Patterns

Experienced teams reuse a short list of shapes. Knowing them saves months of trial and error.

Patterns that work

Pattern

Database per tenant in a pool

Each customer gets a database; an elastic pool shares compute. Strong isolation, easy per-customer restore and removal, and one customer’s schema upgrade does not touch another.

Pattern

Shared database with row-level security

All tenants share tables, each row carries a tenant identifier, and security rules enforce the filter. Cheapest per tenant, with the strictest need to test isolation.

Pattern

Read offloading

Reporting and search read from a replica, using the read-only intent in the connection, keeping the primary free for transactions.

Pattern

Cache in front

A cache such as Azure Cache for Redis holds popular, rarely changing results, cutting repeated queries.

Pattern

Outbox for messages

An application writes the business change and an outgoing message row in one transaction, and a separate process publishes the message, so data and events never disagree.

Pattern

Sharding across databases

When a single database cannot hold the load, divide data by a key across several databases, supported by elastic database tools and a shard map.

flowchart LR
  APP["Application tier"] --> CAT["Tenant catalog: tenant to database map"]
  APP -->|"Route by tenant"| POOL
  subgraph POOL["Elastic pool shared compute"]
    T1["Tenant A database"]
    T2["Tenant B database"]
    T3["Tenant C database"]
    T4["Large tenant D database"]
  end
  JOB["Elastic job: schema updates and maintenance"] --> T1
  JOB --> T2
  JOB --> T3
  JOB --> T4
Figure 6: Database per tenant in an elastic pool, with a catalog for routing and jobs for shared maintenance

Anti-patterns to avoid

ANTI-PATTERN 01Avoid
What it looks like

Fetching a list, then running one extra query for every item in the list.

Why it hurts

A page with 200 items sends 201 requests. Each has its own network trip, so latency adds up and the database spends effort on overhead, not work.

Better choice

Use a join or one batched query that returns everything the page needs.

ANTI-PATTERN 02Avoid
What it looks like

Using the database as a message queue or a scratchpad for files, with constant polling of a table.

Why it hurts

Polling burns compute, locks fight with one another and large blobs inflate storage and backup costs.

Better choice

Use Service Bus or Event Hubs for messages and Blob Storage for files, saving only references in the database.

ANTI-PATTERN 03Avoid
What it looks like

Opening a new connection for every request and never closing it.

Why it hurts

Sign-ins pile up, connection and worker limits are reached, and users see timeouts.

Better choice

Use connection pooling, release connections quickly and size pools to the database limits.

ANTI-PATTERN 04Avoid
What it looks like

Solving every slowdown by raising the tier.

Why it hurts

A bad query keeps its cost on a bigger server, so the bill rises and the cause remains.

Better choice

Find the top queries first, fix indexes and query shape, then resize only if a healthy workload still needs more.

18Best Practices and Common Mistakes

These habits come from running databases in production for years. Most cost very little and prevent most of the painful stories.

1

Build retries into the application

Handle transient errors with backoff, reconnect on dropped connections and make writes safe to repeat.

2

Use Entra identities and managed identities

Avoid shared passwords, grant least privilege and consider Entra-only authentication.

3

Keep the network private

Use private endpoints, turn off public access when you can, and keep firewall rules short and documented.

4

Keep transactions short

Do the thinking before you begin and commit fast. Long transactions hold locks and block everyone behind them.

5

Index with evidence

Use Query Store and missing-index data to guide changes, test them, and remove unused ones.

6

Plan recovery and rehearse it

Set retention to match business needs, copy backups to the right redundancy, and practice both restore and failover.

7

Set alerts and review cost

Watch CPU, storage and replication lag, and review the bill monthly for idle databases and unneeded replicas.

8

Treat the schema as code

Keep scripts in version control and apply them through a pipeline, so every environment matches and changes are reviewed.

Common mistakes

Mistake

Open firewall to everyone

Allowing the whole internet range “just for testing” and forgetting to remove it is a common cause of attacks.

Mistake

Admin account in the application

If the app uses the server admin login, one injection bug exposes everything.

Mistake

Ignoring the size limit

A database that reaches its maximum size refuses writes. Alert and grow early.

Mistake

Treating replicas as backups

A bad delete reaches every replica instantly. Only backups bring data back.

Mistake

Wrong data types

Storing numbers as text, or mismatching types in comparisons, blocks index use and invites bugs.

Mistake

Forgotten test databases

Provisioned copies left running for months quietly add to the bill. Use serverless or delete them.

Fix the query before you buy the cores, and fix the retry logic before you blame the cloud.

19Failure Scenarios and Recovery

Failures come from hardware, from software, from people and from attackers. The table below pairs the usual ones with the first response.

ScenarioWhat you noticeRecovery
Node failure or platform updateBrief disconnects, a few seconds of errorsAutomatic failover; the application reconnects with retry logic
Zone outageShort disruptionZone redundancy keeps replicas in other zones
Region outagePrimary region unreachableFail over the failover group to the secondary region, or geo-restore if no replica exists
Accidental delete or bad updateWrong or missing dataPoint-in-time restore to a new database just before the mistake, then copy rows back
Dropped databaseDatabase goneRestore the deleted database from backups within retention
Blocking pile-upRequests wait, workers fillFind the head blocker in the system views, end or fix the long transaction
DeadlocksSome requests fail with a deadlock victim errorRetry the victim and redesign access order or indexes; inspect deadlock graphs
Plan regression after changeA previously fast query becomes slowCompare plans in Query Store and force the earlier plan, or use automatic tuning
Storage or log limit reachedWrites fail with a size or log errorGrow the database, free space, shorten transactions and batch bulk loads
Compromised credentialsUnusual logins or data readsDisable the account, rotate secrets, review audit logs and Defender alerts
Serverless database pausedFirst connection is slow or times outRetry; extend timeouts or disable auto-pause for latency-sensitive systems

Recovery objectives in plain words

Two numbers guide any plan. The recovery point objective says how much recent data you can afford to lose, measured in time. The recovery time objective says how long the system may be unavailable. Zone redundancy gives near-zero data loss and a fast switch. A failover group gives seconds of possible loss and minutes of switch time. Backups give a flexible point in time, but a longer restore. Write both numbers for each system, then choose the cheapest combination that meets them.

Everyday analogy

Think of protecting an important essay. Auto-save protects against a power cut. A copy on another computer protects against a stolen laptop. A dated folder of old versions protects against you deleting the best paragraph last week. Each guards against a different bad day.

Failing over with confidence

1

Confirm the problem is regional

Check Azure service health and your own metrics so you do not fail over because of an application bug.

2

Choose the failover type

Use planned failover when the primary is reachable, so no data is lost. Use forced failover only when it is not, and accept possible loss.

3

Verify the application

Because listener names move, connections should recover. Check sign-ins, jobs and dependent services.

4

Rebuild protection

Create a new secondary so you are again protected, and plan the move back if needed.

5

Write it down

Record timing and surprises, and improve the runbook.

20Real-World Usage Examples

Five common workloads show how the ideas combine. Figures are illustrative, not from a particular customer.

A software-as-a-service product with hundreds of customers

A company sells a scheduling tool. Each customer has its own database inside a few elastic pools, grouped by size. A catalog database maps customers to databases. Elastic jobs apply schema changes in waves. A large customer can be moved out of the pool to its own compute with one operation, and restoring one customer after a mistake never touches another.

An online store’s order system

Orders, payments and stock live in a Business Critical database with zone redundancy, because every second of downtime costs sales. Product searches read from the built-in readable replica. A failover group in a second region protects against a regional outage. Payment inserts carry a unique request identifier so a retry after a dropped connection cannot charge twice.

An internal business application with a quiet night

A staff portal used from eight in the morning to six in the evening runs on General Purpose serverless. It scales up for the morning rush, falls to the minimum during lunch and pauses overnight, so the compute bill follows the working day rather than the calendar.

A fast-growing data platform

A telemetry service stores billions of rows and expects growth into tens of terabytes. It uses Hyperscale so backups and restores stay fast as it grows, and adds named read replicas for analysts and a separate one for dashboards, so heavy reports never touch the main writer.

Moving a legacy application to the cloud

A company moves an accounting program from an on-premises server. An assessment shows it uses agent jobs and cross-database queries, so they pick Managed Instance for the first move and plan to split off the newer reporting parts into Azure SQL Database later, after rewriting the queries. The migration uses continuous synchronization so the final switch takes minutes.

i
The common thread

Every example chooses the tier from the workload shape, protects against the failure that would hurt most, sends reads to replicas where it helps, and watches cost against actual use.

21Frequently Asked Questions

Short answers to the questions people ask most when they first meet Azure SQL Database.

Q1Is Azure SQL Database the same as SQL Server?
They share the same core engine and language, but Azure SQL Database is a managed service for a single database. It leaves out some instance-level features of a full SQL Server.
Q2What is a logical server?
It is an administrative container that holds the network name, sign-in settings, firewall rules and policies for a group of databases. It is not a physical machine.
Q3Should I choose vCore or DTU?
Choose vCore for most production systems because it offers flexibility, serverless, Hyperscale and license savings. Choose DTU packages for small, simple databases where a ready-made size is easier.
Q4Which tier is right for me?
General Purpose suits most business applications, Business Critical suits heavy transactions with the lowest delay, and Hyperscale suits very large or fast-growing data.
Q5When does serverless make sense?
When the database is idle for long periods or its load swings widely, such as development, internal tools and seasonal applications. It is less suited to steady all-day load.
Q6Do I need to take backups myself?
No. Backups run automatically. You choose retention, redundancy and any long-term retention schedule, and you test restoring.
Q7Does a restore overwrite my database?
No. A restore always creates a new database. You then switch to it or copy data back.
Q8What is the difference between geo-replication and a failover group?
Geo-replication copies one database to another region. A failover group manages many databases together and adds stable listener names so applications keep the same connection string after failover.
Q9Why do I get a connection error right after scaling?
Scaling ends with a brief switch that drops open connections. Applications should retry and reconnect.
Q10How do I keep the database off the public internet?
Create a private endpoint inside your virtual network, then disable public network access on the server.
Q11Can I run scheduled jobs?
There is no SQL Agent. Use elastic jobs, Azure Functions, Data Factory or another scheduler to run work on a timetable.
Q12Is my data encrypted?
Yes. Data at rest uses transparent data encryption by default, and connections use TLS. You can add customer-managed keys and Always Encrypted for chosen columns.
Q13How do I find the slowest queries?
Open Query Performance Insight or Query Store, sort by CPU, duration or reads, and look at the plans of the top few.
Q14Can I query across databases?
Not freely. The elastic query feature supports limited cases. Otherwise redesign, combine data, or use Managed Instance where such queries work.
Q15How do I reduce the bill?
Right-size the tier, use serverless or pools for uneven loads, apply Azure Hybrid Benefit and reservations to steady databases, shorten retention where allowed, and remove unneeded replicas and test copies.
Q16Does a higher tier fix a slow query?
Only sometimes. A badly written query or missing index stays expensive on bigger hardware. Tune first, then resize.

22Summary and Key Takeaways

What to remember about Azure SQL Database

  • It is a managed relational database. You get the SQL Server engine and language without running servers, patches or backups, with a logical server as the address and rulebook for your databases.
  • Pick the model and tier from the workload. vCore is the flexible default, General Purpose fits most applications, Business Critical gives the lowest delay with local replicas, and Hyperscale handles very large data with fast backups and restores.
  • Understand the commit. Write-ahead logging makes confirmed data safe, row versioning reduces blocking, and Query Store with automatic tuning protects against plan regressions.
  • Layer your availability. Built-in replicas handle machine failure, zone redundancy handles a building, failover groups handle a region, and backups with point-in-time restore handle human mistakes.
  • Design for transient faults. Retry with backoff, pool connections, keep transactions short and make writes safe to repeat.
  • Secure in layers. Private endpoints, Entra and managed identities, least privilege, encryption, row-level security, auditing and Defender each cover a different threat.
  • Tune first, size second, and watch the cost. Fix queries and indexes before buying cores, use serverless and pools for uneven load, and justify every replica and retention setting.