Difference between Relational and NoSQL Database

Relational vs NoSQL Database: NoSQL Database Relational Database A very simple query language. A powerful query language. No fixed schema. A fixed schema. Only eventually consistent. Follows acid properties, i.e, Atomicity, Consistency, Isolation, and Durability. Support only simple transactions. Also supports complex transactions with joins. Used to handle high-velocity incoming data. Used to handle low-velocity … Read more

Cassandra Architecture

Cassandra can handle big data workloads with data being distributed among all the nodes in a cluster. These workloads can be handled across multiple nodes with a peer-to-peer distributed system across its nodes. Cassandra does not allow even a single point of failure. Each node in Cassandra performs the same functions and is interconnected to … Read more

Features of Cassandra

Cassandra Features: The popularity of Cassandra is because of its unique features. These are: Highly Scalable: Cassandra is highly scalable. High scalability allows the addition of additional hardware on requirement to attach additional customers and additional data. Rigid Architecture: Cassandra has a rigid architecture. Without a single point of failure Cassandra facilitates continuous availability for … Read more

PouchDB Replication

To make a copy of a database, the feature of Replication of PouchDB serves the best. It works both for a locally stored PouchDB instance or a remotely stored CouchDB instance. Syntax: PouchDB.replicate(source, target, [options]) Replicating PouchDB (Local) to CouchDB: The documents doc1, doc2, and doc3 are present in the ‘Example_Database’ database in PouchDB. The … Read more

Delete Attachment in PouchDB

PouchDB Delete Attachment To delete an attachment from PouchDB, the removeAttachment() method is used. Syntax: db.removeAttachment ( doc_Id, attachment_Id, rev, [callback] ); Example: Create a file named “DeleteAttach.js” within a folder named “Examples”. Add the below code to the file. DeleteAttach.js: var PouchDB = require(’PouchDB’); var db = new PouchDB(’Example_Database’); db.removeAttachment(’101′, ‘attach_1.txt’, ‘1-f56789f432154adb782da98358921a14’, function(err, res) … Read more

Retrieve Attachment in PouchDB

PouchDB Retrieve Attachment To retrieve an attachment from PouchDB the getAttachment() method is used. It returns blob or the buffer objects. Syntax: db.getAttachment( docId, attachmentId, [callback] ); Example: Create a file named “RetrieveAttach.js” within a folder named “Examples”. Add the below code to the file. RetrieveAttach.js: var PouchDB = require(’PouchDB’); var db = new PouchDB(’Example_Database’); … Read more

Add Attachment in PouchDB

PouchDB Add Attachment To add a binary object to a PouchDB document, the putAttachment() method is used. Blob or buffer object also plays a vital role in this process. While working with browser Blob is preferred and while working with Node.js, a buffer object is preferred. Syntax: db.putAttachment( doc_Id, attachment_Id, attachment, type, callback );db.putAttachment( doc_Id, … Read more

Delete Batch in PouchDB

PouchDB Delete Batch To delete a PouchDB batch, the bulkDocs() method is used. Example: Retrieve the values of a bulk document. Output: [ {  id: ‘101’, key: ‘101’, value: { rev: ‘1-f56789f432154adb782da98358921a14’ }, doc: { name: ‘Tom’, salary: 25000, experience: 3, _id: ‘101’, _rev: ‘1-f56789f432154adb782da98358921a14’ } }, { id: ‘102’, key: ‘102’, value: { rev: … Read more

Update Batch in PouchDB

PouchDB Update Batch To update a batch in PouchDB, the bulkDocs() method is used. Example: Retrieve the values of a bulk document. Output: [ {  id: ‘101’, key: ‘101’, value: { rev: ‘1-f56789f432154adb782da98358921a14’ }, doc: { name: ‘Tom’, salary: 25000, experience: 3, _id: ‘101’, _rev: ‘1-f56789f432154adb782da98358921a14’ } }, { id: ‘102’, key: ‘102’, value: { … Read more

Read Batch in PouchDB

PouchDB Read Batch To retrieve a PouchDB batch, the allDocs() method is used. Syntax: db.allDocs() Example: Create a file named “ReadBatch.js” within a folder named “Examples”. Add the below code to the file. ReadBatch.js: var PouchDB = require(’PouchDB’); var db = new PouchDB(’Example_Database’); db.allDocs(function(err, docs) { if (err) { return console.log(err); } else { console.log … Read more