build smarter and scalable applications using microsoft azure database services

30
Build smarter and scalable applications using Microsoft Azure Database Services Fabricio Catae Technical Evangelist Nilton Pinheiro Sr. Support Engineer BRK3062

Upload: fabricio-catae

Post on 16-Apr-2017

228 views

Category:

Internet


0 download

TRANSCRIPT

Page 1: Build smarter and scalable applications using Microsoft Azure Database Services

Build smarter and scalable applications using Microsoft Azure Database ServicesFabricio CataeTechnical Evangelist

Nilton PinheiroSr. Support Engineer

BRK3062

Page 2: Build smarter and scalable applications using Microsoft Azure Database Services

Realidade

Page 3: Build smarter and scalable applications using Microsoft Azure Database Services

Qual o futuro do Banco de Dados?

Image: https://openclipart.org/detail/243050/binary-sphere

Page 4: Build smarter and scalable applications using Microsoft Azure Database Services

SQL Server em Nuvem

Page 5: Build smarter and scalable applications using Microsoft Azure Database Services

Migração para Cloud é inevitável

Preocupações:• Custo da solução• Segurança dos dados• Desempenho do servidor• Latência de rede• Discos lentos

CloudFísico Virtual

Page 6: Build smarter and scalable applications using Microsoft Azure Database Services

Benchmark de discoFerramentas• IOMeter• SQLIO• SQLIOStress• SQLIOSim• DiskSpd

Page 7: Build smarter and scalable applications using Microsoft Azure Database Services

IOPSA maior parte dos sistemas pode ser atendida com uma demanda de até 1000 IOPS para leitura dos dados.Existem diferentes tipos de I/O• Escrita ou Leitura• Sequencial ou

Aleatório• Tamanho do bloco

Disco IOPS Latência

HDD (7200 RPM)

100 10ms

HDD (10k RPM) 140 7msHDD (15k RPM) 200 5msSSD +5000 <1ms

Page 8: Build smarter and scalable applications using Microsoft Azure Database Services

Padrão de Acesso ao DiscoFile Operation Read Write I/O type

Data File

Page Read 8kb - Random

Checkpoint - 64kb - 128 kb Random

LazyWriter - 64kb - 128 kb Random

ReadAhead 64kb - 512 kb - Sequential

Bulk Insert - 8kb - 128 kb Sequential

Backup 1 MB - Sequential

Restore - 64kb Sequential

Log File Log Write - 512 bytes - 64kb Sequential

Page 9: Build smarter and scalable applications using Microsoft Azure Database Services

DEMO

Benchmark de IOPS no Azure

Page 10: Build smarter and scalable applications using Microsoft Azure Database Services

Azure Infrastructure as a Service (IaaS)Tradicional Azure Disks

Disco IOPS LatênciaStandard HDD 500 6msPremium (128GB)

500 2ms

Premium (512GB)

2300 2ms

Premium (1024GB)

5000 2ms

Disco IOPS Latência

HDD (7k2 RPM) 100 10msHDD (10k RPM) 140 7msHDD (15k RPM) 200 5msSSD +5000 <1ms

RAID?

Page 11: Build smarter and scalable applications using Microsoft Azure Database Services

Blob Storage

BlobContainerStorageAccount

Pages/ Blocks

contoso

PIC01.JPG

Block/Page

Block/Page

PIC02.JPGimages

VID1.AVIvideos

Page 12: Build smarter and scalable applications using Microsoft Azure Database Services

Azure Storage

Massive Scale Out & Auto Load Balancing Index Layer

Distributed Replication Layer

Blob/Disk QueueTable

REST REST REST REST

File Share

SMB

“Microsoft Azure Storage: A Highly Available Cloud Storage Service with Strong Consistency”, ACM Symposium on Operating System Principals (SOSP), Oct. 2011

Page 13: Build smarter and scalable applications using Microsoft Azure Database Services

DEMO

Portal do Azure

Page 14: Build smarter and scalable applications using Microsoft Azure Database Services

SQL AlwaysOn Cluster

Considerações• Domain Controllers• Azure Load Balancer • Cluster Witness• Availability Set

