
Ask HN: Would you run your production SQL Server on docker? - james_anderson
I&#x27;m really interested to know if anyone is doing this, why they chose to do this and how they are getting on with it.<p>I&#x27;ve been thinking about this recently and what would be involved. Some of my thoughts &#x2F; ideas are listed below.<p>Would need orchestration, probably K8s
Windows containers or Linux containers?
Possible to scale out reads by dynamically adding Always On Availability Group read-only replicas?
Licensing would restrict large scale outs
======
BrentOzar
I haven't yet seen a production problem that Docker containers solve better
than IaaS VMs (AWS EC2, Azure VMs, Google Compute Engine.)

I've seen a lot of _development_ problems that containers help solve, like
quickly building out Development Edition VMs for continuous integration
testing. Since Dev Edition is free, rapidly building/destroying containers
makes sense. However...

> dynamically adding Always On Availability Group read-only replicas

Readable AG replicas require SQL Server Enterprise Edition, which is $7k USD
per core. That pricing tends to dwarf the hardware it's running on, so it
usually makes more sense to run bare metal on these if it's a long-term scale
requirement. (I have indeed done temporary scale-out reads on VMs, it's just
usually for things like Black Friday workloads for short periods of time.)

(And then at the end, I went to add a disclaimer about what I do and why I'm
answering, and then I went, "Oh, wow, it's James Anderson asking this." OK, so
we both know each other, but here's my answer anyway for the rest of the HN
community.) So source: Microsoft SQL Server consultant.

~~~
james_anderson
Haha, thanks for your answer Brent. I think you're right about VMs. SQL Server
on docker in prod is kind of a thought experiment of mine at the moment.

I'd love to hear from anyone who is even just thinking of doing this.

> dynamically adding Always On Availability Group read-only replicas

Yeah I doubt scaling SQL Server out dynamically will ever make monetary sense,
but it might be cool to just get it working.

I'm thinking of creating a Helm chart for K8s that allows you to dynamically
scale the SQL Server pod up and down. I think I'll need to use some
undocumented DBCC commands (or call the API) to freeze IO, so I can replicate
the data files to the new secondary as it spins up.

Horizontally scaling SQL Server would be cool. Maybe if the hosts were
licensed so we could run as many containers as we wanted, it could make
sense...

------
teddyuk
I would use them just to save the whole setup/install thing.

When sql releases were every 2-3 years you would upgrade the hardware at the
same time, annually/semi-annually? Less likely.

Being able to change up a version within minutes is a significant improvement
over the whole msi install thing even if you did script it.

~~~
james_anderson
Yeah, I like the idea of treating SQL Server like it's just a process and not
the entire server.

Are you planning to do that in production?

~~~
teddyuk
when i can, won't likely be soon though :(

