What Am I Working On (RDORR): SQL Server On Linux

To some of you SQL Server On Linux is old news from various announcements made a couple of months ago.  To others this is new information.  Yes, SQL Server runs on Linux!   We are in active, private preview and working towards the public preview release.

It was Jan 2015, in my previous supportability role, that I started looking at SQL Server on Linux.  I was contacted by my friend, Slava Oks, to start looking at how Microsoft SQL Server Support (CSS) would support the endeavor, train engineers, run SQL Server on Linux through its paces, find bugs and lend my knowledge to making SQL Server on Linux a world class product.

I got off the phone with Slava and went to talk to BobWard and KeithElm about the project and to get their thoughts.   I distinctly remember telling them I think this is reality because we all know Slava and he ships product!  

I proceeded to install an Ubuntu VM and the internal build of SQL Server on Linux.  Then simply connected to my SQL Server on Linux instance, using SSMS, without a hitch.

Before joining Microsoft in 1994 I worked at State Farm Insurance and spent several years in a testing group and later joined a team developing applications against SQL Server for OS/2. I worked closely with my friend Todd DeDecker. We developed a friendly competition to break one another’s code. For example, if we had a UI application we would do things like sweep the entire keyboard with our hand to get random key strokes. My favorite was taking a chapter from War and Peace and pasting it into every text box along with a variety of quote patterns. I would get a new build from Todd at the beginning of the day and silently track an entire list of issues. Then at 5 o’clock, e-mail the list of issues I found to Todd and laugh hard when I heard him read the e-mail and mutter – Dorr! Of course, Todd was all to kind to repay the favor.

The neat thing about this is Slava and I started the same type of friendship and rigorous testing clear back in the UMS (User Mode Scheduling) days of SQL 2000. We are a bit wiser (you could take that as older) now and we don’t wait until 5 o’clock but we still try everything we can think of to exercise the code. I remember writing crazy extended stored procedures (XPROCS) when Slava was writing the memory manager components for SQL OS (SOS.)  Not only making up wild allocation patterns but adding in all kinds of memory overwrites and stale pointers. Slava was determined to protect the SQL Server and point out issues like scribblers, memory leaks and the like. I was determined to make sure he was right and we covered all the customer scenarios I had seen and then some.

With SQL Server on Linux up and running I then thought - Game on Slava! Probably with a funny grin on my face but game on none the less.

I took the same approach to the SQL Server on Linux endeavor.   I own several test suites, simulating customer problems that I have supported over the years, along with tests from the RML utilities (OStress, ReadTrace, ...) I ran a pass with these tests at low stress and they all passed. Then I cranked up the tests to high stress levels and they passed.  Oh boy! As a support professional I need to get in gear, I have 100s of support engineers too ready for SQL Server on Linux.  

I quickly got a MacBook and started coding on OS X as well as my Linux VMs, reading articles and books. Looking for anything new I could throw at SQL Server on Linux.  I used the standard gnu compilers and the Linux ABI to understand what this all would mean to support.   In fact, by Jul 2015 I had fair portions of RML building and running natively for Linux and OS X by replacing Win32 APIs with the platform specific ABI calls.  

It became clear SQL Server on Linux is an attainable goal.  During this same timeframe my peers were releasing our providers natively, portions of .NET, sqlcmd, bcp and the numbers in the Azure VM world are showing Linux as a valuable asset.

Later, with a slight bit of arm twisting, Slava convinced me that I should join his team and work on the project.   That is exactly what I started doing in Mar 2016.   I am working on parts of SQL OS such as scheduling to make sure SQL Server, specifically SQL OS, runs efficiently on Windows and Linux.  

While I have plenty of my own work to do what is really neat about my current position is I get to bring you all along with me.   I have 20+ years of support experience that I am able to bring directly to the designs and implementations. For example, we were designing how to capture a crash dump.   You are used to this on Windows, often called a Watson dump, that produces a dump from unhandled exceptions.   Watson does not exist on Linux so what do we do?    My peer Mike was working on the capture capability and I am sure he wanted to throw me out of the room by the end of our meeting.   He took away 20+ tasks/work items on how and what we had to capture all based the how SQLDumper has evolved and what support and development really need to make the capture usable.  The irony is that Mike has completed most of the work but we have only encountered a couple of crashes.

Last week I meet with Aditya and went over 4 pages of SQL Server gotcha’s that he could apply to his design.  Everything from testing on case sensitive servers, using pooled connections, data/time conversions and more.  It is really neat to see how I can take the issues customers have encountered in the past and provide that feedback and test capability right into the work flow.

I am really enjoying the work and the team and I often use the concept of ‘Don’t Believe Me Just Watch’ when talking to people.   Some of you may know Bruno Mars has a song talking about ‘Don’t Believe Me Just Watch.’   One day there was a group of folks at my desk asking about this Linux thing.   It just so happened to think quick enough and played that song off my playlist while proceeding to show them how to use SQL Server on Linux. On a Linux VM, from my MacBook running Microsoft Excel.  Poof data in Mac Excel directly from SQL Server running on my Linux VM all framed with Bruno telling them ‘Don’t Believe Me Just Watch!’

So ‘Don’t Believe Me Just Watch!’ …

For those who want the full experience, feel free to play ‘Uptown Funk’ while looking at the screen shots. Smile

Start SQL Server at the Linux command prompt

clip_image002

Connect from SSMS on Windows and issue raiserror command

clip_image004

clip_image006

Connect locally on Ubuntu using the native SQLCMD and issue raiserror command
Microsoft SQL Server ODBC Driver 1.0 for Linux

clip_image008

Connect from OS X, Microsoft Excel and issue raiserror command

clip_image010

clip_image012

clip_image014

Bob Dorr - Principal Software Engineer SQL Server

Comments

  • Anonymous
    June 27, 2016
    Simply amazing. Keep up the good work.
  • Anonymous
    June 27, 2016
    The comment has been removed
    • Anonymous
      June 29, 2016
      Still working on the public preview timing and feature set. More to come on that as we get closer.
  • Anonymous
    June 28, 2016
    Hy,Great article.
  • Anonymous
    June 28, 2016
    Great work more of such improvement. Make SQL Server available everywhere !!!
  • Anonymous
    June 28, 2016
    Nice job! I'm anxious to put my hands in this version!
  • Anonymous
    July 19, 2016
    Great work !I am developing a "lightweight" clone of your product, just because I wanted SQL Server to run on Linux.It is not finished yet and it is REALLY SLOW because SELECT doesn't use the indexes yet and there is no optimizer for the moment, but I am working on it ;-)See https://www.rsql.ch