Page 15: Build smarter and scalable applications using Microsoft Azure Database Services

IaaSPhysical Virtual DBaaS

Page 16: Build smarter and scalable applications using Microsoft Azure Database Services

Azure SQL Database – O que é?SQL Server como serviçoTotalmente gerenciado pela MicrosoftManutenção quase zero, não requer pagamento de licença e infraestrutura totalmente replicadaPermite foco nas aplicações e banco de dados, não na infraestrutura/administração

Auto gerenciado e ferramentas familiar

Continuidade de Negócios e Proteção de dados

Escalabilidade e Performance

Atende a níveis de desempenho previsíveis e imprevisíveisScale up/down e out/inDashboard com visualização de métricas do DB

Self-service restoreDisaster recoveryCompliance-enabled

Self-managedFerramentas e linguagem familiar

Page 17: Build smarter and scalable applications using Microsoft Azure Database Services

Azure SQL Database – Service TiersService Tier

Performance Level

Common App Pattern

Performance Business Continuity

Max DB Size

Concurrent Session (max)

DTUs

PITR DR / GEO-Rep SLA

Basic Basic Small DB 2 GB 300 5 7 Days

DB Copy + Manual Export + Active Geo-Replication

99,99%

Standard S0-S3 Cloud app 250 GB 600 – 2400 10-100

35 Days

DB Copy + Manual Export + Active Geo-Replication

99,99%

Premium P1-P15

Mission Critical, High volume, Many concurrent Users

500/1024 GB

2400 - 32000

125-4000

35 Days

DB Copy + Manual Export + Active Geo-Replication

99,99%

Elastic Pool Basic, Standard, Premium

Page 18: Build smarter and scalable applications using Microsoft Azure Database Services

Azure SQL Database - DTU

Monitoração% do nível de consumo

Utilization

75%

Read

50%

Write

50%

CPU

60%

Memory

CPU

Writ

es

Reads

Memory

DB workload

Combinação

• Combinação do consumo de CPU, memória, leituras e escritas

• Representa a quantidade de recursos atribuídos ao banco de dados

• Estes 4 pilares permitem a comparação relativa de recursos

• Fornece uma abstração do hardware

Database Transaction Unit (DTU) é definido pela combinação do consumo de recursos exigidos por uma carga de trabalho no banco de dados

Azure SQL Database DTU Calculatorhttp://dtucalculator.azurewebsites.net/

Page 19: Build smarter and scalable applications using Microsoft Azure Database Services

Azure SQL Database - Escalabilidade

Basic / Standard / PremiumCPU

DB 1 DB 2

DB 3

DB 4

DB 7

DB 5 DB 6

DB 8 DB 9

Writ

es

Reads

Memory

Escalabilidade individual dos databases (up/down) permite atenderuma demanda atual ou previstaBancos de dados e recursos isoladosBancos de dados se mantém online durante o processo de escaladaA cobrança por hora oferece maior eficiência de custo

B5 10 20 50 100 250 500

S0

S1

S2

S3

P2

P4P1

125

P6 P11

1000 1750

P15

4000

Page 20: Build smarter and scalable applications using Microsoft Azure Database Services

Azure SQL Database – Monitoração real-timeMonitorar o consumo de recursos ao longo do tempo e definir alertas e notificações (configuráveis pelo usuário) para orientar nas decisões de escalada

As métricas incluem % DTU, % CPU, reads/writes, database size, conexões entre outras

Tudo pode ser acompanhado através de um Dashboard no Portal ou DMVs (T-SQL)

Use os monitoramentos e alertas para melhor entender e gerenciar a utilização dos

recursos.

Page 21: Build smarter and scalable applications using Microsoft Azure Database Services

Azure SQL Database - EscalabilidadeCargas de trabalho imprevisíveis (Elastic Database Pool)

Compatilhamento de recursos dinamicamente entre databases no mesmo poolBusca atender demandas imprevisíveis ou esporádicasO custo é por pool e não por banco de dados isoladoTier Performance Business Continuity

DB por pool

Max Storage Size por poll

Max Storage por DB

Max Concurrent Session por pool

