NoSQL Databases
A table in a spreadsheet is good for a list of students. It is not the best tool for a family tree, a shopping cart that expires, or a map of roads. NoSQL databases are a group of tools for data that does not fit one neat table.
6 min read6 মিনিটে পড়া যায় · 8 sections8টি সেকশন · 10 sources10টি সোর্স · updated Oct 2026আপডেট: Oct 2026
In plain words
"NoSQL" is a loose name, not one product. Each database below describes itself in its own terms. For example, Cassandra calls itself a distributed NoSQL database Source 7সোর্স 7. In this page we sort four well-known products into four families by how they store data.
| Family | Example product | The unit of data |
|---|---|---|
| Document | MongoDB | A document |
| Key-value | Redis | A value found by its key |
| Wide-column | Apache Cassandra | A row found by a partition key |
| Graph | Neo4j | A node and the relationships between nodes |
The four families are the tutorial's own simplification. Real products can do more than one thing.
Document: MongoDB. MongoDB is a document database. Its data lives in documents that look like JSON and can change shape Source 1সোর্স 1. A document is a set of field and value pairs Source 2সোর্স 2. A value can be another document, an array, or an array of documents Source 1সোর্স 1. MongoDB keeps documents in collections, and a database holds one or more collections Source 3সোর্স 3. A collection is similar to a relational table, but it does not force a fixed schema on its documents Source 1সোর্স 1, so documents in one collection can have different shapes Source 1সোর্স 1.
Key-value: Redis. Each object in Redis is found by a unique string, its key. The object is the value, and the two together are a key-value pair Source 5সোর্স 5. Redis calls itself a data structure server, and its values can be strings, hashes, lists, sets, sorted sets, streams, and more Source 4সোর্স 4. A hash is a set of field-value pairs Source 4সোর্স 4.
Wide-column: Cassandra. Cassandra uses a partitioned wide-column storage model Source 7সোর্স 7. A keyspace holds the tables and sets how the data is replicated Source 7সোর্স 7. A row has a primary key made of a partition key and, optionally, clustering keys Source 7সোর্স 7.
Graph: Neo4j. In Neo4j the data is nodes, relationships, and properties, and there are no tables or documents Source 9সোর্স 9. A node is an entity. It can have labels and properties Source 9সোর্স 9. A relationship joins two nodes. It has a direction and exactly one type, and it can have properties too Source 9সোর্স 9.
সহজ English
NoSQL is a loose name, not one product. Each database below describes itself in its own terms. For example, Cassandra calls itself a distributed NoSQL database Source 7সোর্স 7. This page sorts four well-known products into four families by how they store data.
- Document: MongoDB. The unit of data is a document.
- Key-value: Redis. The unit of data is a value that you find by its key.
- Wide-column: Apache Cassandra. The unit of data is a row that you find by a partition key.
- Graph: Neo4j. The unit of data is a node and the relationships between nodes.
The four families are the tutorial's own simplification. Real products can do more than one thing.
MongoDB is a document database. Its data lives in documents that look like JSON and can change shape Source 1সোর্স 1. A document is a set of field and value pairs Source 2সোর্স 2. A value can be another document, an array, or an array of documents Source 1সোর্স 1. MongoDB keeps documents in collections, and a database holds one or more collections Source 3সোর্স 3. A collection is similar to a relational table, but it does not force a fixed schema on its documents Source 1সোর্স 1. So documents in one collection can have different shapes Source 1সোর্স 1.
In Redis, a unique string finds each object. The string is the key. The object is the value. The two together are a key-value pair Source 5সোর্স 5. Redis calls itself a data structure server. Its values can be strings, hashes, lists, sets, sorted sets, streams, and more Source 4সোর্স 4. A hash is a set of field-value pairs Source 4সোর্স 4.
Cassandra uses a partitioned wide-column storage model Source 7সোর্স 7. A keyspace holds the tables and sets how the data is replicated Source 7সোর্স 7. A row has a primary key. The primary key has a partition key and, optionally, clustering keys Source 7সোর্স 7.
In Neo4j the data is nodes, relationships, and properties. There are no tables or documents Source 9সোর্স 9. A node is an entity. It can have labels and properties Source 9সোর্স 9. A relationship joins two nodes. It has a direction and exactly one type, and it can have properties too Source 9সোর্স 9.
বাংলা ব্যাখ্যা
NoSQL একটি শিথিল নাম, কোনো একটি প্রোডাক্ট নয়। নিচের প্রতিটি ডেটাবেস নিজেকে নিজের ভাষায় বর্ণনা করে। উদাহরণ হিসেবে, Cassandra নিজেকে একটি ডিস্ট্রিবিউটেড (distributed) NoSQL ডেটাবেস বলে Source 7সোর্স 7। এই পাতা ডেটা কীভাবে সংরক্ষণ করা হয়, তা দেখে চারটি সুপরিচিত প্রোডাক্টকে চারটি পরিবারে ভাগ করে।
- ডকুমেন্ট (document): MongoDB। ডেটার একক হলো একটি ডকুমেন্ট।
- কী-ভ্যালু (key-value): Redis। ডেটার একক হলো একটি ভ্যালু, যা আপনি তার কী দিয়ে খুঁজে পান।
- ওয়াইড-কলাম (wide-column): Apache Cassandra। ডেটার একক হলো একটি রো, যা আপনি পার্টিশন কী (partition key) দিয়ে খুঁজে পান।
- গ্রাফ (graph): Neo4j। ডেটার একক হলো একটি নোড এবং নোডগুলোর মধ্যকার রিলেশনশিপ।
চারটি পরিবার টিউটোরিয়ালের নিজস্ব সরলীকরণ। বাস্তব প্রোডাক্ট একাধিক কাজ করতে পারে।
MongoDB একটি ডকুমেন্ট ডেটাবেস। তার ডেটা থাকে JSON-এর মতো দেখতে ডকুমেন্টে, যার আকার বদলাতে পারে Source 1সোর্স 1। একটি ডকুমেন্ট হলো ফিল্ড ও ভ্যালু জোড়ার একটি সেট Source 2সোর্স 2। একটি ভ্যালু আরেকটি ডকুমেন্ট, একটি অ্যারে, বা ডকুমেন্টের একটি অ্যারে হতে পারে Source 1সোর্স 1। MongoDB ডকুমেন্টগুলো কালেকশনে (collection) রাখে, আর একটি ডেটাবেসে এক বা একাধিক কালেকশন থাকে Source 3সোর্স 3। কালেকশন একটি রিলেশনাল টেবিলের মতো, কিন্তু সে তার ডকুমেন্টগুলোর উপর নির্দিষ্ট স্কিমা চাপিয়ে দেয় না Source 1সোর্স 1। তাই একই কালেকশনের ডকুমেন্টগুলোর আকার আলাদা হতে পারে Source 1সোর্স 1।
Redis-এ একটি ইউনিক স্ট্রিং প্রতিটি অবজেক্ট খুঁজে দেয়। স্ট্রিংটি হলো কী। অবজেক্টটি হলো ভ্যালু। দুটি মিলে একটি কী-ভ্যালু পেয়ার Source 5সোর্স 5। Redis নিজেকে একটি ডেটা স্ট্রাকচার সার্ভার (data structure server) বলে। তার ভ্যালু হতে পারে স্ট্রিং, হ্যাশ, লিস্ট, সেট, সর্টেড সেট, স্ট্রিম এবং আরও অনেক কিছু Source 4সোর্স 4। হ্যাশ হলো ফিল্ড-ভ্যালু জোড়ার একটি সেট Source 4সোর্স 4।
Cassandra একটি পার্টিশন করা ওয়াইড-কলাম স্টোরেজ মডেল ব্যবহার করে Source 7সোর্স 7। একটি কীস্পেস (keyspace) টেবিলগুলো রাখে এবং ডেটা কীভাবে রিপ্লিকেট হবে তা ঠিক করে Source 7সোর্স 7। একটি রো-র একটি প্রাইমারি কী থাকে। প্রাইমারি কী-তে একটি পার্টিশন কী থাকে এবং ঐচ্ছিকভাবে ক্লাস্টারিং কী (clustering key) থাকে Source 7সোর্স 7।
Neo4j-তে ডেটা হলো নোড, রিলেশনশিপ ও প্রপার্টি। কোনো টেবিল বা ডকুমেন্ট নেই Source 9সোর্স 9। নোড হলো একটি এনটিটি (entity)। তার লেবেল ও প্রপার্টি থাকতে পারে Source 9সোর্স 9। একটি রিলেশনশিপ দুটি নোডকে জোড়ে। তার একটি দিক এবং ঠিক একটি টাইপ থাকে, আর তারও প্রপার্টি থাকতে পারে Source 9সোর্স 9।
When you need it
Each vendor says what its design is for. These are the vendors' own statements, and not a ranking:
- MongoDB says its document model lets you shape data like the objects in your code. It also says embedded documents and arrays reduce the need for joins Source 1সোর্স 1.
- Redis lists caching, queuing, and event processing as example tasks Source 4সোর্স 4.
- Cassandra lists design goals such as scaling out on commodity hardware and queries driven by a partition key Source 7সোর্স 7.
- Neo4j says graphs fit questions about relationships, such as how to get from A to B, deep hierarchies, and hidden connections Source 9সোর্স 9.
সহজ English
Each vendor says what its design is for. These are statements of the vendors themselves. They are not a ranking.
- MongoDB says its document model lets you shape data like the objects in your code. It also says embedded documents and arrays reduce the need for joins Source 1সোর্স 1.
- Redis lists caching, queuing, and event processing as example tasks Source 4সোর্স 4.
- Cassandra lists design goals such as scaling out on commodity hardware and queries driven by a partition key Source 7সোর্স 7.
- Neo4j says graphs fit questions about relationships, such as how to get from A to B, deep hierarchies, and hidden connections Source 9সোর্স 9.
বাংলা ব্যাখ্যা
প্রতিটি ভেন্ডর বলে তার ডিজাইন কীসের জন্য। এগুলো ভেন্ডরদের নিজস্ব বক্তব্য, কোনো র্যাঙ্কিং নয়।
- MongoDB বলে, তার ডকুমেন্ট মডেল আপনার কোডের অবজেক্টের মতো করে ডেটা গড়তে দেয়। সে এটিও বলে, এমবেডেড ডকুমেন্ট ও অ্যারে জয়েনের প্রয়োজন কমায় Source 1সোর্স 1।
- Redis উদাহরণ হিসেবে ক্যাশিং, কিউইং (queuing) এবং ইভেন্ট প্রসেসিংয়ের কথা বলে Source 4সোর্স 4।
- Cassandra তার ডিজাইনের লক্ষ্য হিসেবে বলে, যেমন সাধারণ হার্ডওয়্যারে (commodity hardware) স্কেল আউট করা এবং পার্টিশন কী চালিত কোয়েরি Source 7সোর্স 7।
- Neo4j বলে, গ্রাফ সম্পর্ক নিয়ে প্রশ্নের জন্য মানানসই, যেমন A থেকে B-তে কীভাবে যাবেন, গভীর হায়ারার্কি, এবং লুকানো সংযোগ Source 9সোর্স 9।
How it works
Three details show how different the families are.
Redis keys. A common habit is to put a colon in the name, as in person:1 Source 5সোর্স 5. A key can have an expiration, and then Redis destroys it Source 5সোর্স 5. The EXPIRE command sets the time, and the TTL command shows the time left Source 5সোর্স 5. Redis calls itself an in-memory data structure store Source 10সোর্স 10, and it also has persistence options that write data to durable storage, such as RDB snapshots and an AOF log of writes Source 6সোর্স 6.
Cassandra keys. The partition key tells the cluster which node stores the row Source 7সোর্স 7. The overview says queries that perform well give the partition key Source 7সোর্স 7. The columns after the partition key are clustering columns, and their order sets the clustering order Source 8সোর্স 8.
MongoDB documents. MongoDB stores documents as BSON, a binary form of JSON with more data types Source 2সোর্স 2.
সহজ English
Three details show how different the families are.
Redis keys. A common habit is to put a colon in the name, as in person:1 Source 5সোর্স 5. A key can have an expiration, and then Redis destroys it Source 5সোর্স 5. The EXPIRE command sets the time, and the TTL command shows the time left Source 5সোর্স 5. Redis calls itself an in-memory data structure store Source 10সোর্স 10. It also has persistence options that write data to durable storage, such as RDB snapshots and an AOF log of writes Source 6সোর্স 6.
Cassandra keys. The partition key tells the cluster which node stores the row Source 7সোর্স 7. The overview says queries that perform well give the partition key Source 7সোর্স 7. The columns after the partition key are clustering columns, and their order sets the clustering order Source 8সোর্স 8.
MongoDB documents. MongoDB stores documents as BSON, a binary form of JSON with more data types Source 2সোর্স 2.
বাংলা ব্যাখ্যা
তিনটি বিবরণ দেখায় পরিবারগুলো কতটা আলাদা।
Redis কী। নামে একটি কোলন (colon) দেওয়া একটি প্রচলিত অভ্যাস, যেমন person:1 Source 5সোর্স 5। একটি কী-র মেয়াদ (expiration) থাকতে পারে, আর তখন Redis সেটি নষ্ট করে দেয় Source 5সোর্স 5। EXPIRE কমান্ড সময় ঠিক করে, আর TTL কমান্ড বাকি সময় দেখায় Source 5সোর্স 5। Redis নিজেকে একটি ইন-মেমোরি ডেটা স্ট্রাকচার স্টোর (in-memory data structure store) বলে Source 10সোর্স 10। তার পারসিস্টেন্সের (persistence) অপশনও আছে, যা ডেটা স্থায়ী স্টোরেজে লেখে, যেমন RDB স্ন্যাপশট এবং রাইটের একটি AOF লগ Source 6সোর্স 6।
Cassandra কী। পার্টিশন কী ক্লাস্টারকে বলে কোন নোড রো-টি সংরক্ষণ করে Source 7সোর্স 7। Overview বলে, যেসব কোয়েরি ভালো কাজ করে সেগুলো পার্টিশন কী দেয় Source 7সোর্স 7। পার্টিশন কী-র পরের কলামগুলো ক্লাস্টারিং কলাম, আর তাদের ক্রম ক্লাস্টারিং অর্ডার ঠিক করে Source 8সোর্স 8।
MongoDB ডকুমেন্ট। MongoDB ডকুমেন্টগুলো BSON হিসেবে সংরক্ষণ করে। BSON হলো JSON-এর একটি বাইনারি রূপ, যাতে আরও ডেটা টাইপ আছে Source 2সোর্স 2।
Trade-offs
Do not read "NoSQL" as "better" or "faster". The docs show choices, and each choice has a cost:
- Cassandra says it chooses not to support cross-partition transactions, distributed joins, and foreign keys. The reason it gives is that such operations need coordination across partitions, which is typically slow and hard to keep highly available Source 7সোর্স 7.
- MongoDB does support multi-document transactions Source 1সোর্স 1, so "NoSQL has no transactions" is not a rule.
- Neo4j says graph databases do not use JOINs, because relationships are stored with the data Source 9সোর্স 9. In the tutorial's own words, this is a design choice that suits data with many relationships.
A better question than "SQL or NoSQL" is "what does my data look like, and what do my queries need?"
সহজ English
Do not read "NoSQL" as "better" or "faster". The docs show choices, and each choice has a cost.
- Cassandra says it chooses not to support cross-partition transactions, distributed joins, and foreign keys. The reason it gives is that such operations need coordination across partitions. This is typically slow and hard to keep highly available Source 7সোর্স 7.
- MongoDB does support multi-document transactions Source 1সোর্স 1. So "NoSQL has no transactions" is not a rule.
- Neo4j says graph databases do not use JOINs, because relationships are stored with the data Source 9সোর্স 9. In the tutorial's own words, this is a design choice that suits data with many relationships.
A better question than "SQL or NoSQL" is "what does my data look like, and what do my queries need?"
বাংলা ব্যাখ্যা
"NoSQL"-কে "ভালো" বা "দ্রুত" বলে পড়বেন না। ডকুমেন্টেশন কিছু পছন্দ দেখায়, আর প্রতিটি পছন্দের একটি খরচ আছে।
- Cassandra বলে, সে ক্রস-পার্টিশন ট্রানজেকশন (cross-partition transaction), ডিস্ট্রিবিউটেড জয়েন এবং ফরেন কী সমর্থন না করার সিদ্ধান্ত নিয়েছে। সে কারণ দেয়, এসব কাজে পার্টিশনগুলোর মধ্যে সমন্বয় লাগে। এটি সাধারণত ধীর এবং হাই অ্যাভেইলেবিলিটি বজায় রাখা কঠিন Source 7সোর্স 7।
- MongoDB মাল্টি-ডকুমেন্ট ট্রানজেকশন সমর্থন করে Source 1সোর্স 1। তাই "NoSQL-এ ট্রানজেকশন নেই" কোনো নিয়ম নয়।
- Neo4j বলে, গ্রাফ ডেটাবেস JOIN ব্যবহার করে না, কারণ রিলেশনশিপ ডেটার সাথেই সংরক্ষিত থাকে Source 9সোর্স 9। টিউটোরিয়ালের নিজস্ব ভাষায়, এটি একটি ডিজাইনের সিদ্ধান্ত, যা অনেক রিলেশনশিপ আছে এমন ডেটার জন্য মানানসই।
"SQL নাকি NoSQL"-এর চেয়ে ভালো প্রশ্ন হলো "আমার ডেটা দেখতে কেমন, আর আমার কোয়েরির কী দরকার?"
A real-life example
A learning platform stores four kinds of data. This sorting is the tutorial's own example.
- Course content with different fields (a video lesson has a length, a quiz has questions): a document database lets each lesson have its own fields.
- A login session that ends after 30 minutes: a key-value store with a key expiration fits.
- Millions of "student finished lesson" events, read by student: a wide-column table with the student as the partition key fits that read.
- "Which students know someone who also took this course?": a graph fits questions about connections.
The example shows the shape of each tool, not a rule.
সহজ English
A learning platform stores four kinds of data. This sorting is the tutorial's own example.
- Course content with different fields (a video lesson has a length, a quiz has questions): a document database lets each lesson have its own fields.
- A login session that ends after 30 minutes: a key-value store with a key expiration fits.
- Millions of "student finished lesson" events, read by student: a wide-column table with the student as the partition key fits that read.
- "Which students know someone who also took this course?": a graph fits questions about connections.
The example shows the shape of each tool, not a rule.
বাংলা ব্যাখ্যা
একটি লার্নিং প্ল্যাটফর্ম চার ধরনের ডেটা সংরক্ষণ করে। এই ভাগ করাটি টিউটোরিয়ালের নিজস্ব উদাহরণ।
- আলাদা আলাদা ফিল্ডসহ কোর্সের কনটেন্ট (একটি ভিডিও লেসনের দৈর্ঘ্য আছে, একটি কুইজের প্রশ্ন আছে): একটি ডকুমেন্ট ডেটাবেস প্রতিটি লেসনকে তার নিজের ফিল্ড রাখতে দেয়।
- 30 মিনিট পরে শেষ হওয়া একটি লগইন সেশন: কী-র মেয়াদসহ একটি কী-ভ্যালু স্টোর মানানসই।
- কয়েক মিলিয়ন "শিক্ষার্থী লেসন শেষ করেছে" ইভেন্ট, শিক্ষার্থী অনুযায়ী পড়া হয়: শিক্ষার্থীকে পার্টিশন কী করে একটি ওয়াইড-কলাম টেবিল সেই রিডের জন্য মানানসই।
- "কোন শিক্ষার্থীরা এমন কাউকে চেনে, যে-ও এই কোর্স নিয়েছে?": সংযোগ নিয়ে প্রশ্নের জন্য একটি গ্রাফ মানানসই।
উদাহরণটি প্রতিটি টুলের আকার দেখায়, কোনো নিয়ম নয়।
Common mistakes
- Saying "NoSQL scales better". The sources give scaling as a design goal of some products. They do not say it holds for every product or every workload Source 7সোর্স 7.
- Thinking "no schema" means "no rules". A collection does not enforce a rigid schema Source 1সোর্স 1, but your app still expects certain fields.
- Expecting distributed joins and foreign keys everywhere. Cassandra does not support them Source 7সোর্স 7.
- Treating Redis keys like folders. Redis has no namespaces, so you must avoid name collisions Source 5সোর্স 5.
সহজ English
- Do not say "NoSQL scales better". The sources give scaling as a design goal of some products. They do not say it holds for every product or every workload Source 7সোর্স 7.
- Do not think "no schema" means "no rules". A collection does not enforce a rigid schema Source 1সোর্স 1, but your app still expects certain fields.
- Do not expect distributed joins and foreign keys everywhere. Cassandra does not support them Source 7সোর্স 7.
- Do not treat Redis keys like folders. Redis has no namespaces, so you must avoid name collisions Source 5সোর্স 5.
বাংলা ব্যাখ্যা
- "NoSQL ভালো স্কেল করে" বলবেন না। সোর্সগুলো স্কেলিংকে কিছু প্রোডাক্টের ডিজাইনের লক্ষ্য হিসেবে দেয়। তারা বলে না যে এটি প্রতিটি প্রোডাক্ট বা প্রতিটি ওয়ার্কলোডে খাটে Source 7সোর্স 7।
- "স্কিমা নেই" মানে "কোনো নিয়ম নেই" ভাববেন না। একটি কালেকশন কঠোর স্কিমা চাপিয়ে দেয় না Source 1সোর্স 1, কিন্তু আপনার অ্যাপ তবুও নির্দিষ্ট কিছু ফিল্ড আশা করে।
- সব জায়গায় ডিস্ট্রিবিউটেড জয়েন ও ফরেন কী আশা করবেন না। Cassandra সেগুলো সমর্থন করে না Source 7সোর্স 7।
- Redis কী-কে ফোল্ডারের মতো ভাববেন না। Redis-এর কোনো নেমস্পেস (namespace) নেই, তাই আপনাকে নামের সংঘর্ষ এড়াতে হবে Source 5সোর্স 5।
What a tester can check
Tutorial advice
These test ideas are the tutorial's own advice.
- Odd documents. Save documents with a missing field, an extra field, or a wrong type. Does the app cope when it reads them back?
- Expiry. For a cached or session key, test the moment just before and just after it expires.
- Query shape. For a wide-column table, test the queries the app really runs. Check that each one gives the partition key.
- Restart. For in-memory data, ask what is kept after a restart, and test it.
সহজ English
These test ideas are the tutorial's own advice.
- Odd documents. Save documents with a missing field, an extra field, or a wrong type. Does the app cope when it reads them back?
- Expiry. For a cached or session key, test the moment just before and just after it expires.
- Query shape. For a wide-column table, test the queries the app really runs. Check that each one gives the partition key.
- Restart. For in-memory data, ask what is kept after a restart, and test it.
বাংলা ব্যাখ্যা
এই টেস্টের ধারণাগুলো টিউটোরিয়ালের নিজস্ব পরামর্শ।
- অদ্ভুত ডকুমেন্ট। একটি ফিল্ড নেই, একটি বাড়তি ফিল্ড আছে, বা টাইপ ভুল, এমন ডকুমেন্ট সংরক্ষণ করুন। অ্যাপ সেগুলো ফের পড়লে কি সামলাতে পারে?
- মেয়াদ শেষ (expiry)। একটি ক্যাশ করা বা সেশনের কী-র জন্য মেয়াদ শেষ হওয়ার ঠিক আগের ও ঠিক পরের মুহূর্ত টেস্ট করুন।
- কোয়েরির আকার। একটি ওয়াইড-কলাম টেবিলের জন্য অ্যাপ আসলে যে কোয়েরি চালায়, সেগুলো টেস্ট করুন। প্রতিটি কোয়েরি পার্টিশন কী দেয় কি না যাচাই করুন।
- রিস্টার্ট (restart)। ইন-মেমোরি ডেটার জন্য জিজ্ঞাসা করুন রিস্টার্টের পরে কী থাকে, এবং তা টেস্ট করুন।
Key words
| Word | Meaning |
|---|---|
| NoSQL | A loose label. Cassandra's docs use it for itself Source 7সোর্স 7 |
| Document | A set of field and value pairs, stored in MongoDB Source 2সোর্স 2 |
| Collection | A group of documents in MongoDB Source 3সোর্স 3 |
| Key-value pair | A unique key and the data object it points to Source 5সোর্স 5 |
| Partition key | The part of a Cassandra primary key that finds the node that stores the row Source 7সোর্স 7 |
| Wide-column | The storage model of Cassandra: partitioned tables of rows and columns Source 7সোর্স 7 |
| Node | An entity in a graph database Source 9সোর্স 9 |
| Relationship | A named, directed connection between two nodes Source 9সোর্স 9 |