Azure SQL load balance consideration
In this article I explained about
the Azure SQL Load balance with read only replicas
What is read only replicas?
The
replica of the primary database which allows read only access. Secondary
replica can be in either synchronous-commit availability mode, or
asynchronous-commit availability mode.
Availability of read only replicas
Availability of read only replicas are
based on the tiers. Read Scale-Out is enabled by default on Premium, Business
Critical and Hyper scale service tiers. Read Scale-Out cannot be enabled in Basic, Standard, or General Purpose service
tiers. Read Scale-Out is automatically disabled on Hyper scale databases
configured with 0 replicas.
You can disable and re-enable Read
Scale-Out on single databases and elastic pool databases in Premium or Business
Critical service tiers.
Consuming read only replicas
We have option to configure the
application indent as below and point the connections to the read only / read
write replica.
Server=tcp:<server>.database.windows.net;Database=<mydatabase>;ApplicationIntent=ReadOnly;User ID=<myLogin>;Password=<myPassword>;Trusted_Connection=False;
Encrypt=True;
Server=tcp:<server>.database.windows.net;Database=<mydatabase>;ApplicationIntent=
ReadWrite;User
ID=<myLogin>;Password=<myPassword>;Trusted_Connection=False;
Encrypt=True;
Pros:
- The read-only workload will be isolated from the main read-write workload and will not affect its performance.
Cons:
- There may be some small latency between different replicas this latency is caused by an asynchronous transaction log redo operation.
Note:
TempDB
database is not replicated to the read-only replicas. Each replica has its own
version of TempDB database that is created when the replica is created. It
ensures that TempDB is updateable and
can be modified during your query execution. If your read-only workload
depends on using TempDB objects, you should create these objects as part of
your query script.
Comments
Post a Comment