Max eDTUs

PITR DR / GEO-Rep

Basic 200 - 400 10 – 117GB 2 GB 4800 - 28800 100-

1200 7 Days Active Geo-Replication

Standard 200 - 400

100 - 1200 GB 250 GB 4800 - 28800 10-

10035 Days

Active Geo-Replication

Premium 50 250 - 750 GB 500 GB 4800 - 28800 125-

150035 Days

Active Geo-Replication

Page 22: Build smarter and scalable applications using Microsoft Azure Database Services

Azure SQL Database – Proteção de dadosBackup automáticoBackup full semanal, diff a cada hora, log a cada 5 minBackups full e diff são automaticamente copiados para um geo-redundant azure storageSelf-service restoreREST API, PowerShell ou PortalCria um novo banco de dados no mesmo servidor lógicoPoint in time restore dos backups locais Restore mesmo dos bancos de dados já excluídosRetençãoBasic - 7 dias, Standard – 35 diasPremium – 35 dias

LS TechSummit

DB

DB1

Backups

Backups

dbbackup01

dbbackup02

dbbackup03

Backups copiados para o Azure Storage

Os bancos de dados estão protegidos contra a corrupção acidental de dados, exclusão e

desastre.

Page 23: Build smarter and scalable applications using Microsoft Azure Database Services

Azure SQL Database – Continuidade de Negócio

DB1DB1

DB1

Geo-Replicação ativaERT < 30s, RPO < 5sMonitoração do failover através do portal ou DMVsReplicação e sincronização automáticaSuporte a até 4 replicas secundárias

Réplicas disponíveis para leitura

DB1

Geo-replicação minimiza a interrupção dos negócios

contra possíveis desastres.

DB1

DB1

Failover e ativação do secundário a

qualquer momento.

Page 24: Build smarter and scalable applications using Microsoft Azure Database Services

DEMO

Point in time restore e Geo-Replication

Page 25: Build smarter and scalable applications using Microsoft Azure Database Services

Azure SQL Database – SegurançaAuditoria e detecção de ameaças

Configurável via PortalLogs são armazenados em Azure storage accountsDashboard para visualização e análise dos logs

Dynamic data maskingTransparent data encryptionVocê ainda é responsável por vários aspectos da segurança

Uso de conexões segurasConfiguração de firewallProteção contra SQL injectionSeguir a regra do menor privilégio possível

SQL Database

Auditing

Auditlog

Azure Storage

Page 26: Build smarter and scalable applications using Microsoft Azure Database Services

Azure SQL Database – Administração zero

SQL ServerPhysical Machines (raw iron)Dedicado

Alto custo

Compartilhado Baixo

custo

Maior administração Menor administração

Hybrid Cloud

On Premises

Off Premises

Infrastructure as a Service

SQL Server in Azure VMVirtualized MachinesSQL SQL SQL

Platform as a Service

Azure SQL DatabaseVirtualized DatabasesSQL SQL SQL

Virtual

SQL Server Private CloudVirtualized Machines + AppliancesSQL SQL SQL

Physical

SQL ServerPhysical Machines (raw iron)SQL

Manutenção e tolerância a falhas integrada, com gerenciamento self-service (provisionamento,

cópia, exclusão, restore, configuração de geo-replicação,

auditoria, importação e exportação, dashboard e

ferramentas que você já usa.

Page 27: Build smarter and scalable applications using Microsoft Azure Database Services

Azure SQL Database – Quanto custa?

Page 28: Build smarter and scalable applications using Microsoft Azure Database Services

DEMO

Azure SQL Database

Page 29: Build smarter and scalable applications using Microsoft Azure Database Services

Azure SQL DatabaseDatabase como serviço com 99.99% de SLA e totalmente gerenciado pela MicrosoftProvisionamento e pagamento conforme o usoElastic scale up/down e out/inSimplificação da continuidade dos negócios com backups automáticos e geo-replicaçãoAmbiente seguro e auditávelAuto gerenciado com administração quase zero

Page 30: Build smarter and scalable applications using Microsoft Azure Database Services

© 2016 Microsoft Corporation. All rights reserved.