{"id":18105,"date":"2016-12-16T10:00:21","date_gmt":"2016-12-16T18:00:21","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/dataplatforminsider\/?p=18105"},"modified":"2024-01-22T22:50:40","modified_gmt":"2024-01-23T06:50:40","slug":"sql-server-on-linux-how-introduction","status":"publish","type":"post","link":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2016\/12\/16\/sql-server-on-linux-how-introduction\/","title":{"rendered":"SQL Server on Linux: How? Introduction"},"content":{"rendered":"

This post was authored by Scott Konersmann, Partner Engineering Manager, SQL Server, Slava Oks, Partner Group Engineering Manager, SQL Server, and Tobias Ternstrom, Principal Program Manager, SQL Server.<\/em><\/p>\n

Introduction<\/span><\/a><\/h4>\n

We first announced<\/a> SQL Server on Linux in March, and recently released the first public preview of SQL Server on Linux<\/a> (SQL Server v.Next CTP1) at the Microsoft Connect(); conference. We\u2019ve been pleased to see the positive reaction from our customers and the community; in the two weeks following the release, there were more than 21,000 downloads of the preview. A lot of you are curious to hear more about how we made SQL Server run on Linux (and some of you have already figured out and posted interesting articles about part of the story with \u201cDrawbridge\u201d). We decided to kick off a blog series to share technical details about this very topic starting with an introduction to the journey of offering SQL Server on Linux. Hopefully you will find it as interesting as we do! J<\/p>\n

Summary<\/h4>\n

Making SQL Server run on Linux involves introducing what is known as a Platform Abstraction Layer (\u201cPAL\u201d) into SQL Server. This layer is used to align all operating system or platform specific code in one place and allow the rest of the codebase to stay operating system agnostic. Because of SQL Server\u2019s long history on a single operating system, Windows, it never needed a PAL. In fact, the SQL Server database engine codebase has many references to libraries that are popular on Windows to provide various functionality. In bringing SQL Server to Linux, we set strict requirements for ourselves to bring the full functional, performance, and scale value of the SQL Server RDBMS to Linux. This includes the ability for an application that works great on SQL Server on Windows to work equally great against SQL Server on Linux. Given these requirements and the fact that the existing SQL Server OS dependencies would make it very hard to provide a highly capable version of SQL Server outside of Windows in reasonable time it was decided to marry parts of the Microsoft Research (MSR) project Drawbridge<\/a> with SQL Server\u2019s existing platform layer SQL Server Operating System<\/a> (SOS) to create what we call the SQLPAL. The Drawbridge project provided an abstraction between the underlying operating system and the application for the purposes of secure containers and SOS provided robust memory management, thread scheduling, and IO services. Creating SQLPAL enabled the existing Windows dependencies to be used on Linux with the help of parts of the Drawbridge design focused on OS abstraction while leaving the key OS services to SOS. We are also changing the SQL Server database engine code to by-pass the Windows libraries and call directly into SQLPAL for resource intensive functionality.<\/p>\n

Requirements for supporting Linux<\/span><\/a><\/h4>\n

SQL Server is Microsoft\u2019s flagship database product which with close to 30 years of development behind it. At a high level, the list below represents our requirements as we designed the solution to make the SQL Server RDBMS available on multiple platforms:<\/p>\n

    \n
  1. Quality and security must meet the same high bar we set for SQL Server on Windows<\/li>\n
  2. Provide the same value, both in terms of functionality, performance, and scale<\/li>\n
  3. Application compatibility between SQL Server on Windows and Linux<\/li>\n
  4. Enable a continued fast pace of innovation in the SQL Server code base and make sure new features and fixes appear immediately across platforms<\/li>\n
  5. Put in place a foundation for future SQL Server suite services (such as Integration Services) to come to Linux<\/li>\n<\/ol>\n

    To make SQL Server support multiple platforms, the engineering task is essentially to remove or abstract away its dependencies on Windows. As you can imagine, after decades of development against a single operating system, there are plenty of OS-specific dependencies across the code base. In addition, the code base is huge. There are tens of millions of lines of code in SQL Server.<\/p>\n

    SQL Server depends on various libraries and their functions and semantics commonly used in Windows development that fall into three categories:<\/p>\n