0

Can we route read-only connection to readable secondary replica without setting connection string (ApplicationIntent = ReadOnly)?

asked Jul 9, 2018 at 9:24

2 Answers 2

0

You would be required to set the Secondary Replica Copy as Readable, different from Read-Intent, and point the connection string to the actual instance where the replica resides.

This is not advisable, as it negates the HA usability of any Read-Intent replicas during failover.

answered Jul 9, 2018 at 9:56
3
  • So without defining "ApplicationIntent = ReadOnly" in connection strings, there's no way that listener automatically routing read-only connection to readable secondary replica and "write connection query" to primary replica? Commented Jul 9, 2018 at 10:07
  • Like I said, you will need to use the secondary replica instance then, not the AG Listener name. But no, if you don't mention Intent, it will direct traffic to the ReadWrite Primary Replica if you use the Listener name in your connection string. Commented Jul 9, 2018 at 11:04
  • @ktsrg, correct. How would the listener know how to route the connection without the intent declared? Without that specified in the connection string, you would need to route connection yourself. Commented Jul 9, 2018 at 11:04
0

Can we route read-only connection to readable secondary replica without setting connection string (ApplicationIntent = ReadOnly)?

No. However, you can connect to readable secondary directly without using listener, but as it is mentioned in another answer, in case the secondary replica is down, HA is not achievable, in this case.

I could not think of any such specific use case. For configuring read-only routing, see my post.

Paul White
95.4k30 gold badges440 silver badges689 bronze badges
answered May 20, 2019 at 9:49

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.