1. Azure Databases for PostgreSQL,
MySQL and MariaDB
| 소속 : 락플레이스
| 날짜 : 2021년 06월 16일
2. Agenda
Azure Databases for OSS DB
1
1
2
2
4
4
3
3
Azure Databases Service Features
OSS DBs Migration Strategy
Pre-Migration
5
5 Migration
3. Agenda
Azure Databases for OSS DB
1
1
2
2
4
4
3
3
Azure Databases Service Features
OSS DBs Migration Strategy
Pre-Migration
5
5 Migration
4. State of the Open-Source DBMS Market
2022년 까지
70% 이상의 신규 개발 애플리케이션은
오픈소스 DB 를 이용할 것이며
50% 이상의 기존 업무가 상용 DB 에서
이관될 전망이다.
Gartner | State of the Open-Source
DBMS Market, 2018
“
5. Manage risk and meet the pace of change in the cloud
Manage risk and meet the pace of change in the cloud
94%
20.6%
19.6%
18.8%
1. Vanson Bourne. “The Business Impact of the Cloud” report
8. Azure database services for MySQL, PostgreSQL & MariaDB
More choices and full integration into Azure’s ecosystem and services
T-SQL
Java
C/C++
C#/VB.NET
PHP
Node.js
Python
Ruby
Managed
community MySQL,
PostgreSQL, and
MariaDB
Languages and
frameworks of your
choice
Easy lift and shift
Scale in
seconds with
built-in high
availability*
Unparalleled
security and
compliance
Industry-
leading
global reach
Enterprise ready
*Hyperscale (Citus) on Azure Database for PostgreSQL – Horizontal scale-out deployment option for single node Postgres across hundreds of nodes (blog/tech)
9. SQL Server 2017
MySQL/Postgre
SQL/MariaDB
Azure SQL VMs
Azure Win/
Linux VMs
Azure laaS vs. PaaS
Different Azure Data Services give you
different levels of control and flexibility
for your data
For a high level of control including the
ability to pick SQL Server and OS
version, choose IaaS
For automated management and
administration, choose PaaS
On-premises Infrastructure
as a service
Platform
as a service
Threat detection,
risk management
Performance
management
Applications
Data
High availability
/DR/backups
Database provision/
patch/scaling
O/S provision
/patching
Virtualization
Hardware
Datacenter
management
Managed by customer
Threat detection,
risk management
Performance
management
Applications
Data
High availability
/DR/backups
Database provision/
patch/scaling
O/S
Virtualization
Hardware
Datacenter
management
Managed by Cloud
provider
Threat detection,
risk management
Performance
management
Applications
Data
High Availability/
DR/backups
Database provision/
patch/scaling
O/S
Virtualization
Hardware
Datacenter
management
Azure SQL Database
Azure Database for
MySQL/PostgreSQL/MariaDB
Azure Database
platform differentiation
10. Azure relational database platform
SQL Data Warehouse SQL Database PostgreSQL MySQL MariaDB
Database
Services
Platform
Intelligent: advisors, tuning, monitoring
Flexible: on-demand scaling, resource governance
Trusted: HA/DR, backup/restore, security, audit, isolation
Azure Compute
Azure Storage
Global Azure with 42 regions
Power
BI,
App
Services,
Data
Factory,
Analytics,
ML,
Cognitive,
Bot…
11. Service tiers
Service tier Basic
Intended use case
Built for workloads with light comp
ute needs and variable IO performa
nce
vCore 1 2
Compute generation Gen 4, Gen 5
Storage
5GB – 1TB
Magnetic media
IOPS Variable
12. Service tiers
Service tier Basic
Intended use case
Built for workloads with light comp
ute needs and variable IO performa
nce
vCore 1 2
Compute generation Gen 4, Gen 5
Storage
5GB – 1TB
Magnetic media
IOPS Variable
General Purpose
Balanced IO and compute
Ideal for most business workloads
offering balanced and scalable
compute and storage options
2 4 8 16 32
Gen 4, Gen 5
5GB – 2TB
Remote SSD
100-6000 IOPS
13. Service tiers
Performance Optimized
Memory optimized
Cache more data for faster transact
ion processing and higher concurre
ncy
2 4 8 16
Gen 5 only
5GB – 2TB
Remote SSD
100-6000 IOPS
Service tier Basic
Intended use case
Built for workloads with light comp
ute needs and variable IO performa
nce
vCore 1 2
Compute generation Gen 4, Gen 5
Storage
5GB – 1TB
Magnetic media
IOPS Variable
General Purpose
Balanced IO and compute
Ideal for most business workloads
offering balanced and scalable
compute and storage options
2 4 8 16 32
Gen 4, Gen 5
5GB – 2TB
Remote SSD
100-6000 IOPS
Supported versions
MySQL: 5.6, 5.7, 8.0 / MariaDB : 10.2, 10.3
PostgreSQL: 9.6, 10, 11
15. Flexible Server (Preview)
Simplify developer experiences
More Server Parameter Control
More Cost Optimization Controls
Enable Zone Resilient & Aware
Applications
16. Hyperscale (Citus) Architecture
Shard your PostgreSQL database
across multiple nodes to give your
application more memory,
compute, and disk storage
Easily add worker nodes to
achieve horizontal scale, while
being able to deliver parallelism
even within each node
Scale out to 100s of nodes
Coordinator
Table metadata
Each node PostgreSQL
with Citus installed
1 shard = 1 PostgreSQL table
17. Scaled-out aggregate
Aggregating data before transactions avoids rewriting each row and can save write
overhead and table bloat
Bulk aggregation avoids concurrency issues
APPLICATION
SELECT
FROM
GROUP BY
company_id,
avg(spend) AS avg_campaign_spend
compaigns
company_id;
METADATA
COORDINATOR NODE
WORKER NODES
SELECT company_id
sum(spend),
count(spend) …
FROM
campaigns_2009 …
SELECT company_id
sum(spend),
count(spend) …
FROM
campaigns_2001 …
SELECT company_id
sum(spend),
count(spend) …
FROM
campaigns_2017 …
W1
W2
W3 … Wn
18. Key uses cases for Hyperscale (Citus)
Scale beyond single node
Minimize hotspots by spreading out
tenants
Rebalance data fully online
Isolate large tenants to their own
hardware
Multi-tenant & SaaS
applications
Real-time operational
analytics
Transactional/OLTP
applications
Ingest terabytes of data per day
Enable sub-second query responses
Parallelize across nodes for 100x
performance
Simplify complex ETL processes
Ensure high performance with
concurrent users
Avoid single points of failure
Distribute transaction processes
across multiple nodes
Manage high volumes of
transactions
19. Agenda
Azure Databases for OSS DB
1
1
2
2
4
4
3
3
Azure Databases Service Features
OSS DBs Migration Strategy
Pre-Migration
5
5 Migration
20. Security built in
Identity
Native authentication
AAD integration
Threat detection
Control access
Secure SSL connectivity
Server firewall rules
Virtual networks
Protect data
Built-in encryption at-rest for data
and backups
21. VNET service endpoint
# Creates the virtual network *myVNet* and subnet *mySubnet*
az network vnet create
-g myRG
-n myVNet
--address-prefixes 10.0.0.0/16
-l westus
# Creates the service endpoint
az network vnet subnet create
-g myRG
-n mySubnet
--vnet-name myVNet
--address-prefix 10.0.1.0/24
--service-endpoints Microsoft.SQL
# Create a VNet rule on the sever to secure it to the subnet
az postgres vnet-rule create
--name myRule
--resource-group myRG
--server mypgserver-20180111
--subnet mySubnet
Multi-
Tenant
PaaS
Customer VNET
IP ACL
IP ACL
V
N
E
T
A
C
L
V
N
E
T
A
C
L
Express Route Public Peering or
internet (Using ACLed NAT Ips) in
development
VM VM
VM
VM VM
VM
Gateway
Virtual Network
FrontEnd Subnet
HDI Subnet
!
!
HDInsight
BackEnd Subnet
23. Built-in high availability
Azure Storage
Data Data Data Data
Gateway
Application
Application
PostgreSQL
Client
MySQL
Client
server=server.mysql.database.azure.com
MySQL IP:3306
PGSQL IP:5432
Server
provisioning
And
management
US
West
MySQL or
PostgreSQL
Server
MySQL or
PostgreSQL
Server
Azure
Database
Management
Service
25. High availability in AWS RDS vs. ADS
High availability
AWS RDS with a
99.95% SLA is 2x
more expensive*
than Azure
Database for
MySQL/PostgreSQL
High availability
Availability
Max
Downtime
99.95% 4.38 hours
99.99% 53 minutes
26. Scale performance on the fly
MySQL/MariaDB: 3306
PostgreSQL: 5432
Azure
Storage
Server
Server
30. Server logs (MySQL and MariaDB)
• Enable slow_query_log for insights on slow
queries (disabled by default)
• Logs are available for up to seven days from
their creation. If the total size of
the available logs exceeds 7 GB, then the oldest
files are deleted until space is available.
• New log files are created every 24 hours.
• Log files are rotated after the 7 GB limit is
reached.
Built-in server logs for troubleshooting database
errors or performance issues
31. Server logs (PostgreSQL)
• Configure log_retention_days (3-7 days) to
define the retention period for system logs
• Configure log_statement to “ALL” for
analyzing performance issues
• log_min_duration_statement lets you specify
the minimum execution time (in milliseconds)
above which statements will be logged.
• Consumes server provisioned storage
• The log files rotate every one hour or 100 MB
size, whichever comes first.
Built-in server logs for troubleshooting database
errors or performance issues
33. Agenda
Azure Databases for OSS DB
1
1
2
2
4
4
3
3
Azure Databases Service Features
OSS DBs Migration Strategy
Pre-Migration
5
5 Migration
34. DB 이행 전략 제시
# 분석(Assessment) 단계에서 As-Is 및 To-Be 환경에
대한 분석을 통해 DB 이행에 대한 비즈니스 요구
사항을 산출하는 작업을 진행
# 진단 및 계획 단계에서 DB 이행에 대한
호환성 체크 및 M/M를 산출하는 작업을 진행
# 이행(Migration) 단계에서 DBMS에 대한 스키마 /
데이터 및 오브젝트 들에 대하여 전환 작업을 수행
# 성능 및 기능 검증 및 튜닝 단계에서 이행을 통한
데이터의 정합성을 확보하고 이행된 데이터에
대하여 튜닝 작업을 수행
# 기능 테스트 성능테스트
# Migration 사항에 대한 교육 및 기술이전
35. Migration Process Overview
1) 환경 분석
진단 및 계획 마이그레이션 교육 및 기술이전
환경분석
기존환경분석
TO-BE 구성
* 이행 대상시스템
환경 구축
* DBMS 현황 분석
* 현황 분석을 통한 이행
접근 방법 수립
* 데이터 이행 요건 정의
AS-IS 분석
검증 및 튜닝
36. Migration Process Overview
2) 진단 및 계획
마이그레이션 교육 및 기술이전
계획수립
평가 및 계획
* 영향도 평가
* 위험요소 진단 및
계획수립
* 서비스 분석
* 스키마 / 데이터
* DB 오브젝트
진단
검증 및 튜닝
환경분석
* 단계별 계획 수립
진단 및 계획
37. Migration Process Overview
3) 마이그레이션
마이그레이션
스키마 & 데이터이관
TOOL
* Mysqldump/pump
* Workbench
* Pgdump
* Ora2PG
* Sqlines
* Azure DMS
* 스키마 이관
* DB 오브젝트 변환
* 데이터 이관
변환 및 이관
1) 기존 Connection Method 변경
# Old Connection
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con =
DriverManager.getConnection("jdbc:oracle:thin:@localhost:
1521:xe”,”scott”,”tiger”);
# New Connection
Class.forName("com.edb.Driver");
Connection con =
DriverManager.getConnection("jdbc:edb://localhost:
5444/edb“,"enterprisedb","enterprisedb");
2) 비호환 SQL문 처리
1) Schema Migration 4) Migration Fail
* Migration Toolkit 데이터 처리
2) 비호환 문법 처리 5) Data & Objects 비교
* Migration log file
3) Data Migration
* Migration Toolkit
* dblink_ora_copy
38. Migration Process Overview
진단 및 계획 마이그레이션
환경분석
4) 검증 및 튜닝
교육 및 기술이전
검증 및 튜닝
튜닝,성능시험
튜닝
* 어플리케이션
* WEB / WAS
* DBMS
* 기능, 성능 테스트
검증
* 성능 리포트
39. Migration Process Overview
진단 및 계획 마이그레이션 검증 및 튜닝
환경분석
4) 교육 및 기술이전
교육 및 기술이전
교육
산출물
* 운영 가이드
* 개발 가이드
* 프로젝트 결과보고서
* 프로젝트 진행 시
작성되는 Working
산출물
* 마이그레이션 교육을
통한 기술 이전
교육내용
40. Agenda
Azure Databases for OSS DB
1
1
2
2
4
4
3
3
Azure Databases Service Features
OSS DBs Migration Strategy
Pre-Migration
5
5 Migration
41. CloudPilot 을 이용한 Assessment
Cloud 적합도 코드 변경사항 비용
어플리케이션
데이타베이스
Modernization Option: 1) VM, 2) Container, 3) App Service 활용 방식에 대해 Cloud 적합도, 필요 코드 변경사항, 비용 분석
DB Modernization Option: 1) Oracle DB To AzurePostgre, 2) SQL DB to 3 Cases (Azure SQL, SQL VM, SQL Managed Instance),
3) MySQL to AzureMySQL 활용 방식에 대해 Cloud 적합도, 필요 코드 변경사항, 비용 분석
43. 절차 및 소요일정
고객사 Needs 및 일정에 따라 App 및 DB 진단을 동시 혹은 선택적으로 진행가능
CloudPilot Client 설치 필요
(CloudRecon TCO 추가 분석시 AzureMigate로 데이터 수집 필요)
국내 전문 파트너사와 함께 진단결과 및 App/DB
Modernization 방안 제언
진단을 위한 환경 준비 및 분석 어플리케이션 개수/DB
Schema 등에 따라 소요일정은 유동적이나 리포트 공유
및 제언까지 평균 2주 정도 소요 예상
XML for App Scan
JSON for DB Scan
44. 고객 준비 사항
CloudRecon (Inventory Collection via Azure Migrate appliance) CloudPilot (DB assessment)
H/W
3 Options available
- Physical machine : 80 GB / 32GB of RAM / CPU(8 cores) / 외부가상스위치
- VMware : 80GB(OVA 11.6GB) / 32GB of RAM / CPU(8 cores) / 외부가상스위치
- Hyper-V : 80GB (VHD 10.4 GB) / 16GB of RAM / CPU(8 cores) / 외부가상스위치
8GB of RAM, CPU (2 cores)
OS and Pre-requisite
OS : Windows Server 2016, Physical machine에 설치시 Powershell script 실행 필요
상관도 분석
- 각 서버에 MMA (Microsoft Monitoring Agent) 설치 필요
- Vmware는 Agentless 방식으로 설치 필요치 않음
OS : Windows 8 & above
필수 설치 software
- PowerShell v5.0 이상
- .NET Framework v4.5 이상
Oracle DB의 경우 필요 S/W
- Ora2PG(v20 이후 버전)
- Strawberry Perl(v5.30.11 이후 버전)
- Oracle Database 19c Client (19.3)
CloudRecon (Inventory Collection via Azure Migrate appliance) CloudPilot (DB assessment)
사용 계정 Azure Global admin (Project 생성) DB administrator or Sysadmin 권한이 있는 계정
필요 정보
Assessment 대상 DB server 정보
- OS type (windows / Linux)
- FQDN or IP 주소
- 관리자 계정 (administrator or root) : Domain join된 경우 Domain admin 계정 사용 가능
Assessment 대상 DB server 정보
- FQDN or IP 주소
- DB administrator (sysadm) credential
HW, OS 및
필수
소프트웨어
계정 및
필요정보
네트워크 포트
참조) CloudRecon과 CloudPilot 의 OS & 필수 소프트웨어 충족시 1대의 H/W에서 동시 사용 가능
내/외부
HTTP/SSL 443 (inbound / outbound data transfer)
45. 평가 항목 및 결과 상세 - APP
어플리케이션의 VMs, Containers, PaaS (AppService)로의 마이그레이션 적합도
46. 평가 항목 및 결과 상세 - APP
어플리케이션의 VMs, Containers, PaaS (AppService)로의 마이그레이션 시 변경필요 코드 및 공수
47. 평가 항목 및 결과 상세 - APP
어플리케이션의 VMs, Containers, PaaS (AppService)로의 마이그레이션 시 코드 변경 가이드 제시
48. 평가 항목 및 결과 상세 - APP
어플리케이션의 VMs, Containers, PaaS (AppService)로의 마이그레이션 시 비용 비교
49. 평가 항목 및 결과 상세 – DB (Oracle to Azure PostgreSQL)
데이터베이스의 Azure PaaS 로의 마이그레이션 시 상세 가이드 제시
50. 평가 항목 및 결과 상세 – DB (Oracle to Azure PostgreSQL)
데이터베이스의 Azure PaaS 로의 마이그레이션 시 상세 가이드 제시
51. 평가 항목 및 결과 상세 – DB (Oracle to Azure PostgreSQL)
데이터베이스의 Azure PaaS 로의 마이그레이션 시 상세 가이드 제시 (Best Practices, Detailed Recommendation)
52. 평가 항목 및 결과 상세 – DB (Oracle to Azure PostgreSQL)
TCO 분석
53. Agenda
Azure Databases for OSS DB
1
1
2
2
4
4
3
3
Azure Databases Service Features
OSS DBs Migration Strategy
Pre-Migration
5
5 Migration
54. Migrate PostgreSQL to Azure Database for PostgreSQL
덤프 내보내기 가져오기 Azure Database Migration Service
- 데이터 동기화를 위해 기존 테이블에 기본 키 필요
- 대상 스키마에서 외래키 제거
- 대상 PostgreSQL 에서 트리거 사용 안 함
1. Pg_dump를 이용한 on-premise DB 백업
2. Pg_restore 를 이용한 Azure로 복원
1. Pg_dump 유틸리티를 사용하여 스키마 마이그레이션
2. Azure DMS 인스턴스 생성
3. Azure DMS 프로젝트 생성
4. 마이그레이션 실행
5. 마이그레이션 모니터링 6. 마이그레이션 컷오버 수행
- DB 정합성을 위해 서비스 중지 필요
- 특정 table만 마이그레이션 가능
- 복원 속도 향상을 위해 백업 시 -Fc 옵션 사용
On-premise
PostgreSQL
Azure for
PostgreSQL
특징 및 주의사항
특징 및 주의사항
- Azure Database Migration Service는 온라인 마이그레이션만 지원
- As-is 와 To-be의 상위 버전은 동일 해야함
- Azure Database for PostgreSQL 지원버전(9.6, 10, 11)
55. Migrate Oracle to Azure Database for PostgreSQL
Ora2PG Azure Database Migration Service (Preview)
- On-premise Oracle 과 Azure의 PostgreSQL을 동기화
- Oracle Archive Mode 설정 필요
- Oracle Supplemental Logging 설정 필요
1. Ora2pg 도구를 이용한 Assessment
2. Ora2pg 도구를 이용한 스키마 마이그레이션
3. Ora2pg 도구를 이용한 데이터 마이그레이션
1. Ora2pg 도구를 사용하여 스키마 마이그레이션
2. Azure DMS 인스턴스 생성
3. Azure DMS 프로젝트 생성
4. 마이그레이션 실행
5. 마이그레이션 모니터링 6. 마이그레이션 컷오버 수행
- 사전 준비사항 : Oracle Client, Perl 5.10이상, DBI
Perl module, DBD::Oracle Perl
- PL/SQL to PL/pgSQL 변환
On-premise
Oracle
Azure for
PostgreSQL
특징 및 주의사항
특징 및 주의사항
- Windows 또는 Linux 에 ora2pg 를 다운로드 하고 설치
- Ora2pg 설치하기 전에 Oracle, PostgreSQL 드라이버 설치 필요
- 성능 향상을 위해 Oracle 서버에서 통계정보 수집 필요
56. Migrate MySQL to Azure Database for MySQL
덤프 내보내기 가져오기 Azure Database Migration Service
- On-premise와 Azure의 DB를 동기화
- 가동 중지 시간의 최소화
- MySQL 8.0 으로의 마이그레이션은 지원되지 않음
1. mysqldump를 이용한 on-premise db백업
2. mysql를 이용한 Azure로 복원
1. Mysqldump or Workbench 도구 사용하여 스키마 마이그레이션
2. Azure DMS 인스턴스 생성
3. Azure DMS 프로젝트 생성
4. 마이그레이션 실행
5. 마이그레이션 컷오버 수행
- DB 정합성을 위해 서비스 중지 필요
- 특정 table만 마이그레이션 가능
On-premise
MySQL
Azure for
MySQL
특징 및 주의사항
특징 및 주의사항
- Azure Database for MySQL 은 InnoDB 엔진만 지원
- As-is 와 To-be의 상위 버전은 동일해야함
- Azure Database for MySQL 지원버전(5.6, 5.7, 8.0)
57. Oracle to PostgreSQL | Cost of Ownership
Customers migrate from
Oracle to Azure database
for PostgreSQL to reduce
overall cost of ownership by
up to 95% in savings*
Configuration is based on a 4 socket, 32 core x86 processer
Oracle Cloud Service editions are based on virtual machines
• *Oracle licensing for Enterprise Edition is based on number
of processors which is derived by multiplying the number of
cores by a factor. In the case of this example it is 32 cores
multiplied by .5 for x86 resulting in 16 processors.
• **Annual maintenance and support for Oracle is 22% of the
annual license cost.
• ***Oracle standard terms for Enterprise Edition is 50% of list
pricing for 3 years. This example accounts for the 50% list
pricing for 3 years in the total.
Project Size? > $200K ADS in FY20-21
*See Notes Section
Oracle Database
Cloud Service
Enterprise Edition
Oracle Database
Cloud Service
Enterprise Edition
High Performance
Oracle Enterprise
Edition
Azure Database for
PostgreSQL
Database $9,599 / month $19,801 / month $47,500* / per CPU $2,046.34 / month
Virtual Private Da
tabase
Included Included Included Row level security
Partitioning Not included Included $11,500* / per CPU Included
Data Guard Not included Not included $11,500* / per CPU Included
Spatial Not included Included $17,500* / per CPU Included
Diagnostics Included Included $7,500* / per CPU Included
Tuning Pack Included Included $5,000* / per CPU Included
Lifecycle Manage
ment Pack
Not included Included $12,000* / per CPU
Included as part of
OSS tool suite
Total Capex $0 $0 $1,800,000* $0
Annual Support /
Maintenance per
Server (Opex)
Included Included $396,000** Included
Total 3 Year Cost
of Ownership
$345,564 $712,836 $3,294,000*** $73,668
Savings with Azur
e (approx.)
80% 90% 95% NA
58. Your data journey to Azure
Source
Assessment
Azure Migrate,
CloudPilot,CloudRecon
Migration
Azure Database
Migration Service
Microsoft Azure
Seamless, end-to-end solution | Near-zero downtime | Resilient | Migrate at-scale from multiple sources