38
Accesso ai dati con la Azure Data Platform Luca Di Fino Windows & Windows Phone developer [email protected] @luke2375 #azureit15

Accesso ai dati con Azure Data Platform

Embed Size (px)

Citation preview

Page 1: Accesso ai dati con Azure Data Platform

Accesso ai dati con la Azure Data Platform Luca Di FinoWindows & Windows Phone developer

[email protected]@luke2375

#azureit15

Page 2: Accesso ai dati con Azure Data Platform

Microsoft Azure Data Platform

+Databas

e aggiunti

vi

Page 3: Accesso ai dati con Azure Data Platform

Types of Data You Can Store in Azure• Relational data (Azure SQL)• Flat semi-structured data (Azure Storage Tables)• Files (Azure Storage Blobs)• Serialized Object Graphs in Binary / Base64 (Azure

Storage Blobs)• Messages between systems or processes (Azure

Storage Queues)• Serialized Object Graphs in JSON (DocumentDb)• Cache (Redis)• Application data for PHP apps (MySQL managed by

ClearDb)• NoSQL data (MongoDb managed by MongoLabs)• Big Data (Microsoft HDInsight

Page 4: Accesso ai dati con Azure Data Platform

Azure Data Platform

Demo

Page 5: Accesso ai dati con Azure Data Platform

What is “NoSQL”?

• Modeled using other mechanisms than tables and relations• Key-value stores (Azure Storage Tables)• Document databases (DocumentDb)• Graph databases for storing complex relationships

(See: http://bit.do/graph-db Ex. Neo4j)

• “Not Only SQL” • Vertical vs. Horizontal Scaling

Page 6: Accesso ai dati con Azure Data Platform

Azure Table Storage

Page 7: Accesso ai dati con Azure Data Platform

How Azure Storage Tables are structured

Page 8: Accesso ai dati con Azure Data Platform

Anatomy of an Entity

Required Properties•PartitionKey•RowKey•Timestamp•Etag (think: optimistic concurrency)

Page 9: Accesso ai dati con Azure Data Platform

Even though Azure Storage Tables are represented in a tabular format, they are not to be confused with RDBMS tables

Page 10: Accesso ai dati con Azure Data Platform

Comparing Azure Storage Tables with Azure SQL

• You cannot design Azure Storage Tables using relational database theory (Codd, normal forms, etc.) These serve a different purpose

http://bit.do/azure-tables-vs-sql

Maximum row size 1 MB Max 255 properties

2 GB Max 1024 columns

Maximum data size 200 TB per table 150 GB per database

Maximum number of rows retrieved per query

1,000 Unlimited

Page 11: Accesso ai dati con Azure Data Platform

Utilizing Tables in your applicationAzure Storage Client library (wrapper around RESTful HTTP Azure Management API)Basic course of events:• Create a connection to the storage account• Create a connection to a table (or create it if it doesn’t exist)• Insert entities (Batch insertion)

• Entity classes (POCOs) must inherit from TableEntity class to be serialized for persistence in Azure Storage Tables

• Perform some command (update, delete, retrieve / filter)• Retrieve / filter using TableQuery<T>

Page 12: Accesso ai dati con Azure Data Platform

Storage Tables

Demo

Page 13: Accesso ai dati con Azure Data Platform

Azure Storage Queues

Page 14: Accesso ai dati con Azure Data Platform

Azure Storage Queues• Messages are inserted into Queues and kept in order until they are “delivered” (de-queued)

• Simple First-In-First-Out queue in the cloud

• Each queue message can only be 64k (plenty!) but a queue can hold 200 TB of messages!

• Enables highly scalable applications allowing multiple queue writers to work with multiple queue readers.

• Handles unexpected spikes in traffic

Page 15: Accesso ai dati con Azure Data Platform

Anatomy of Messages• Messages can be strings (UTF-8) or byte

arrays• Typical messages contain:• some proprietary message format (an XML document, comma-delimited file, etc.)• A serialized object or object graph (Ideally both writer and reader would depend on the same interfaces)

• Messages have an expiration date which is, by default, 1 week

Page 16: Accesso ai dati con Azure Data Platform

Processing Queues• To process (read) a queue, a reader will grab a bunch of messages (max: 32) off a queue in a single request

• These are hidden – not removed – until the reader deletes (de-queues) them OR the reader times out, at which point they are un-hidden allowing another reader to attempt to process them.

• Message contents and timeouts can be modified

• Messages can be “peeked” at, which does not hide them on the queue (you can also peek at the number of messages on the queue)

Page 17: Accesso ai dati con Azure Data Platform

Why queues are awesome• Reduces the possibility that data is lost due to

timeouts to the data store or long running processes

• Allows applications to accept data from a user then throw it over the wall to the reader (i.e., a web job, worker role, backend process, etc.)

• The reader will get to it eventually – or to handle more load, just add more instances of the reader temporarily

• Send messages between disparate systems

Page 18: Accesso ai dati con Azure Data Platform

Storage Queues

Demo

Page 19: Accesso ai dati con Azure Data Platform

Azure Storage Blobs

Page 20: Accesso ai dati con Azure Data Platform

Azure Storage Blobs

• Blob = Binary Large Object• Many practical uses inside and outside of

Azure (i.e., Virtual Machines, logs, CDN origin, backups, etc.)

Page 21: Accesso ai dati con Azure Data Platform

Anatomy of a Blob• Any file type and size can be stored in a

blob• Most of the time, you’ll use “block blobs”

– 200 GB• Need to modify ranges of bytes inside of

a blob frequently? Use “page blobs” – up to 1 TB

• Blobs are accessible via URL format: http://<storage-account>.blob.core.windows.net/<container>/<blob>

• Blobs can live inside of folders (and sub-folders) of a container

Page 22: Accesso ai dati con Azure Data Platform

Securing Blobs - Management Keys• Container Access:• Private => Default, only visible by owner • Public Blob => Read access for blobs only (not container stuff)• Public Container => Full read access for blob and container

• Shared Access Signature – Restricted rights for a specific time interval (Actually works on tables and queues, too)

Page 23: Accesso ai dati con Azure Data Platform

Storage Blobs

Demo

Page 24: Accesso ai dati con Azure Data Platform

Azure SQL Server

Page 25: Accesso ai dati con Azure Data Platform

What is Azure SQL?

Core RDBMS SQL Server functionality in the cloud.  High availability, low learning curve, inexpensive starting point, elastic capacity, low management overhead.

Page 26: Accesso ai dati con Azure Data Platform

What you get:• Tables, Views, Stored Procedures,

Security Roles and Users• Limited T-SQL functionality• Automatic backups• Auditing• Monitoring• Geo-replication• Client tools you already know + online

administration

Page 27: Accesso ai dati con Azure Data Platform

Service Tier

Performance Level

Common App Pattern

Performance Business Continuity

Max DB Size

Transaction Perf. Objective

DTU PITR DR / GEO-Rep

Basic Basic Small DB, SQL opp

2 GB Reliability / Hr.

5 7 Days

DB Copy + Manual Export

Standard

S0S1S2

Wrkgp/cloud app, multiple concurrent operations

250 GB

Reliability / Min.

102050

14 Days

DB Copy + Manual Export

Premium

P1P2P3

Mission Critical, High volume, Many concurrent Users

500 GB

Reliability / sec.

100200800

35 Days

Active Geo-replication

Scegliere l’edizione corretta di SQL Database

Queste informazioni potrebbero cambiare nel tempo.

http://bit.do/azure-sql-pricing

Page 28: Accesso ai dati con Azure Data Platform

RavenHQ è un database documentale (RavenDB SaaS).

MongoDB è un database documentale (JSON).

Cassandra è un database per grandi quantità di dati con una eccellente replica.

HBase è un database Big Data (Hadoop) disponibile in HDInsight.

Macchine Virtuali con Oracle sono supportate in Azure.

MySQL è offerto com SaaS dal partner ClearDB.

Ulteriori Database in Azure

Page 29: Accesso ai dati con Azure Data Platform

Azure Search

Page 30: Accesso ai dati con Azure Data Platform

Azure Search

Incorpora una sofisticata esperienza di ricerca in applicazioni web e mobile, senza doversi preoccupare delle complessità di ricerca full-text e senza dover installare, mantenere o gestire qualsiasi infrastruttura.

Page 31: Accesso ai dati con Azure Data Platform

Azure Search

Ideale per gli sviluppatori cloud enterprise, produttori di software sul cloud, architetti che necessitano di una soluzione di ricerca completamente gestita.

Page 32: Accesso ai dati con Azure Data Platform

API HTTP/JSON per la creazione di indici, aggounta di documenti e ricercaParole chiave di ricerca con operatori user-friendly (+, -, *, “”, etc.)Evidenza dei risultatiFaceting (istogrammi su range di dati, tipicamente utilizzati nella navigazione di cataloghi)

Funzionalità di ricerca

Page 33: Accesso ai dati con Azure Data Platform

Suggerimenti (auto-completamento)Query strutturate e complesse (filter, select, sort) combinate con la ricercaProfili con punteggio per modellare la rilevanza dei risultati di ricercaSupporto geo-spaziale integrato nei filtri, nel sort e nel ranking

Funzionalità di Ricerca

Page 35: Accesso ai dati con Azure Data Platform

SQL Database SQL on IaaS DocumentDB

Search HDInsight

MongoDB, MySQL, Oracle,

Cassandra, Neo4j e altri

Microsoft Azure Data Platform

Page 36: Accesso ai dati con Azure Data Platform

Highlights

Pick the right storage tool for the job

Azure can do most of it (or you can host in a VM)

RDBMS vs. NoSQL

Page 37: Accesso ai dati con Azure Data Platform

Feedback & Q&A

http://aka.ms/evalazurebcamp

Page 38: Accesso ai dati con Azure Data Platform

© 2014 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.