Home
%3CLINGO-SUB%20id%3D%22lingo-sub-369131%22%20slang%3D%22en-US%22%3EAzure%20SQL%20DB%20with%20more%20than%204%20readable%20secondaries%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-369131%22%20slang%3D%22en-US%22%3E%0A%20%26lt%3Bmeta%20http-equiv%3D%22Content-Type%22%20content%3D%22text%2Fhtml%3B%20charset%3DUTF-8%22%20%2F%26gt%3B%3CSTRONG%3EFirst%20published%20on%20MSDN%20on%20Nov%2020%2C%202018%20%3C%2FSTRONG%3E%20%3CBR%20%2F%3E%20If%20you%20try%20to%20create%20more%20than%204%20geo-replicas%20in%20the%20Portal%20it%20will%20fail%20with%26nbsp%3Bthe%20error%20message%20%22%20%3CSTRONG%3E%20Replication%20limit%20reached.%20The%20database%20'XXXXX'%20cannot%20have%20more%20than%204%20replication%20relationships.%20%3C%2FSTRONG%3E%20%22%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20There%20are%20%3CSTRONG%3E%203%20ways%20%3C%2FSTRONG%3E%20to%20resolve%20this%20problem%3A%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CH3%20id%3D%22toc-hId-1505481724%22%20id%3D%22toc-hId-1540662045%22%3E%3CSTRONG%3E%20Solution%201%3A%20C%20%3CEM%3E%20haining%20(secondary%20of%20a%20secondary)%3C%2FEM%3E%20%3C%2FSTRONG%3E%3C%2FH3%3E%3CBR%20%2F%3E%20*Be%20sure%20to%20check%20supportability%20below%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20According%20to%20the%20DOC%3A%20%3CA%20href%3D%22https%3A%2F%2Femea01.safelinks.protection.outlook.com%2F%3Furl%3Dhttps%253A%252F%252Fdocs.microsoft.com%252Fen-us%252Fazure%252Fsql-database%252Fsql-database-geo-replication-overview%2523active-geo-replication-capabilities%26amp%3Bdata%3D02%257C01%257CSergio.Fonseca%2540microsoft.com%257C320172e54d56487193ae08d64955a325%257C72f988bf86f141af91ab2d7cd011db47%257C1%257C0%257C636777029526610439%26amp%3Bsdata%3D%252FcTFMdgmR0x%252BUrNqUgaq%252B1IFs%252BSSsZpRGIKAYSn5vlg%253D%26amp%3Breserved%3D0%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%20https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsql-database%2Fsql-database-geo-replication-overview%23active-geo-replication-capabilities%3C%2FA%3E%20%3CBR%20%2F%3E%3CBLOCKQUOTE%3E%3CSTRONG%3E%3CEM%3EMultiple%20readable%20secondaries%20%3C%2FEM%3E%20%3C%2FSTRONG%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CEM%3E%20Two%20or%20more%20secondary%20databases%20increase%20redundancy%20and%20level%20of%20protection%20for%20the%20primary%20database%20and%20application.%20If%20multiple%20secondary%20databases%20exist%2C%20the%20application%20remains%20protected%20even%20if%20one%20of%20the%20secondary%20databases%20fails.%20If%20there%20is%20only%20one%20secondary%20database%2C%20and%20it%20fails%2C%20the%20application%20is%20exposed%20to%20higher%20risk%20until%20a%20new%20secondary%20database%20is%20created.%20%3C%2FEM%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CSTRONG%3E%3CEM%3ENote%20%3C%2FEM%3E%20%3C%2FSTRONG%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CEM%3E%20If%20you%20are%20using%20active%20geo-replication%20to%20build%20a%20globally%20distributed%20application%20and%20need%20to%20provide%20read-only%20access%20to%20data%20in%20more%20than%20four%20regions%2C%20you%20can%20create%20%3CSTRONG%3E%20secondary%20of%20a%20secondary%20(a%20process%20known%20as%20chaining)%20%3C%2FSTRONG%3E%20.%20This%20way%20you%20can%20achieve%20virtually%20unlimited%20scale%20of%20database%20replication.%20In%20addition%2C%20chaining%20reduces%20the%20overhead%20of%20replication%20from%20the%20primary%20database.%20%3CSTRONG%3E%20The%20trade-off%20is%20the%20increased%20replication%20lag%20on%20the%20leaf-most%20secondary%20databases.%20%3C%2FSTRONG%3E%20%3C%2FEM%3E%3C%2FBLOCKQUOTE%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20Sample%20in%20Powershell%20%3CBR%20%2F%3E%20Connect-AzureRmAccount%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%24databasename%20%3D%20%22TEST%22%20%3CBR%20%2F%3E%20%24primaryresourcegroupname%20%3D%20%22RESGROUP%22%20%3CBR%20%2F%3E%20%24primaryservername%20%3D%20%22SECONDARYSERVER%22%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%24secondaryresourcegroupname%20%3D%20%22RESGROUP%22%20%3CBR%20%2F%3E%20%24secondaryservername%20%3D%20%22SECONDARYOFSECONDARYSERVER%22%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%24database%20%3D%20Get-AzureRmSqlDatabase%20%60%20%3CBR%20%2F%3E%20-DatabaseName%20%24databasename%20%60%20%3CBR%20%2F%3E%20-ResourceGroupName%20%24primaryresourcegroupname%20%60%20%3CBR%20%2F%3E%20-ServerName%20%24primaryservername%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%24database%20%7C%20New-AzureRmSqlDatabaseSecondary%20%60%20-PartnerResourceGroupName%20%24secondaryresourcegroupname%20%60%20%3CBR%20%2F%3E%20-PartnerServerName%20%24secondaryservername%20%60%20%3CBR%20%2F%3E%20-AllowConnections%20%22All%22%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20Get-AzureRmSqlDatabaseReplicationLink%20%60%20%3CBR%20%2F%3E%20-DatabaseName%20%24databasename%20%60%20%3CBR%20%2F%3E%20-PartnerResourceGroupName%20%24secondaryresourcegroupname%20%60%20%3CBR%20%2F%3E%20-PartnerServerName%20%24secondaryservername%20%60%20-ServerName%20%24primaryservername%20%60%20%3CBR%20%2F%3E%20-ResourceGroupName%20%24primaryresourcegroupname%20%3CBR%20%2F%3E%20LinkId%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%3A%201647023e-1235-4dc5-be04-448f1fb9cb72%20%3CBR%20%2F%3E%20ResourceGroupName%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%3A%20RESGROUP%20%3CBR%20%2F%3E%20ServerName%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%3A%20%3CSTRONG%3E%20SECONDARYSERVER%20%3C%2FSTRONG%3E%20%3CBR%20%2F%3E%20DatabaseName%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%3A%20TEST%20%3CBR%20%2F%3E%20Role%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%3A%20Primary%20%3CBR%20%2F%3E%20Location%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%3A%20West%20US%20%3CBR%20%2F%3E%20PartnerResourceGroupName%20%3A%20RESGROUP%20%3CBR%20%2F%3E%20PartnerServerName%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%3A%20%3CSTRONG%3E%20SECONDARYOFSECONDARYSERVER%20%3C%2FSTRONG%3E%20%3CBR%20%2F%3E%20PartnerRole%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%3A%20Secondary%20%3CBR%20%2F%3E%20PartnerLocation%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%3A%20East%20US%20%3CBR%20%2F%3E%20AllowConnections%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%3A%20All%20%3CBR%20%2F%3E%20ReplicationState%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%3A%20%3CSTRONG%3E%20CATCH_UP%20%3C%2FSTRONG%3E%20%3CBR%20%2F%3E%20PercentComplete%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%3A%20100%20%3CBR%20%2F%3E%20StartTime%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%3A%202018-11-13%2010%3A21%3A55%20AM%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20Pay%20attention%20this%20can%20lead%20to%20an%20%3CSTRONG%3E%20unsupported%20scenario%26nbsp%3Bif%20you%20failover%20to%20this%20(Secondary%20%2F%20Primary)%20you%20will%20have%20more%20than%204%20replicas%20for%201%20primary%20%3C%2FSTRONG%3E%20.%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20If%20you%20fail%20back%20to%20the%20primary%20it%20will%20still%20stay%20in%20unsupported%20scenario%2C%20and%20if%20you%20want%20to%20go%20back%20to%20a%20supported%20state%20you%20will%20need%20to%20break%20some%20replicas%20and%20create%20again%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F89081i5156C9AE55F3E194%22%20%2F%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20Note%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20Make%20sure%20also%20to%20have%20same%20SLO%20on%20secondaries.%26nbsp%3BSo%20primary%20could%20be%20P11%20but%20you%20set%20one%20geo-secondary%20to%20P6%20and%20then%20another%20one%20to%20P1%20(because%20they%20were%20directing%20lower%20load%20to%20this%20replica).%20Unfortunately%2C%20this%20sort%20of%20configuration%20led%20to%20the%20replicas%20lagging%20behind%2C%20%3CSTRONG%3E%20sometimes%20to%20the%20extent%20of%20becoming%20unhealthy%20when%20they%20could%20not%20keep%20up%20with%20the%20log%20generation%20load%20happening%20on%20primary%20%3C%2FSTRONG%3E%20.%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CH3%20id%3D%22toc-hId--1046675237%22%20id%3D%22toc-hId--1011494916%22%3E%3CSTRONG%3E%20Solution%202%3A%20Read%20Scale%20Out%20%3C%2FSTRONG%3E%3C%2FH3%3E%3CBR%20%2F%3E%20Here%20we%20see%20a%20%3CSTRONG%3E%20supported%20%3C%2FSTRONG%3E%20and%20more%20%3CSTRONG%3E%20cost%20effective%20%3C%2FSTRONG%3E%20solution%20using%20%3CSTRONG%3E%20Read%20Scale%20Out%20%3C%2FSTRONG%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20For%20each%20%3CSTRONG%3E%20PREMIUM%20%3C%2FSTRONG%3E%20server%20you%20have%20%3CSTRONG%3E%202%20endpoints%20%3C%2FSTRONG%3E%20.%20Considering%201%20primary%20%2B%204%20replicas%20%3D%20%3CSTRONG%3E%201%20READ%2FWRITE%20%3C%2FSTRONG%3E%20endpoint%20%2B%20%3CSTRONG%3E%209%20READ%20ONLY%20%3C%2FSTRONG%3E%20endpoints%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsql-database%2Fsql-database-read-scale-out%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3E%20https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsql-database%2Fsql-database-read-scale-out%20%3C%2FA%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F89082i3C24F5565502F6E6%22%20%2F%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20You%20need%20to%20enable%20ReadScale%20on%20all%20databases%20using%20power%20shell%20%3CBR%20%2F%3E%20%24databasename%20%3D%20%22teste%22%20%3CBR%20%2F%3E%20%24resourcegroupname%20%3D%20%22ResGroup%22%20%3CBR%20%2F%3E%20%24servername%20%3D%20%22server%22%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%24database%20%3D%20Get-AzureRmSqlDatabase%20%60%20%3CBR%20%2F%3E%20-DatabaseName%20%24databasename%20%60%20%3CBR%20%2F%3E%20-ResourceGroupName%20%24resourcegroupname%20%60%20%3CBR%20%2F%3E%20-ServerName%20%24servername%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%24database%20%7C%20Set-AzureRmSqlDatabase%20-ReadScale%20Enabled%20%3CBR%20%2F%3E%20And%20use%20the%20connection%20strings%20%3CBR%20%2F%3E%3CUL%3E%3CBR%20%2F%3E%3CLI%3E%3CBR%20%2F%3E%20Server%3Dtcp%3A%3CSERVER%3E.database.windows.net%3BDatabase%3D%3CMYDATABASE%3E%3B%20%3CSTRONG%3E%20ApplicationIntent%3DReadOnly%20%3C%2FSTRONG%3E%20%3BUser%20ID%3D%3CMYLOGIN%3E%3BPassword%3D%3CMYPASSWORD%3E%3BTrusted_Connection%3DFalse%3B%20Encrypt%3DTrue%3B%20%3CBR%20%2F%3E%3C%2FMYPASSWORD%3E%3C%2FMYLOGIN%3E%3C%2FMYDATABASE%3E%3C%2FSERVER%3E%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3E%3CBR%20%2F%3E%20Server%3Dtcp%3A%3CSERVER%3E.database.windows.net%3BDatabase%3D%3CMYDATABASE%3E%3B%20%3CSTRONG%3E%20ApplicationIntent%3DReadWrite%20%3C%2FSTRONG%3E%20%3BUser%20ID%3D%3CMYLOGIN%3E%3BPassword%3D%3CMYPASSWORD%3E%3BTrusted_Connection%3DFalse%3B%20Encrypt%3DTrue%3B%20%3CBR%20%2F%3E%3C%2FMYPASSWORD%3E%3C%2FMYLOGIN%3E%3C%2FMYDATABASE%3E%3C%2FSERVER%3E%3C%2FLI%3E%3CBR%20%2F%3E%3C%2FUL%3E%3CBR%20%2F%3E%20You%20can%20test%20on%20SSMS%20changing%20the%20%3CSTRONG%3E%20options%20%3C%2FSTRONG%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F89083iA2A18BEFBB0C24DA%22%20%2F%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20And%20you%20can%20check%20if%20you%20are%20on%20the%20%3CSTRONG%3E%20read%2Fwrite%20%3C%2FSTRONG%3E%20endpoint%20and%20other%20things%20like%20DTU%20using%20the%20TSQL%20below%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20*%20Note%3A%20On%20the%20geo-replica%20secondary%20both%20endpoints%20with%20show%20as%26nbsp%3BREAD_ONLY%2C%20however%20if%20you%20open%20two%20connection%20you%20should%20not%20see%20the%20other%20when%20you%20query%20the%26nbsp%3Bsys.dm_exec_connections%20%3CBR%20%2F%3E%20SELECT%20%3CBR%20%2F%3E%20%40%40SPID%2C%20%3CBR%20%2F%3E%20DB_NAME()%2C%20%3CBR%20%2F%3E%20%40%40SERVERNAME%2C%20%3CBR%20%2F%3E%20DATABASEPROPERTYEX(DB_NAME()%2C%20'Updateability')%2C%20%3CBR%20%2F%3E%20AVG(avg_cpu_percent)%20AS%20'Average%20CPU%20Utilization%20In%20Percent'%2C%20%3CBR%20%2F%3E%20MAX(avg_cpu_percent)%20AS%20'Maximum%20CPU%20Utilization%20In%20Percent'%2C%20%3CBR%20%2F%3E%20AVG(avg_data_io_percent)%20AS%20'Average%20Data%20IO%20In%20Percent'%2C%20%3CBR%20%2F%3E%20MAX(avg_data_io_percent)%20AS%20'Maximum%20Data%20IO%20In%20Percent'%2C%20%3CBR%20%2F%3E%20AVG(avg_log_write_percent)%20AS%20'Average%20Log%20Write%20I%2FO%20Throughput%20Utilization%20In%20Percent'%2C%20%3CBR%20%2F%3E%20MAX(avg_log_write_percent)%20AS%20'Maximum%20Log%20Write%20I%2FO%20Throughput%20Utilization%20In%20Percent'%2C%20%3CBR%20%2F%3E%20AVG(avg_memory_usage_percent)%20AS%20'Average%20Memory%20Usage%20In%20Percent'%2C%20%3CBR%20%2F%3E%20MAX(avg_memory_usage_percent)%20AS%20'Maximum%20Memory%20Usage%20In%20Percent'%20%3CBR%20%2F%3E%20FROM%20sys.dm_db_resource_stats%3B%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20SELECT%20*%20FROM%20sys.dm_exec_connections%20WHERE%20net_transport%20%3D%20'TCP'%20order%20by%20session_id%20DESC%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CH3%20id%3D%22toc-hId-696135098%22%20id%3D%22toc-hId-731315419%22%3E%3CSTRONG%3E%20Solution%203%3A%20Azure%20Data%20Sync%20%3C%2FSTRONG%3E%3C%2FH3%3E%3CBR%20%2F%3E%20Using%20this%20method%20you%20can%20sync%20between%20multiple%20databases%2C%20and%20will%20work%20like%20a%20merge%20replication%2C%20where%20all%20members%20can%20be%20read%2Fwrite%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsql-database%2Fsql-database-sync-data%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3E%20https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsql-database%2Fsql-database-sync-data%20%3C%2FA%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F89084iCA8E352268EF9C03%22%20%2F%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20Be%20sure%20to%20check%20the%20limitation%20on%20this%20approach%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsql-database%2Fsql-database-sync-data%23sync-req-lim%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3E%20https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsql-database%2Fsql-database-sync-data%23sync-req-lim%3C%2FA%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-369131%22%20slang%3D%22en-US%22%3EFirst%20published%20on%20MSDN%20on%20Nov%2020%2C%202018%20If%20you%20try%20to%20create%20more%20than%204%20geo-replicas%20in%20the%20Portal%20it%20will%20fail%20with%26nbsp%3Bthe%20error%20message%20%22Replication%20limit%20reached.%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-369131%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3Egeo%20replicated%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Egeodr%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Not applicable
First published on MSDN on Nov 20, 2018
If you try to create more than 4 geo-replicas in the Portal it will fail with the error message " Replication limit reached. The database 'XXXXX' cannot have more than 4 replication relationships. "

