sql azure и все, все, все

39
SQL Azure и все, все, все... Денис Резник Digital Cloud Technologies http://reznik.uneta.com.ua | http://twitter.com/DenisReznik

Upload: -

Post on 30-Apr-2015

1.485 views

Category:

Technology


2 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Sql azure и все, все, все

SQL Azure и все, все, все...

Денис РезникDigital Cloud Technologieshttp://reznik.uneta.com.ua | http://twitter.com/DenisReznik

Page 2: Sql azure и все, все, все

Сегодня мы поговорим о…

SQL Azure

SQL Azure Data Sync

SQL Azure Federations

SQL Azure Reporting

Page 3: Sql azure и все, все, все

SQL Azure

Page 4: Sql azure и все, все, все

SQL Azure – Database As a Service

As a Service

DB

Page 5: Sql azure и все, все, все

Преимущества SQL Azure

Реляционный движок на базе SQL ServerОтказоустойчивость (для каждой базы хранится 2 реплики)МасштабируемостьЗнакомые инструменты управленияВозможность сосредоточиться на разработке

Page 6: Sql azure и все, все, все

Стоимость решения

Web Edition – размер базы до 1 Гб – $9.99Business Edition размер базы до 10 Гб - $99.9Входящий трафик - $0.10 за ГбИсходящий трафик - $0.15 за ГбТрафик между SQL Azure Database и приложением, находящимся в Windows Azure не тарифицируется

Page 7: Sql azure и все, все, все

TicketDirect о SQL Azure

TicketDirect is an alliance of more than 90 independent venues across New Zealand and Australia that have come together to give customers and promoters a national event ticketing service. It has more than 80 venues in New Zealand and Australia that sell various tickets online to major concerts and sporting events.

TicketDirect considered various approaches to lowering the cost of its platform, including SQL Azure and other cloud platforms, but at first decided that SQL Azure, which at the time supported only 10 GB per database, was not sufficient for its needs. TicketDirect wanted a solution that could scale out to support many nodes and deliver 99.99% uptime, with no limit on database size, even though it wanted to store only a few hundred Gigabytes. In addition, it wanted to further limit costs by ensuring that it did not have to manage or support the database platform. TicketDirect considered Amazon EC2 and other cloud platforms but ultimately chose SQL Azure and Windows Azure because it offered the ability to scale out in the cloud by sharding data across as many databases, overcoming the 10 GB limit, and also because it was the most cost-effective platform. Although using SQL Azure’s approach to sharding did require some programming skills and extra

Page 8: Sql azure и все, все, все

Kelly Blue Book о SQL Azure

Kelley Blue Book (KBB) is a leading provider of new and used car information. Since 1926, it has provided vehicle buyers and sellers with the information they need to accomplish their goals with confidence. Today, kbb.com has more than 16 million unique visits each month.

SQL Azure• Offers a scalable platform. With less than 5 GB of data, growing by

about 500 MB per year, KBB’s workload was its key concern. With more than 16 million unique visits per month, a number that is likely to grow even higher in the coming years, KBB found that SQL Azure’s ability to dynamically grow to support peak loads was a key decision criterion.

• Improved application availability. SQL Azure offered KBB a platform for improving the availability of its most critical application. As Mr. Lapin pointed out, “Instead of paying for availability via a second data center, we chose to go to with Azure platform. It was not only a cost-effective strategy but also made our life simpler.”

Page 9: Sql azure и все, все, все

XEROX о SQL Azure

MSDN: What exactly have you created with SQL Azure?Shustef: We've created a service called Xerox Cloud Print that allows mobile workers to print to any available public printer from their smartphones, iPads, and other mobile devices.

MSDN: Why is SQL Azure a good fit for this application?Shustef: SQL Azure provides multitenancy, dynamic scalability, and cost effectiveness. We can securely  stack data from multiple customers in a single SQL Azure instance, which makes it very cost effective. Also, our development staff is Microsoft trained. We used Microsoft SQL Server 2008 for the predecessor to Xerox Cloud Print, a private-cloud version of the service that enables phone-based printing from inside a corporate firewall. We wanted to reuse that SQL Server development investment, and SQL Azure provided the most economical way to do so.Eugene Shustef, Chief Engineer, Global Document

Outsourcing, Xerox

Page 10: Sql azure и все, все, все

Case Studies

http://www.microsoft.com/windowsazure/evidence/

Page 11: Sql azure и все, все, все

Составные части

• Работа с порталом• Инструмент оплатыAccount

• Информация о базах данных• Аутентификация и

безопасностьServer

• Аналог SQL Server базы данных

• Содержит таблицы, процедуры, индексы, и т.п.

Database

Page 12: Sql azure и все, все, все

Gateway

Gateway

Gateway

Gateway

Gateway

Gateway

Gateway: TDS protocol gateway, enforces AUTHN/AUTHZ policy; proxy to CloudDB

SQL Azure Network Topology Applicatio

n

InternetAzure Cloud

LB

TDS (tcp)

TDS (tcp)

TDS (tcp)

