Is an availability group listener a proxy?

Michael Ross 20 Reputation points
2023-02-08T04:43:54.2866667+00:00

Is a SQL Server availability group listener an application-layer proxy?

In other words, which of the following methods does a SQL Server availability group listener use to get traffic to SQL Server instance?:

Method A(non-proxy):

  1. SQL Server client connects to a SQL Server availability group listener.
  2. SQL Server availability group listener tells the SQL Server client to use a specific SQL Server instance.
  3. SQL Server client connects directly to the specific SQL Server instance indicated by the SQL Server availability group listener.
  4. All further traffic goes directly between the SQL Server client and the SQL Server instance (without passing through the SQL Server availability group listener).

Method B(application-layer proxy):

  1. SQL Server client connects to a SQL Server availability group listener.
  2. SQL Server availability group listener connects to a specific SQL Server instance and passes traffic.
  3. All further traffic goes through the SQL Server availability group listener.
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,482 questions
0 comments No comments
{count} votes

Accepted answer
  1. Seeya Xi-MSFT 16,426 Reputation points
    2023-02-10T05:02:37.0433333+00:00

    Hi @Michael Ross ,

    b. The client submits the request to the listener. The listener will transfer the request to different replicas. So we can assign DNS or IP address of the listener to the front-end application.

    Look at the screenshots and you'll understand it.

    User's image

    User's image

    When you do a failover, you will see another node in the result.

    Best regards,

    Seeya


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    1 person found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. Olaf Helper 40,156 Reputation points
    2023-02-08T07:24:05.0233333+00:00

    You can find everything well documented at Microsoft, for example What is an availability group listener?

    And you forgot the "Application intent", it it's "Read only" the connection goes to the read-only replica.

    See Connect to an Always On availability group listener


  2. Seeya Xi-MSFT 16,426 Reputation points
    2023-02-09T07:06:06.67+00:00

    Hi @Michael Ross ,

    Let me summarize it.

    The role of the listener is to listen for access from the front-end client. The listener will assign different access requests to different replicas. For example, a client makes a read-only access request. The listener will send this signal to the current read-only replicas. Since there will be multiple read-only replicas, the listener will balance the traffic to achieve load balancing and find the right read-only replica. If the listener listens to a request with a write operation, the listener will forward the request to the replica with the write operation.

    Best regards,

    Seeya


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".