logoalt Hacker News

andaitoday at 1:48 AM5 repliesview on HN

Why did they port it to Linux?

Knowing nothing about this, I wonder if they're getting ready to retire Windows Server, and wanted to get their server products off it?

Edit: How they did it is also quite fascinating:

https://www.microsoft.com/en-us/sql-server/blog/2016/12/16/s...

https://www.microsoft.com/en-us/research/project/drawbridge/

>a key contribution of Drawbridge is a version of Windows that has been enlightened to run within a single Drawbridge picoprocess.

MSSQL on Linux only seems to use parts of that project (a smaller abstraction layer), but that's still super cool.


Replies

stackskiptontoday at 3:11 AM

Two big reasons I realize,

First reason is MS SQL team read the writing on the wall and realized if they wanted a chance to stay relevant, they needed to support Linux. I'm not sure that play really worked for them but it also gave benefits for number 2.

Second, they had to eat their own dogfood operationally with Azure and hated the taste of dealing with Windows. Linux offered lower RAM/CPU footprint along with much more ease of use with Kubernetes/Containers. Yes, Windows containers exists but as someone who has had to use them, it's rough experience.

pjmlptoday at 9:08 AM

The main reason was to be able to deploy SQL Server in Linux based containers.

Windows Server is doing alright.

spijdartoday at 2:33 AM

Wait until you read about the version they released for ARM, briefly! It had a dynamic recompiler which would produced ARM64 ELF libraries from Windows PE executables, allowing x86_64 MSSQL to run on ARM Linux! They ditched that once Rosetta support on ARM Macs was good enough to run x86_64 VMs, as apparently all they cared about was supporting Docker on Macs...

I think it is essentially "complete drawbridge", too. I haven't played around with it in a while, but from memory, you can coerce it to run arbitrary Windows executables, basically anything without graphics (which are missing from the PAL they ship).

It's quite impressive, though also necessary if you think about it. SQL Server requires the legacy dot net stack, AND it also ships with a full copy of the msvc compiler/linker! Not sure if that's ever used by the Linux port, but it is installed. MSSQL kind of exercises every inch of the Windows API surface.

You can even run e.g. xp_dirtree and see an overlay of the host disk along with Drawbridge's copy of Windows.

show 1 reply
DarkUraniumtoday at 7:04 AM

Isn't that basically a heavier version of a unikernel?

jiggawattstoday at 2:29 AM

The "why" is for Kubernetes and Docker support.

For example, the Aspire.NET orchestrator pulls the Linux docker image of SQL Server in much the same way as it does for MySQL or Postgres.