Applications use standard SQL client libraries: ODBC, ADO.Net, PHP, …

Load balancer forwards ‘sticky’ sessions to TDS protocol tier

Security Boundary

SQL SQL SQL SQL SQLSQL

Scalability and Availability: Fabric, Failover, Replication, and Load balancing

Page 13: Sql azure и все, все, все

SQL Azure Database provisioning

TDS GatewayFront-end Node

Protocol Parser

Gateway Logic

Master Cluster

Master Node

Master Node Components

1

2

3

5 67

Scalability and Availability: Fabric, Failover, Replication, and Load balancingScalability and Availability: Fabric, Failover, Replication, and Load balancing

4

8

TDS Session

Backend Node 1SQL Instance

SQL DB

Backend Node 2SQL Instance

SQL DB

Backend Node 3SQL Instance

SQL DB

Page 14: Sql azure и все, все, все

Основные изменения 2010

Поддержка пространственных типов данных Geography и GeometryПоддержка типа данных HierarchyIdDatabase copy

CREATE DATABASE destination_database_nameAS COPY OF

[source_server_name.]source_database_name

Новый портал (+ Проект “Houston”)…Анонсирована концепция Federations

Page 15: Sql azure и все, все, все

Demo

Page 16: Sql azure и все, все, все

SQL Azure Federations

Page 17: Sql azure и все, все, все

МасштабированиеScale up

Купить мощный серверМощные сервера дорогие!

Загрузить сервер по полнойЧто делать если нагрузка меняется? Резервы для пиковой нагрузки - нерентабельно!

Scale-outРаспределить данные и нагрузку между

несколькими серверамиМаленькие сервера дешёвые! Scale linearly800 маленьких серверов работают олчень быстро

Способность противостоять пиковым нагрузкам

Распределение нагрузки внутри датацентра

Page 18: Sql azure и все, все, все

Sharding: ПроблемыРезервирование• Рост и уменьшение

размера БД

Управление• Обновление, Высокая

доступность

Маршрутизация• Где находятся мои

данные?• Как их масштабировать

и использовать?

Управление секциями• Разбиение и слияние• Распределение

Sharding

Page 19: Sql azure и все, все, все

SQL Azure Federations: Основные понятия

Federation RootБаза данных, содержащая информацию о федерации

FederationПредставляет данные с шардов

Federation KeyЗначение, которое определяет маршрутизацию данных

Federation Member (aka Shard)

Физическое хранилище для atomic unit

Atomic UnitВсе строки с одинаковым значением federation key value: всегда вместе!

Root

Federation “CustData”

Member: [min, 100]

AUPK=5

AUPK=25

AUPK=35

Member: [100, 488]

AUPK=105

AUPK=235

AUPK=365

Member: [488, max]

AUPK=555

AUPK=2545

AUPK=3565

(Federation Key: CustID)

Page 20: Sql azure и все, все, все

Создание Federation

Создание root базы данных

CREATE DATABASE SalesDBСодержит метаданные секцийЦентрализованное хранилище данных

Создание federation в root

CREATE FEDERATION Orders_Fed (RANGE BIGINT)Указание имени и типа ключаСоздание первого member, покрывающего все даные

SalesDB

Federation “Orders_Fed”

(Federation Key: CustID)

Member: [min, max]

Page 21: Sql azure и все, все, все

Создание схемы

Federated tablesCREATE TABLE orders (…)

FEDERATE ON (customerId)Значение federation key будет

определять то где будутнаходиться данные

Reference tablesCREATE TABLE zipcodes (…)Отсутствие FEDERATE ON

указывает на reference table

Centralized tablesСоздаются в root database

Federation “Orders_Fed”

(Federation Key: CustID)

Member: [min, max)

SalesDB

orders

Products

zipcode

Page 22: Sql azure и все, все, все

Разделение и слияниеSplitting a member

Когда слишком большие или высоконагруженныеALTER FEDERATION Orders_Fed SPLIT (100)Создаёт 2 новых членаOnline!

Merging membersКогда слишком малькиеALTER FEDERATION Orders_Fed MERGE (200)Создаёт новый член, удаляет старые

Federation “Orders_Fed”

Member: [min, max)

orders zipcode

Member: [min, 100)

orderszipcod

e

Member: [100, max)

zipcode

orders

SalesDBProduct

s

Page 23: Sql azure и все, все, все

Соединение и операции

Connect to atomic unitUSE FEDERATION Orders_Fed (56) WITH FILTERING=ONТолько данные со значением federation key 56 видимы

+ reference dataSafe: atomic unit никогда не может быть разделён

Connect to entire federation member

USE FEDERATION Orders_Fed (56) WITH FILTERING=OFFВсе данные члена федерации видимыDangerous: federation member может быть разделён

Member: [min, 100)

AUPK=5

AUPK=25

AUPK=56

App

zipcode

Page 24: Sql azure и все, все, все

Sharding in SQL Azure: Future

Multi Column Federation KeysFederate on enterprise_customer_id + account_id

