Microsoft Azure Storage - Table (NoSQL)

26
Windows Azure Tables - NoSQL Vinícius Souza @vbs_br Evangelista de Tecnologia

description

Tecnologias de armazenamento NoSQL são muito utilizadas, por oferecer uma forma escalável de armazenar grandes quantidades de dados estruturais a um custo muito inferior ao base de dados relacionais. Veja o que é ofertado pela plataforma de nuvem pública da Microsoft e como tirar total proveito desse serviço.

Transcript of Microsoft Azure Storage - Table (NoSQL)

Page 1: Microsoft Azure Storage - Table (NoSQL)

Windows Azure Tables - NoSQL

Vinícius Souza@vbs_brEvangelista de Tecnologia

Page 2: Microsoft Azure Storage - Table (NoSQL)

Agenda

Introdução ao Serviço de ArmazenamentoTable StorageExemplo utilizando .NETFechamento

Page 3: Microsoft Azure Storage - Table (NoSQL)

Introdução ao Serviço de Armazenamento

Page 4: Microsoft Azure Storage - Table (NoSQL)

Windows Azure StorageArmazenamento na nuvem – Acesso a qualquer hora e em qualquer lugar• Blobs, Disks, Tables and Queues

Altamente disponível, durável e escalável• Construa facilmente aplicações web escaláveis• +9 trilhões de objetos armazenados• +900K request/sec com média de (2.5 trilhões por mês)

Pague pelo que utilizarExposto através de APIS RESTBibliotecas disponíveis para .NET, Java, Node.js, PHP, Python, Ruby

Page 5: Microsoft Azure Storage - Table (NoSQL)

Blobs e DisksBlobs – Binary Large Objects

Interface simples para armazenar e recuperar arquivos na nuvem• Data sharing – share documents, pictures, video, music, etc.• Big Data – store raw data/logs and compute/map reduce over data• Backups – data and device backups

Disks – Discos duráveis montados para máquinas virtuais no Azure. • Mounted disks are VHDs stored in Azure Blobs• Move on-premise applications to cloud

Page 6: Microsoft Azure Storage - Table (NoSQL)

Tables e QueuesTables – Sistema NoSQL que escala automaticamente• Key-value lookups at scale• Store user information, device information, any type of metadata for

your service

Queues – Sistema de Mensagem confiável• Decouple components/roles– Web role to worker role communication– Allows roles to scale independently

• Implement scheduling of asynchronous tasks• Building process/work flows

Page 7: Microsoft Azure Storage - Table (NoSQL)

North America Europe Asia Pacific

S. Central – U.S. Region

W. Europe Region

N. Central – U.S. Region

N. Europe Region

S.E. AsiaRegion

E. AsiaRegion

Data centers

Windows Azure Storage

East – U.S. Region

West – U.S. Region

South AmericaRegion

Page 8: Microsoft Azure Storage - Table (NoSQL)

www.buildwindows.com

Windows Azure Data Storage Concepts

Account

Container Blobs

Table Entities

Queue Messages

https://<account>.blob.core.windows.net/<container>

https://<account>.table.core.windows.net/<table>

https://<account>.queue.core.windows.net/<queue>

Page 9: Microsoft Azure Storage - Table (NoSQL)

www.buildwindows.com

Espaço disponível por conta

< 8 Junho 2012 – 100TB>= 8 Junho 2012 – 200TB

Valor é calculado sobre:• utilização de espaço;• transações.

http://bit.ly/Azure_Calculadora_Dados

Page 10: Microsoft Azure Storage - Table (NoSQL)

Resumo Arquitetura

Persistência: Todos os dados são armazenados com pelo menos 3 réplicasConsistência: Todos os dados comitados possuem 3 réplicas idênticasDisponibilidade: Todas as 3 réplicas estão disponíveis para leitura; Performance/Escala: Escala automática e balanceamento de carga baseado na Carga/Capacidade

Maiores informações pode ser adquirida no artigo do SOSP (Symposium on Operating System Principals) paper:“Windows Azure Storage: A Highly Available Cloud Storage Service with Strong Consistency”, ACM Symposium on Operating System Principals (SOSP), Oct. 2011

Page 11: Microsoft Azure Storage - Table (NoSQL)

