Azure Table Storage
The Azure Table storage service stores large amounts of structured data.In other word we can say that it is also used to store non-relational structured data.
Common uses of the Table service include the following:
1.TBs of structured data capable of serving web scale applications.
2.Datasets in the table storage doesn't require complex joins, foreign keys, or stored procedures and it can be easily denormalized for fast access.
3.Clustered index data can be quickly queryed.
4.Data acess can be done using OData protocol and LINQ queries with WCF Data Service .NET Libraries.
Data in the azure table storage is stored as entities.Let us have a look on these codes.
Storing An Entity In An Azure Table
The stuff that is stored inside an Azure table is called Entities.This entity is analogous to a row in SQL Server table.Every entity that is stored inside Azure table has 3 main properties: ParitionKey, RowKey and Timestamp. The first 2 properties must be assigned values by the application code and form the primary key of the table.
The below code will give us an idea of how entities are stored to the table.
Retrieving An Entity From A Table
Let's now retrieve the entity that is just stored in the table. Add the following method after the main() method inside your program.cs file. Once it is added, then invoke the method from main() to see if the employee (here we are using the employee table) we added to the table can be retrieved or not. Now we can have a look on the code.
Azure Table Storage On Local Machine
The following steps introduces how to simulate azure table storage in the local machine.
We need to run a program called DSInit to setup SQL Server or LocalDB as the table storage.When we run the program, it creates a database in the specified SQL Server instance with quite a few tables.
To run the program, run Windows Azure command prompt from the Windows Azure start menu as an administrator.Type the following command.
DSInit /sqlInstance: (sql server instancename)
The next step is to start the storage emulator from the Start menu.Now we need to change the connection string to point to your local Azure table storage setup.Then we can use the azure table storage in our local machine.