4. SQL on Linux のアーキテクチャ
Linux向けにポーティングされたものではない
“SQLPAL”により長年稼働してきたWindowsコードを共有
SQL Platform Abstraction Layer
(SQLPAL)
RDBMS SSIS SSAS SSRS
Windows Linux
Windows Host Ext.
Linux Host
Extension
SQL Platform Abstraction Layer
(SQLPAL)
Host extension mapping to OS system calls
(IO, Memory, CPU scheduling)
Win32-like APIsSQL OS API
SQL OS v2
All other systems
System resource & latency
sensitive code paths
5. on Linux
on Container
on Kubernetes
Popular and Commonly Used
Portable, Lightweight, Immutable, Efficient
Orchestration, Scalable, Self Healing
23. % sudo docker history mcr.microsoft.com/mssql/server:2019-RC1 --no-trunc --format '{{ json .CreatedBy }}'
FROM <OS base image> 例:ubuntu:16.04
LABEL < Microsoft label info > 例:vendor="Microsoft"
EXPOSE 1433 コンテナ内のSQL Serverがリッスンするポート
COPY < SQL Server bin and lib > /opt/mssql/bin、/opt/mssql/lib
RUN ./install.sh 依存パッケージやツールのインストール
CMD ["/opt/mssql/bin/sqlservr”] SQL Serverの起動
24. SQL Server カスタム Dockerfile 例
Sample1
FROM mcr.microsoft.com/mssql/server:2017-CU16
COPY ./DevDB.bak /tmp/DevDB.bak
CMD ["/opt/mssql/bin/sqlservr"]
Sample2
FROM mcr.microsoft.com/mssql/server:2017-CU16
COPY . /
RUN chmod +x /db-init.sh
RUN chmod +x /entrypoint.sh
CMD /bin/bash ./entrypoint.sh
sleep 15s
/opt/mssql-tools/bin/sqlcmd –i ddl.sql
/db-init.sh & /opt/mssql/bin/sqlservr
CREATE DATABASE mydb
GO
CREATE TABLE mytable (….
GO
….
db-init.sh
entrypoint.sh
ddl.sql
36. on Linux
on Container
on Kubernetes
Popular and Commonly Used
Portable, Lightweight, Immutable, Efficient
Orchestration, Scalable, Self Healing
37. SQL Server runs anywhere !
3rd party
Cloud
SQL Database
Managed Instance
SQL
Database
Kubernetes
Service
SQL Server
on Azure VM
SQL Server
Database
Migration Service
SQL Data
Warehouse
3rd
On-Premises
Cloud
OpenShiftKubernetesContainerLinuxWindows