Conceitos

http://<storage account>.table.core.windows.net/<table>

Page 12: Microsoft Azure Storage - Table (NoSQL)

Criação da conta de armazenamento

Page 13: Microsoft Azure Storage - Table (NoSQL)

Propriedades de uma Table

Propriedades de sistema

• PartitionKey• RowKey• Timestamp

PartitionKey

Tabelas são particionadas para permitir o balanceamento de carga através dos nós de armazenamento

É a primeira parte da chave primária

Pode vir a ter até 1 KB e deve ser incluído em toda a operação de Insert, update e delete.

Page 14: Microsoft Azure Storage - Table (NoSQL)

Propriedades de uma Table

Propriedades de sistema

• PartitionKey• RowKey• Timestamp

RowKey

É a segunda parte da chave primária, como o próprio nome diz é a chave da linha.

É o identificador único para uma entidade em uma partição.

Pode vir a ter até 1 KB e deve ser incluído em toda a operação de Insert, update e delete.

Page 15: Microsoft Azure Storage - Table (NoSQL)

Propriedades de uma Table

Propriedades de sistema

• PartitionKey• RowKey• Timestamp

Timestamp

É uma propriedade mantida pelo sistema transparente para o desenvolvedor.

Page 16: Microsoft Azure Storage - Table (NoSQL)

Tipos de dados (OData Protocol)

OData Data Type Common Language Runtime type Details

Edm.Binary byte[] An array of bytes up to 64 KB in size.

Edm.Boolean bool A Boolean value.

Edm.DateTime DateTime

A 64-bit value expressed as Coordinated Universal Time (UTC). The supported DateTime range begins from 12:00 midnight, January 1, 1601 A.D. (C.E.), UTC. The range ends at December 31, 9999.

Edm.Double double A 64-bit floating point value.

Edm.Guid Guid A 128-bit globally unique identifier.

Edm.Int32 Int32 or int A 32-bit integer.

Edm.Int64 Int64 or long A 64-bit integer.

Edm.String String A UTF-16-encoded value. String values may be up to 64 KB in size.

Page 17: Microsoft Azure Storage - Table (NoSQL)

Windows Azure Tables com .NET

Page 18: Microsoft Azure Storage - Table (NoSQL)

Adicionando uma entidade na Table

Page 19: Microsoft Azure Storage - Table (NoSQL)

Adicionando uma entidade na Table

Page 20: Microsoft Azure Storage - Table (NoSQL)
Page 21: Microsoft Azure Storage - Table (NoSQL)
Page 22: Microsoft Azure Storage - Table (NoSQL)

Serviços da Microsoft que utilizam o Azure StorageXbox: Uses Blobs, Tables & Queues for Cloud Game Saves, Halo 4, XBox Music, XBox Live, etc.Skype: Uses Blobs, Tables and Queues for Skype video messages and to keep metadata to allow Skype clients to connect with each other Bing: Uses Blobs, Tables and Queues to provide a near real-time ingestion engine that consumes Twitter and Facebook feeds, indexes them, which is then folded into Bing searchSkyDrive: Uses Blobs to store pictures, documents, videos, files, etc.

Page 23: Microsoft Azure Storage - Table (NoSQL)

www.buildwindows.com

Page 24: Microsoft Azure Storage - Table (NoSQL)

www.buildwindows.com

Operational Data Analytical Data

Windows Azure TechnologiesData

Provided byWindows Azure

Key/Value Store (Windows Azure Tables,

Redis, …)

Runs in Windows Azure Virtual

Machines

NoSQLTechnologies

SQLTechnologies

Big Data Analytics (HDInsight, Hadoop)

Document Store

(MongoDB, CouchDB,

…)

Relational Database (SQL Database,

SQL Server, Oracle, MySQL, …)

Column Family Store (Cassandra, HBase, …)

Relational Reporting(SQL Server, Oracle,

MySQL, …)

Graph Database

(Neo4J, …)

Relational Analytics(SQL Server, Oracle,

MySQL, …)

Runs in Windows Azure Virtual

Machines and is open source

Page 26: Microsoft Azure Storage - Table (NoSQL)

© 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Vinícius Souza@vbs_brhttp://aka.ms/visouza