Performing CRUD operations in Cassandra.

Cassandra API provides us the ability to store NoSQL data efficiently and easily in Cassandra. You need to create a new Cassandra database inside Cosmos DB to perform the CRUD operation.

  1. Log in to your Azure portal and click on the Azure Cosmos DB option on the left side of the options bar.
  2. Click on the + button and give your new database a proper ID, then choose the Cassandra option from the API dropdown.
  3. You can create a new resource or use the existing one. Select the location where most writing will happen and click on the Create button. You can refer to the screenshot for reference:
  1. Now, click on Data explorer |  New Table button and create a new table to store the data. Refer the screenshot below for the reference.
  1. Now, we can insert data using the standard SQL commands as shown below.
INSERT INTO uprofile.user
(first_name, last_name)
VALUES ('Shahid', 'Shaikh');
  1. You can read data from the Cassandra table using the SELECT query.
SELECT * from uprofile.user;

Similarly, UPDATE and DELETE commands can be used to update and delete the records from Cassandra table respectively.

This covers performing the CRUD operations using the various data models.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.221.182.150