There are 3 ways to resolve this problem:


Solution 1: C haining (secondary of a secondary)


*Be sure to check supportability below

According to the DOC: https://docs.microsoft.com/en-us/azure/sql-database/sql-database-geo-replication-overview#active...
Multiple readable secondaries

Two or more secondary databases increase redundancy and level of protection for the primary database and application. If multiple secondary databases exist, the application remains protected even if one of the secondary databases fails. If there is only one secondary database, and it fails, the application is exposed to higher risk until a new secondary database is created.

Note

If you are using active geo-replication to build a globally distributed application and need to provide read-only access to data in more than four regions, you can create secondary of a secondary (a process known as chaining) . This way you can achieve virtually unlimited scale of database replication. In addition, chaining reduces the overhead of replication from the primary database. The trade-off is the increased replication lag on the leaf-most secondary databases.



Sample in Powershell
Connect-AzureRmAccount

$databasename = "TEST"
$primaryresourcegroupname = "RESGROUP"
$primaryservername = "SECONDARYSERVER"

$secondaryresourcegroupname = "RESGROUP"
$secondaryservername = "SECONDARYOFSECONDARYSERVER"

$database = Get-AzureRmSqlDatabase `
-DatabaseName $databasename `
-ResourceGroupName $primaryresourcegroupname `
-ServerName $primaryservername

$database | New-AzureRmSqlDatabaseSecondary ` -PartnerResourceGroupName $secondaryresourcegroupname `
-PartnerServerName $secondaryservername `
-AllowConnections "All"

