Showing posts with label Express.js. Show all posts
Showing posts with label Express.js. Show all posts

Accessing Azure Table Storage in Node.js Applications

Microsoft Azure Storage services provides features of storing NoSQL data in the Table Storage. The Azure Table Storage stores schema-less data using Key/Value pairs. Since the data store is schema-less, we can use Table Storage to store the data for those applications that are designed and targeted to flexible data capture. Although the data is stored as schema-less, it is easy to query the data using simple querying mechanism.

You can consider using Table storage where you need not to use complex joins, stored procedures for any data operations. 

Table Storage and Creating Resource Group and Storage Account


Following are some of the features of Azure Table Storage
  • Table is a collection of entities. These entities does not enforce any schema. This provides a flexibility to store data for different set of properties for entities.
  • Entity is a set of properties. Conceptually we can map an entity with a table row on relational database. The max size of entity in Table is 1 MB.
  • Property is a name/value pair. We can have max 252 user defined properties in entity and along with these there are 3 system properties present in entity. These properties are RowKey, PartitionKey and Timestamp.
  • PartitionKey, this is the key based on which the data in the Table Storage is stored in logical partition. This provides query optimization while retrieving data from table storage.
  • RowKey, is the unique identification of the entity in the table storage.        
To use Azure Storage, we need a Microsoft Azure Subscription. Please visit this link to create a free subscription. Make sure that you read all features and limits of using Azure Free Subscription. Once you have a subscription, login to the portal and you can start using its features.

Accessing Azure CosmosDB database using Node.js and Express REST APIs

Last week, I was conducting a session on MEAN Stack. In this training, I taught my students how to access MongoDB in an Express application.

One of the attendees asked me to create a demo on accessing CosmosDB using Node.js apps.

In this tutorial, I will show you the steps to do the same.

CosmosDB is a multi-model, globally distributed database service on Microsoft Azure. It provides NoSQL data storage using Table Storage, SQL API, MongoDB, Gremlin, etc. More information on this can be read here https://docs.microsoft.com/en-us/azure/cosmos-db/introduction. I have also written a post on using Azure CosmosDB with ASP.NET Core and Angular. You can read about it over here https://www.dotnetcurry.com/windows-azure/1395/cosmosdb-webapi-angular-client.

In modern web application development  based on Isomorphic apps (pure JavaScript from Client-to-server e.g. MEAN/MERN Stack), the data storage is preferred as NoSQL data store. On  top of that, if this data store is provided and managed by and on cloud, then such storage services are highly preferred.