Windows azure table storage – deep dive
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share

Windows azure table storage – deep dive

  • 5,105 views
Uploaded on

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

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
5,105
On Slideshare
5,097
From Embeds
8
Number of Embeds
1

Actions

Shares
Downloads
41
Comments
0
Likes
0

Embeds 8

http://www.linkedin.com 8

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Windows Azure Table Storage – Deep Dive
    Sundararajan Subramanian
    Associate Technical Architect
  • 2. 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
  • 3. 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
  • 4. Table Storage Concepts
    Entities
    Tables
    Accounts
    Blogtitle=…
    Name = …
    BlogPosts
    Blogtitle=…
    Name = …
    sundars
    Name=…
    Id= …
    Users
    Name=…
    Id= …
    4
  • 5. 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
  • 6. 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
  • 7. 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
  • 8. Partitioning Tables
    Partition 1
    Partition 2
  • 9. 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
    • 10. Efficient queries
    • 11. 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
  • 12. Demo
    Blog Engine – Windows Azure Table Storage
  • 13. DataService Context – Best Practices
    • Do not share the dataservicecontext object across threads
    • 14. Maintain shorter lifetimes
    • 15. 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
    • 16. When an update happens to the retrieved entity, the client sends the Etag back to the server.
    • 17. Server checks for the Etag of the persisted entity before update.
    • 18. 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
  • 19. Continuation tokens
    • Maximum of 1000 rows in a response
    • 20. At the end of partition range boundary
    • 21. Maximum of 5 seconds to execute the query
    • 22. 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
  • 23. Pagination
    • Use Iqueryable<>.Take(N) to fetch the top results
    • 24. Use continuation Tokens
    http://<serviceUri>/Blogs?<originalQuery>&NextPartitonKey=<someValue>&NextRowKey=<someOtherValue>
  • 25. Tips and Tricks
    Windows Azure Table Storage
  • 26. Retrieve Latest Items
    Have the row key as
    DateTime.MaxValue.Ticks- DateTime.UtcNow.Ticks
  • 27. Prefix based Retrieval
    • Use CompareTo and ‘>’ and ‘<‘ function effectively
    • 28. blog.PartitionKey.CompareTo(“Mic”)>=0
  • Q&A
  • 29. http://tinyurl.com/codeshelve
    http://sundars.net
    sundararajans@hotmail.com
    http://twitter.com/sundararajans
    Thank you