Get-AzureRmSqlDatabaseReplicationLink `
-DatabaseName $databasename `
-PartnerResourceGroupName $secondaryresourcegroupname `
-PartnerServerName $secondaryservername ` -ServerName $primaryservername `
-ResourceGroupName $primaryresourcegroupname
LinkId                   : 1647023e-1235-4dc5-be04-448f1fb9cb72
ResourceGroupName        : RESGROUP
ServerName               : SECONDARYSERVER
DatabaseName             : TEST
Role                     : Primary
Location                 : West US
PartnerResourceGroupName : RESGROUP
PartnerServerName        : SECONDARYOFSECONDARYSERVER
PartnerRole              : Secondary
PartnerLocation          : East US
AllowConnections         : All
ReplicationState         : CATCH_UP
PercentComplete          : 100
StartTime                : 2018-11-13 10:21:55 AM



Pay attention this can lead to an unsupported scenario if you failover to this (Secondary / Primary) you will have more than 4 replicas for 1 primary .

If you fail back to the primary it will still stay in unsupported scenario, and if you want to go back to a supported state you will need to break some replicas and create again





Note

Make sure also to have same SLO on secondaries. So primary could be P11 but you set one geo-secondary to P6 and then another one to P1 (because they were directing lower load to this replica). Unfortunately, this sort of configuration led to the replicas lagging behind, sometimes to the extent of becoming unhealthy when they could not keep up with the log generation load happening on primary .




Solution 2: Read Scale Out


Here we see a supported and more cost effective solution using Read Scale Out

For each PREMIUM server you have 2 endpoints . Considering 1 primary + 4 replicas = 1 READ/WRITE endpoint + 9 READ ONLY endpoints

https://docs.microsoft.com/en-us/azure/sql-database/sql-database-read-scale-out



You need to enable ReadScale on all databases using power shell
$databasename = "teste"
$resourcegroupname = "ResGroup"
$servername = "server"

$database = Get-AzureRmSqlDatabase `
-DatabaseName $databasename `
-ResourceGroupName $resourcegroupname `
-ServerName $servername