Schema ManagementПоддержка управления схемами членов федерации.

Fan-out QueriesЕдиничный запрос, который получает данные с нескольких членов федерации.

Auto RepartitioningАвтоматическое разбиение базы данных в зависимости от определённого критерия (время отклика, размер базы данных и т.п.)

Page 25: Sql azure и все, все, все

SQL Azure Data Sync

Page 26: Sql azure и все, все, все

Сценарии использования

On-Premises (Headquarters)

Syn

c

Sync

Remote Offices

SQL Azure Data Sync

Retail Stores

Sync

Sync

SQL Azure Database

Sync Sync CT

P1

CT

P2

Page 27: Sql azure и все, все, все

Ключевые особенности

МасштабируемостьСервис масштабируется по мере роста требований к ресурсам

No-Code конфигурация синхронизации

Легко определить данные для синхронизации

Синхронизация по расписаниюГибкий выбор графика синхронизиции

Page 28: Sql azure и все, все, все

Ключевые особенности

Обработка конфликтовОбработка ситуаций, когда одни и те же данные изменяются в разных базах данных

Логирование и мониторингИнструменты для отслеживания процесса синхронизации и потенциальных проблем

Page 29: Sql azure и все, все, все

Roadmap продукта

Лето 2011 – CTP3UI интегрированный с порталом SQL AzureВыбор подмножества столбцов или строк для синхронизацииИзменения схемы баз, без пересинхронизацииПолитики разрешения конфликтовУлучшение usability

2011 г. – Релиз SQL Azure Data Sync

Page 30: Sql azure и все, все, все

Demo

Page 31: Sql azure и все, все, все

SQL Azure Reporting

Page 32: Sql azure и все, все, все

SQL Azure Reporting - Факты

Основаны на SQL Server Reporting Services

Поддерживается большая часть элементов SQL Server 2008 R2 Reporting ServicesРазработка при помощи Business Intelligence Studio

Отчёт генерируется в облакеВсегда, независимо от того размещаете вы его на репорт сервере или встраиваете в своё приложение

SQL Azure Reporting является частью платформы Windows Azure

Использование порталаМасштабируемость

Page 33: Sql azure и все, все, все

SQL Azure Reporting - Факты

Data Source - SQL AzureИсточником данных для отчёта может выступать только база данных SQL Azure

Отчёты в том же форматеОтчёты работающие на SQL Server Reporting Services могут быть легко портированы в облако

Ничего не нужно дополнительно устанавливатьОтчёты доступны из любого места

Не нужно разворачивать сайт с репорт сервером

Page 34: Sql azure и все, все, все

Demo

Page 35: Sql azure и все, все, все

SummaryDatabase

Service

• TSQL support• Tooling Support

(SSMS, VS)• High Availability• Self-

Management• Elastic Scale-out

• 50GB • Spatial Data• Local copy,

backup/restore• QoS Enhancements • Developer &

management experience improvements

• VS designers • Integrated developer

portal• Database Manager

• Database Import/Export• Enhanced Backup/Restore

Support• Scale Out & Elasticity

Support via Federations• Enhanced multi-tenant

support• Standards compliance • Resource reservation• Multi-tier SLA • JDBC Support

Data SyncService

Data Sync Service (CTP)

• On premises/cloud spanning

• Cloud-to-cloud sync

Data Sync Service• On premises/cloud

spanning, Cloud-to-cloud sync

BI Service

Reporting as a Service (CTP)• Reporting services CTP

BI as a Service• Reporting service• Analysis serviceLaunch-PDC09 Beyond2010

Page 36: Sql azure и все, все, все

Для разработчиков

http://www.microsoft.com/en-us/sqlazure/database.aspx

http://www.microsoft.com/windowsazure/free-trial/

Page 37: Sql azure и все, все, все

Полезные ссылки

SQL Azure product siteБлог команды разработчиков SQL AzureForrester: SQL Azure Raises The Bar On Cloud DatabasesFree e-book: Developing Applications for the Cloud on the Microsoft Windows Azure™ PlatformSQL Azure VideosVideo: Building Scale-Out Database Solutions on SQL AzureWhitepaper: Inside SQL AzureWhitepaper: Gaining Performance Insight into SQL AzureWhitepaper: SQL Azure Reporting OverviewWhitepaper: SQL Azure Data Sync - How to Get StartedWhitepaper: SQL Azure Data Sync - Best PracticesWhitepaper: Sharding with SQL Azure

Page 38: Sql azure и все, все, все

Вопросы

Денис РезникРуководитель департамента веб-разработки, DCT

Trainer, Microsoft Innovation CenterMicrosoft MVP (SQL Server)

Microsoft Certified [email protected]

http://reznik.uneta.com.ua/http://twitter.com/DenisReznik

Page 39: Sql azure и все, все, все

Денис РезникРуководитель департамента веб-разработки, DCTTrainer, Microsoft Innovation CenterMicrosoft MVP (SQL Server)Microsoft Certified [email protected]://reznik.uneta.com.ua/http://twitter.com/DenisReznik