Google News
logo
ArangoDB - Interview Questions
How is data stored in ArangoDB?
In ArangoDB, data is stored in collections. A collection is a container for documents, edges, or key-value pairs, depending on the data model being used. Here's how data is stored in each type of collection :

Document Collection :

* In a document collection, data is stored as JSON-like documents.
* Each document represents a single record or entity and can contain nested fields, arrays, and key-value pairs.
* Documents within a collection do not need to have a fixed schema, allowing for flexibility in data modeling.
* Documents are uniquely identified by their _key attribute within the collection.

Edge Collection :

* In an edge collection, data is stored as edges, which represent relationships between documents in a graph.
* An edge consists of a source document, a target document, and optional properties that describe the relationship.
* Edges connect vertices (documents) in a graph, forming a network of interconnected nodes.
* Edge collections are typically used in conjunction with vertex (document) collections to represent graph data.

Key-Value Collection :

* In a key-value collection, data is stored as simple key-value pairs.
* Each key is unique and associated with a single value, which can be any type of data, such as strings, numbers, or binary blobs.
* Key-value collections are optimized for high-performance read and write operations, making them suitable for caching, session management, and distributed systems.
Advertisement