Feasibility of a MSSQL Read Only Replicas as ephermal containers?



  • Kubernetes tends to get more complex to work with when persistent state becomes a concern. Therefore it can be attractive to keep applications in a cluster as stateless as possible.

    In the aim of optimizing sql read performance across multiple regions in an environment with Kubernetes clusters [in multiple regions], is it possible to run MSSQL server as a container (stateless read-only replica) in each cluster with a primary [located in a single region] that would handle writes while replicating changes out to the secondaries?

    The primary aspect I'm trying to hit on is the feasibility of running stateless MS SQL containers that can easily reintegrate with the primary if they are arbitrarily killed or if new copies are brought up.



  • Kubernetes tends to get more complex to work with when persistent state becomes a concern.

    Correct, Kubernetes is essentially useless for stateful items. People keep trying to use it that way... with horrible outcomes.

    [...] is it possible to run MSSQL server as a container (stateless read-only replica) in each cluster with a primary [located in a single region] that would handle writes while replicating changes out to the secondaries?

    Yes, but I'd argue that it would be "doing it wrong". I'm just a rando on the intenet, so there's that to take into account. If something needs to be truly expansive to handle scale out and (for example, in this case) holds constantly changing data that needs to be saved (can't be loaded from another source when needed), then it should be architected as such.

    The primary aspect I'm trying to hit on is the feasibility of running stateless MS SQL containers that can easily reintegrate with the primary if they are arbitrarily killed or if new copies are brought up.

    You can do this with a special setup of an Availability Group (feature) utilizing the https://docs.microsoft.com/en-us/sql/database-engine/availability-groups/windows/read-scale-availability-groups?view=sql-server-ver15 along with the https://docs.microsoft.com/en-us/sql/database-engine/availability-groups/windows/automatic-seeding-secondary-replicas?view=sql-server-ver15 option. I wish you good luck.


Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2