Skip to main content

Posts

Showing posts with the label No SQL

No sql Imps

  2-Mark Questions (NoSQL) What is meant by a NoSQL database? Why did NoSQL databases emerge? Define persistent data in database systems. What is concurrency in databases? Explain impedance mismatch. What is meant by cluster computing? State any two reasons for the popularity of NoSQL databases. Define a relational database. Mention two limitations of traditional RDBMS. How does NoSQL differ from RDBMS? What is a key–value data model? Define a document-oriented database. What is a column-family data model? What is an aggregate-oriented database? What is replication in NoSQL databases? Define sharding. What is horizontal scalability? What is a distribution model in NoSQL? What is master–slave replication? What is peer-to-peer replication? What is MongoDB? What is a document in MongoDB? Define a collection in MongoDB. What is BSON? What is CRUD operation in MongoDB? What is eventual consistency? What is ...

NoSQL tools and programming languages

  Graph Data Model and Applications 1. Graph Data Model Meaning The graph data model represents data in the form of a graph , consisting of: Nodes Relationships (Edges) Properties It is designed to efficiently manage highly connected data . 2. Components of Graph Data Model 1. Nodes Represent entities Examples: Person, Product, City 2. Relationships (Edges) Represent connections between nodes Always have a direction Have a type Examples: FRIEND_OF PURCHASED LOCATED_IN 3. Properties Key–value pairs attached to nodes or relationships Store additional information Example (User)- [FRIEND_OF] ->(User) (User)- [BOUGHT] ->(Product) 3. Features of Graph Data Model Relationship-centric No joins required Schema flexible Fast traversal queries 4. Applications of Graph Data Model 1. Social Networks Users as nodes Friendships as relationships Examples: Facebook, LinkedIn 2. Recommendation S...

Graph data model and applications

  Graph Data Model and Applications 1. Graph Data Model Meaning The graph data model represents data in the form of a graph , consisting of: Nodes Relationships (Edges) Properties It is designed to efficiently manage highly connected data . 2. Components of Graph Data Model 1. Nodes Represent entities Examples: Person, Product, City 2. Relationships (Edges) Represent connections between nodes Always have a direction Have a type Examples: FRIEND_OF PURCHASED LOCATED_IN 3. Properties Key–value pairs attached to nodes or relationships Store additional information Example (User)- [FRIEND_OF] ->(User) (User)- [BOUGHT] ->(Product) 3. Features of Graph Data Model Relationship-centric No joins required Schema flexible Fast traversal queries 4. Applications of Graph Data Model 1. Social Networks Users as nodes Friendships as relationships Examples: Facebook, LinkedIn 2. Recommendation S...

Graph databases and Neo4j

  Graph Databases and Neo4j 1. Graph Databases Meaning A graph database stores data in the form of a graph , consisting of: Nodes – Entities (people, products, places) Relationships (Edges) – Connections between nodes Properties – Data stored on nodes and relationships Key Characteristics Focus on relationships Fast traversal between connected data Schema flexible No joins required Examples Neo4j Amazon Neptune OrientDB 2. Graph Data Model Components Node : Represents an object (User, Product) Relationship : Represents connection (FRIENDS_WITH, BOUGHT) Property : Key–value pairs Example (User)- [FRIENDS_WITH] ->(User) (User)- [BOUGHT] ->(Product) 3. Neo4j – Introduction Neo4j is a popular graph-based NoSQL database designed to manage highly connected data efficiently. 4. Features of Neo4j 1. Relationship-Focused Storage Relationships are stored directly Faster queries on connected data 2. ACID ...

Use cases (sessions, user profiles, carts)

  Use Cases of Key–Value Databases (Riak) Sessions, User Profiles, Shopping Carts Key–Value databases like Riak are best suited for applications that need fast access, high availability, and scalability . 1. Session Management Meaning Session data stores temporary user information during a login session. Why Riak is Suitable Very fast read/write operations Supports TTL (expiring data) High availability Example Session_ID → User login details Benefits Quick session retrieval Automatic session expiry Fault tolerant 2. User Profiles Meaning User profile data includes: Name Preferences Settings Why Riak is Suitable Flexible schema Easy updates Scales for millions of users Example User_ID → { name , email, preferences} Benefits Fast access to profile data Highly scalable Always available 3. Shopping Cart Data Meaning Shopping cart stores: Selected products Quantity Price details Why Riak ...

Consistency and scaling

  Consistency and Scaling in Riak 1. Consistency in Riak Meaning Consistency means all users see the same data at the same time after an update. Riak follows eventual consistency by default. Eventual Consistency Data updates are propagated to replicas gradually Temporary differences may exist System becomes consistent over time Tunable Consistency in Riak Riak allows applications to control consistency levels using: R (Read quorum) W (Write quorum) N (Replication factor) Rule: R + W > N → Strong consistency Advantages Flexible balance between consistency and availability Better performance 2. Scaling in Riak Horizontal Scaling Riak supports scale-out architecture New nodes can be added easily No downtime during scaling How Riak Scales Uses peer-to-peer architecture Data distributed using consistent hashing Load automatically balanced Elastic Scaling Nodes can be added or removed dynamically Dat...

Data structure and features

  Key–Value Databases (Riak): Data Structure and Features 1. Data Structure in Key–Value Databases Basic Structure Key–Value databases store data in the form: Key → Value Key : Unique identifier Value : Actual data (string, JSON, binary object, etc.) Example "user_101" → { name : "Rahul", age: 25 , city: "Pune" } Data Structure in Riak Riak stores data as objects . Each Riak object consists of: Key – Unique ID Value – Data content Bucket – Logical group of keys Metadata – Information about the object Buckets in Riak Similar to a collection Groups related key–value pairs 2. Features of Riak 1. Simple Key–Value Model Easy to understand and use Fast read and write operations 2. High Availability No master node Data replicated across multiple nodes System remains available even if a node fails 3. Eventual Consistency Data may not be immediately consistent Consistency is achieve...

Key–Value Databases and Riak

  Key–Value and Graph Databases Key–Value Databases and Riak 1. Key–Value Databases Meaning A key–value database stores data as a pair of key and value . Key → Unique identifier Value → Actual data (string, JSON, object, etc.) Characteristics Simple data model Very fast data access Highly scalable No complex queries Examples Riak Redis Amazon DynamoDB Advantages High performance Easy to scale Suitable for distributed systems Limitations No joins Limited querying Not suitable for complex relationships 2. Riak – Key–Value Database Introduction Riak is a distributed, highly available key–value NoSQL database designed for fault tolerance and scalability . Key Features of Riak 1. Simple Key–Value Storage Data stored as key–value pairs Easy read/write operations 2. High Availability No single point of failure Uses replication across nodes 3. Eventual Consistency Data may be temporarily in...

Use cases (logging, counters, expiring data)

  se Cases of NoSQL (Logging, Counters, Expiring Data) NoSQL databases like Apache Cassandra and HBase are well suited for applications that require high write speed, scalability, and availability . 1. Logging Meaning Logging refers to storing: System logs Application logs Event logs Why NoSQL is Suitable Handles huge volumes of log data Very high write throughput Distributed storage How Cassandra Helps Fast sequential writes Data stored across multiple nodes Fault tolerant Examples Server access logs Error logs Clickstream logs 2. Counters Meaning Counters are used to count occurrences of events . Why NoSQL is Suitable Supports frequent updates Handles concurrent increments High performance Counters in Cassandra Special column type called Counter Used for increment/decrement operations Examples Page views Likes and shares Number of downloads 3. Expiring Data (TTL – Time To Live) Mea...