$database | Set-AzureRmSqlDatabase -ReadScale Enabled
And use the connection strings


  • 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;


You can test on SSMS changing the options



And you can check if you are on the read/write endpoint and other things like DTU using the TSQL below

* Note: On the geo-replica secondary both endpoints with show as READ_ONLY, however if you open two connection you should not see the other when you query the sys.dm_exec_connections
SELECT
@@SPID,
DB_NAME(),
@@SERVERNAME,
DATABASEPROPERTYEX(DB_NAME(), 'Updateability'),
AVG(avg_cpu_percent) AS 'Average CPU Utilization In Percent',
MAX(avg_cpu_percent) AS 'Maximum CPU Utilization In Percent',
AVG(avg_data_io_percent) AS 'Average Data IO In Percent',
MAX(avg_data_io_percent) AS 'Maximum Data IO In Percent',
AVG(avg_log_write_percent) AS 'Average Log Write I/O Throughput Utilization In Percent',
MAX(avg_log_write_percent) AS 'Maximum Log Write I/O Throughput Utilization In Percent',
AVG(avg_memory_usage_percent) AS 'Average Memory Usage In Percent',
MAX(avg_memory_usage_percent) AS 'Maximum Memory Usage In Percent'
FROM sys.dm_db_resource_stats;

SELECT * FROM sys.dm_exec_connections WHERE net_transport = 'TCP' order by session_id DESC

Solution 3: Azure Data Sync


Using this method you can sync between multiple databases, and will work like a merge replication, where all members can be read/write

https://docs.microsoft.com/en-us/azure/sql-database/sql-database-sync-data



Be sure to check the limitation on this approach

https://docs.microsoft.com/en-us/azure/sql-database/sql-database-sync-data#sync-req-lim