• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Windows azure table storage – deep dive
 

Windows azure table storage – deep dive

on

  • 4,731 views

This is a deep dive sesison on Windows Azure Table Storage given by Sundararajan S - http://sundars.net in B.Net DevCon

This is a deep dive sesison on Windows Azure Table Storage given by Sundararajan S - http://sundars.net in B.Net DevCon

Statistics

Views

Total Views
4,731
Views on SlideShare
4,723
Embed Views
8

Actions

Likes
0
Downloads
37
Comments
0

1 Embed 8

http://www.linkedin.com 8

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Windows azure table storage – deep dive Windows azure table storage – deep dive Presentation Transcript

    • Windows Azure Table Storage – Deep Dive
      Sundararajan Subramanian
      Associate Technical Architect
    • Azure - Storage
      Tables – Provide structured storage. A Table is a set of entities, which contain a set of properties
      Queues – Provide reliable storage and delivery of messages for an application
      Blobs – Provide a simple interface for storing named files along with metadata for the file
      Drives – Provides durable NTFS volumes for Windows Azure applications to use
      2
    • Windows Azure Tables
      Provides Structured Storage
      Massively Scalable Tables
      Billions of entities (rows) and TBs of data
      Can use thousands of servers as traffic grows
      Highly Available & Durable
      Data is replicated several times
      Familiar and Easy to use API
      ADO.NET Data Services – .NET 3.5 SP1
      .NET classes and LINQ
      REST – with any platform or language
      3
    • Table Storage Concepts
      Entities
      Tables
      Accounts
      Blogtitle=…
      Name = …
      BlogPosts
      Blogtitle=…
      Name = …
      sundars
      Name=…
      Id= …
      Users
      Name=…
      Id= …
      4
    • Table Data Model
      Table
      A storage account can create many tables
      Table name is scoped by account
      Set of entities (i.e. rows)
      Entity
      Set of properties (columns)
      Required properties
      PartitionKey, RowKey and Timestamp
      5
    • Required Entity Properties
      PartitionKey & RowKey
      Uniquely identifies an entity
      Defines the sort order
      Use them to scale your application
      Timestamp
      Read only
      Optimistic Concurrency
      6
    • PartitionKey And Partitions
      PartitionKey
      Used to group entities in the table into partitions
      A table partition
      All entities with same partition key value
      Unit of scale
      Control entity locality
      Row key provides uniqueness within a partition
      7
    • Partitioning Tables
      Partition 1
      Partition 2
    • Partitioning – Why?
      • Scalability
      Each individual partitions are distributed across multiple storage nodes
      System monitors the Partition usage and automatically balances partitions across multiple storage nodes.
      Apartition i.e. all entities with same partition key, will be served by a single node
      • Entity Group Transactions
      Allows the application to atomically perform multiple Create/Update/Delete operations across multiple entities in a single batch request to the storage system
      • Entity Locality
    • Chosing Partition Key
      • Entity Group transactions
      • Efficient queries
      • Scalability
    • Table Operations
      Table
      Create
      Query
      Delete
      Entities
      Insert
      Update
      Merge – Partial Update
      SaveChanges()
      Replace – Update entire entity SaveChanges(SaveChangesOptions.ReplaceOnUpdate)
      Delete
      Query
      Entity Group Transaction
    • Demo
      Blog Engine – Windows Azure Table Storage
    • DataService Context – Best Practices
      • Do not share the dataservicecontext object across threads
      • Maintain shorter lifetimes
      • Use separate Dataservice Context object for each operation
      If dataservice context object is shared across multiple operations the error cause in one of the operation will be retried during the subsequent SaveChanges.
      • Entity Class name and the Table name should be same for high performance
    • Concurrent updates
      • With each result set, Etags are sent
      • When an update happens to the retrieved entity, the client sends the Etag back to the server.
      • Server checks for the Etag of the persisted entity before update.
      • If there is a mismatch, server throws an exception
    • Query speed
      • FAST
      Single partitionkey and rowkey with equality
      • MEDIUM
      Single partition but a small range for RowKey
      Entire partition or table that is small
      • SLOW
      Large single scan
      Large table scan
      “OR” predicates on keys => no query optimization => results in scan
      • Expect Continuation Tokens
    • Make Queries FASTER
      Large Scans
      Split the range and parallelize queries
      Create and maintain own views that help queries
      “Or” Predicates
      Execute individual query in parallel instead of using “OR”
      User Interactive
      Cache the result to reduce scan frequency
    • Continuation tokens
      • Maximum of 1000 rows in a response
      • At the end of partition range boundary
      • Maximum of 5 seconds to execute the query
      • Expect Continuation token always
      If the Query times out, Server returns a continuation token so that the client can make another query
      When the Scan crosses partition boundary, continuation tokens are returned
    • Pagination
      • Use Iqueryable<>.Take(N) to fetch the top results
      • Use continuation Tokens
      http://<serviceUri>/Blogs?<originalQuery>&NextPartitonKey=<someValue>&NextRowKey=<someOtherValue>
    • Tips and Tricks
      Windows Azure Table Storage
    • Retrieve Latest Items
      Have the row key as
      DateTime.MaxValue.Ticks- DateTime.UtcNow.Ticks
    • Prefix based Retrieval
      • Use CompareTo and ‘>’ and ‘<‘ function effectively
      • blog.PartitionKey.CompareTo(“Mic”)>=0
    • Q&A
    • http://tinyurl.com/codeshelve
      http://sundars.net
      sundararajans@hotmail.com
      http://twitter.com/sundararajans
      Thank you