Windows azure table Storage vs. Windows SQL azure

Source: Internet
Author: User
Tags relational database table windows azure sdk management studio sql server management sql server management studio azure sdk

Http://www.intertech.com/Blog/post/Windows-Azure-Table-Storage-vs-Windows-SQL-Azure.aspx

 

By Jim White (Director of Training and Education uctor)

 

Last week, my fellow Intertech colleague and Microsoft MVP, Tim star, and I presented the Windows azure bootcamp
For the Twin Cities. According to Microsoft reps, we broke the record
For the most attended bootcamp in the US with nearly a hundred people
The event.

 

A common question that I have ed during and after
The bootcamp was "Why wowould I want to use Windows azure table Storage
Versus windows SQL azure to store my application data? "A good question
With the answer dependent on your application and data needs.

 
Table Storage and SQL azure defined

 

First,
Allow me to backup and set the stage a little for this discussion. SQL
Azure is essential SQL server in the Microsoft cloud computing
Environment known as azure. That is not quite true in that SQL azure
Currently has a number of limitations and unsupported features that SQL
Server 2008 has (here is a starter list of limitations: http://msdn.microsoft.com/en-us/library/ee336245.aspx ).
I like to say that SQL Azure is either SQL Server 2008 minus or SQL
Express plus depending on how you want to view it. Table storage is one
Of three alternate storage mechanisms built into azure that is
Collectively called Windows azure storage services. The other two being
Queues and blobs. Table Storage allows you to store serialized
Entities in Table , But the term Table Here is not
Relational Database Table. To provide people with some analogy they
Can use to get their arms around table Storage, I like to tell people
Think of table storage as a fancy spreadsheet. You can store the state
Of your entities in the columns of the spreadsheet. However, there is
No linkage or relationship (therefore joins) between entities-at least
None that is automatically managed and maintained by Azure. There are
No custom indexes-at least not today.

 

Interestingly, when
Azure was first introduced in 2008, SQL server was not part of
Original picture. Because of developer negative reactions, SQL azure
Was added to the next preliminary release in 2009. There is a growing
Faction that is trying to get the software community to look at SQL
Alternatives. The "no-SQL" community (see here and here ),
To some extent, has influenced part of the azure cloud computing
Platform through the table storage option, but not enough to eliminate
It from the Microsoft cloud.

 

While both SQL azure and azure
Table Storage provide data persistence via table structure, there are
Number of differences between them. The sections below outline some
The key differences and factors you want to weweigh before building
Application for azure that requires some form of table persistence.

 
Scale and Performance

 

When
Looking at sheer volume, table storage is today far more scalable
SQL azure. Given a storage account (storage accounts hold blobs, queues
And tables) is allowed to be 100 TB in size, in theory your table cocould
Consume all 100 TB. At first glance, a 100 TB chunk of data may seem
Overwhelming. However, table storage can be partitioned. Each
Partition of table storage can be moved to a separate server by
Azure controller thereby resizing the load on any single server.
Demand lessens, the partitions can be retried lidated. reads of azure
Table storage are load balanced into SS three replicas to help
Performance.

 

Entities in Table storage are limited to 1 MB each
With no more than 255 properties (3 of which are required partition key,
Row key, and timestamp). That seems like an absurd number, and it is,
But remember that there are no relationships and joins in table
Storage. Therefore, you might need some wide tables to handle
Associated data.

 

Today, SQL azure databases are limited to 1 GB
Or 10 Gb. However, sometime this month (June 2010), a 50 GB limit is
Supposed to be available. What happens if your database is larger
10 Gb today (or 50 GB tomorrow )? Options include repartitioning your
Database into multiple smaller databases or sharding (Microsoft's
Generally recommended approach). Without getting into the database
Details of both of these database design patterns, both of these
Approaches are not without issue and complexity, some of which must be
Resolved at the application level.

 
Data Access

 

Data in
The cloud, be it in SQL azure or azure table Storage, can be accessed
From in or out of the cloud. to access data in SQL Azure, all
Standard tools and APIs apply that work with SQL Server. Meaning, your
Existing. Net/SQL Server knowledge and experience can be heavily
Leveraged. Ado. NET and ODBC APIs can be used by application code
Access the SQL azure database. tools like SQL Server Management Studio
And Visual Studio can be pointed to the SQL azure instance and
Manipulate the schema and data just as you do today with SQL Server.

 

Access
To azure table storage is accomplished either via rest API or storage
Client library provided with the Windows azure SDK. Using the rest API
Allows client applications to communicate and use data from table
Storage without having detailed and specific knowledge of an azure API,
But it is more complex and difficult to work with. The storage Client
Library (which leverages LINQ to objects) provides a layer
Convenience but requires the application reference the storage Client
Library APIs. Rest and the storage client library incur a Learning
Curve that is typically not there when using SQL azure.

 
Portability

 

As
Mentioned, data in SQL azure and table storage can be accessed from
Applications in and out of the cloud. That means applications can be
Moved in or out of the cloud and still deal with the data in the cloud
In the same way. However, one question that may need to be considered
Is whetherDataMust always live in the cloud?
Applications generally view data in SQL azure similar enough to data in
Normal SQL Server database as to allow the data to migrate back and
Forth between the cloud and On-premise databases. In fact, there are
Even migration tools to help move data between instances of SQL Server
And SQL azure.

 

However, given the unique nature and access
APIS of table Storage, portability of the data is not as straight
Forward. Table Storage tightly couples your data to the cloud. Moving
The data out of the cloud wowould require an on-premise Data Storage
Alternative, a data migration strategy, and likely require application
Code changes.

 
Transactions and concurrency

 

SQL azure
Supports typical acid transactions for work within the same database.
Transactions guest SS databases are not supported. SQL azure allows
Typical optimistic and pessimistic concurrency strategies.

 

Table
Storage supports transactions for entities in the same table and table
Partition, but not between SS tables or partitions. Additionally, only 100
Operations or less (what is called a batch in azure table Storage) can
Be part of the transaction. Only one operation can be completed MED on each
Entity in the batch, and the batch must be limited to 4 MB. Table
Storage abides strictly by an optimistic concurrent strategy. If, on
Commit of the transaction, data has been changed by another process
Whole transaction must be rolled back and retried. Due to this single
Concurrency strategy, a built-in retry option is provided with
Storage client library.

 
Queries

 

Using table storage,
Queries are limited to 1000 entities by default. If more than 1000
Entities are found, a continuation token is returned and must be used
The application to retrieve the next set of entities. Queries that
Take longer than 5 seconds also return a continuation token. Queries
That take longer than 30 seconds are canceled. data in table Storage
Is organized by partition key and indexed by row key. Because there are
No custom indexes in tables, queries by partition key and row key are
Fast, but queries that do not use partition key and row key are slow.

 

Generally
Speaking, SQL azure has no limitations, issues or special programming
Requirements to work with large queries. Good database and index design
Can help improve performance of queries; especially large ones.

 
Column types

 

Columns in Table storage are limited to the types in the table below.










Byte []
Bool
Datetime
Double
Guid
Int32 or int
Int64 or long
String

 
Cost

 

Perhaps
The most unique aspect to designing and processing ting applications
The cloud is that it requires developers to think like businessmen.
Each technical choice often has direct costs associated with it when
Developing for the cloud. The choice in data storage can have a huge
Impact on the cost of running an application.

 

Azure table
Storage costs 15? Per GB of storage per month. Additionally, you pay 1
Cent per 10,000 transactions with table Storage. SQL azure costs are
$9.99 for 1 GB of storage per month ($99.99 for 10 Gb ).

 

See Microsoft's sight for more details and specifics on costs here.

 
Bottom Line

 

Chris hay and Brian prince in their forth coming bookAzure in action(Published by Manning-See here)
Provide a synopsis of the SQL azure vs. Table storage in a few
Paragraphs. "If size is the issue, that wocould be the first flag that
You might want to consider azure tables. As long as the support tables
Has for transactions and queries meets your needs. The size limit surely
Will, at 100 TB. "Further they suggest sophisticated transactions, or
Complex Authorization Model might require the services of SQL azure.
And as shown by the cost table above, "the final consideration is cost. I
Can store a lot of data in azure tables for a lot less money than I can
In SQL azure. SQL Azure is giving me a lot more features to use (joins,
Relationships, etc.), but it does cost more ."

 
Future

 

We
Are given every indication by Microsoft that SQL azure will have far
More capability in the future-akin to the SQL server you might find in
Your data centers today. So some of the comparison above may be moot
Or less important over time. additional functionality is also being
Proposed to table storage as well. For example, support of secondary
(Non-key) indexes is already been suggested for a future release (see here ).
However, key pair tural differences between SQL azure and table
Storage will remain and leave Application designers having to pick
Best option for their systems. Welcome to cloud computing. There is
Lot of ROI to be had by running in the cloud, but only with proper
Application design and architecture.

 

If Intertech can help you negotiate the issues of cloud computing, please contact ryan McCabe at ryan.mccabe@intertech.com.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.