Hello and welcome to this tutorial series of Azure Data Services. Through the course of this tutorial, I will take you through what Azure has to offer in Data Services. I will start with the basics of relational databases, dig into the goodness of non-relational offerings and end with what is new and what is exciting in Azure Data Services
Azure Table Storage is a non-relational NoSQL data store that allows for flexible datasets that are not constrained by schemas or models. It is built for massive scale. The data sets are split in partitions which supports load balancing across different nodes. The data is easily and very efficiently accessed using the combination of a partition and the row key, which allows a very fast lookup.
So lets just dig into terminology. Again, this falls under Storage Containers. So we have storage containers having one or more tables. Tables have one or more entities. Here entity can be thought of as rows. Each row can have different number of columns which resonates with the fact that this store has no fixed pre defined schema or template. These entities are partitioned across different partitions which are spread across multiple nodes using the partition key. Each entity is identified by the combination of the partition and the row keys, the composite key.
There are several ways we can access or query the data on these tables. This primarily uses a combination of Partition Key and Row Key as the index. SDKs for Storage Access across various languages such as .NET, Node, Java, PHP, Ruby and Python are provided. In general, the standard CRUD (Create, Read, Update and Delete) transactions are supported. It is also important to understand that like a Dictionary, each entity acts like a key-value pair. This implies that when a new entity is added, a new key is added. Likewise, if we re-use an existing key, the entity is replaced with the new property.
The HTTP queries can be queried using an HTTP endpoint and ODATA protocol (REST).
So now let us look at how we access tables through Visual Studio:
Step 1: We need to install and add the references for Azure
Step 2: Lets get started with creating a Development Storage Account, which implies that here we are using the Azure Storage Development platform rather than the actual storage account in Azure.
Step 3: Create another class which will define the structure of the data model. This defines the structure of the data to give some idea of the kind of data that we ll be entering in our application.
Step 4: Back to our initial class, let us add some data to our table. Note, in the third entity I have not added one column property and that is completely fine.
Step 5: Lets conduct our insert operation on this set of data. There are 2 methods of doing this as shown. One using single Execute operation or the other using BatchExecute operation.
Step 6: Now, before we run the code, let us look into the Server Explorer to see if the table exists and you will find that there are no tables currently.
Step 7: Lets execute the program and then we will see that a table has been created:
That's it! It is as simple as that to use Azure Table Storage. We started by talking about its advantages in terms of scalability and high performance indexing. We then dived into the access and operations of the data store. In the next section, I will be discussing Storage Queues and how it acts like an effective messaging system. I will also cover certain elements of the Service Bus which has a similar function but different use case. Stay tuned and hit me @AdarshaDatta with your experience on Azure.