Document-oriented database
Adapted from Wikipedia · Discoverer experience
A document-oriented database, or document store, is a computer program and data storage system designed for storing, retrieving, and managing document-oriented information, also known as semi-structured data. These databases are one of the main categories of NoSQL databases, and their popularity has grown along with the use of NoSQL technologies.
Document-oriented databases are conceptually an extension of the key–value store, another type of NoSQL database. While key-value stores treat data as simple pairs, document-oriented systems look inside the documents to find useful information, called metadata, which helps make storing and searching data more efficient.
Unlike traditional relational databases (RDBs), which store data in separate tables, document databases keep all information about an object in one place. Each document can have its own unique structure, which makes it easier to work with modern programming techniques without needing extra steps to organize the data.
Documents
The main idea behind a document-oriented database is the document. These databases treat documents as complete units that hold data in a standard format, such as XML, YAML, JSON, or binary forms like BSON.
Documents are like objects in programming. They don’t need to follow the same structure, and each one can have different pieces of information. For example, one document might have a person’s name and address, while another might also include their phone numbers and hobbies. This flexibility means you can add new details to some documents without changing others.
Document databases let you add, find, change, or remove documents, known as Create, Read, Update, and Delete (CRUD). Each document has a special identifier that helps you find it quickly. You can also search for documents based on what they contain, not just their identifier. This makes it easier to find specific information, like all phone numbers with “555” in them, without getting mixed up with similar-looking postal codes.
Documents can be organized in different ways, such as in groups called collections, with tags, or in folder-like structures. These methods help keep documents organized, whether they’re stored on a computer’s hard drive or in memory.
Relationship to other databases
A document-oriented database is a special type of key-value store, which is a kind of NoSQL database. In a simple key-value store, the data is kept without much organization. But a document-oriented database lets users search and change the data based on what’s inside each document. For people who don’t need advanced searching, the difference between the two might not matter much.
Some search tools like Apache Solr and Elasticsearch can also store documents and do basic tasks with them, even though they were made for searching mainly.
In a relational database, data is kept in tables with rows and columns, all following the same setup. But in a document-oriented database, all the information about one thing is kept together in a single document. For example, in an address book, a person’s name, picture, and contact details can all be in one document. This makes it easier to get all the information at once, without joining many tables together.
Unlike relational databases, document-oriented databases don’t need a fixed setup. New information can be added to documents without changing older ones. They also let administrators give hints to help find certain types of information, similar to indexes in relational databases. This makes it easier to get related data, like all entries in an address book, without needing to organize them into tables.
Implementations
Main category: Document-oriented databases
XML database implementations
Further information: XML database
Many XML databases are types of document-oriented databases.
Related articles
This article is a child-friendly adaptation of the Wikipedia article on Document-oriented database, available under CC BY-SA 4.0.
Safekipedia