Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

NoSQL

From Wikipedia, the free encyclopedia
Database class for storage and retrieval of modeled data
"Structured storage" redirects here. For the Microsoft technology, seeCOM Structured Storage.

NoSQL (originally meaning "NotonlySQL" or "non-relational")[1] refers to a type ofdatabase design that stores and retrieves data differently from the traditional table-based structure ofrelational databases. Unlike relational databases, which organize data into rows and columns like a spreadsheet, NoSQL databases use a single data structure—such askey–value pairs,wide columns,graphs, ordocuments—to hold information. Since this non-relational design does not require a fixedschema, it scales easily to manage large, oftenunstructured datasets.[2] NoSQL systems are sometimes called"Not only SQL" because they can supportSQL-like query languages or work alongside SQL databases inpolyglot-persistent setups, where multiple database types are combined.[3][4] Non-relational databases date back to the late 1960s, but the term "NoSQL" emerged in the early 2000s, spurred by the needs ofWeb 2.0 companies like social media platforms.[5][6]

NoSQL databases are popular inbig data andreal-time web applications due to their simple design, ability to scale acrossclusters of machines (calledhorizontal scaling), and precise control over dataavailability.[7][8] These structures can speed up certain tasks and are often considered more adaptable than fixed database tables.[9] However, many NoSQL systems prioritize speed and availability over strict consistency (per theCAP theorem), usingeventual consistency—where updates reach all nodes eventually, typically within milliseconds, but may cause brief delays in accessing the latest data, known asstale reads.[10] While most lack fullACID transaction support, some, likeMongoDB, include it as a key feature.[11]

Barriers to adoption

[edit]

Barriers to wider NoSQL adoption include their use of low-levelquery languages instead of SQL, inability to perform ad hocjoins across tables, lack of standardized interfaces, and significant investments already made in relational databases.[12] Some NoSQL systems risklosing data through lost writes or other forms, though features likewrite-ahead logging—a method to record changes before they’re applied—can help prevent this.[13][14] Fordistributed transaction processing across multiple databases, keeping data consistent is a challenge for both NoSQL and relational systems, as relational databases cannot enforce rules linking separate databases, and few systems support bothACID transactions andX/Open XA standards for managing distributed updates.[15][16] Limitations within the interface environment are overcome using semantic virtualization protocols, such that NoSQL services are accessible to mostoperating systems.[17]

History

[edit]
Last.fm Player
Last.fm Player

The termNoSQL was used byCarlo Strozzi in 1998 to name his lightweightStrozzi NoSQL open-source relational database that did not expose the standardStructured Query Language (SQL) interface, but was still relational.[18] His NoSQLRDBMS is distinct from the around-2009 general concept of NoSQL databases. Strozzi suggests that, because the current NoSQL movement "departs from the relational model altogether, it should therefore have been called more appropriately 'NoREL'",[19] referring to "not relational".

Johan Oskarsson, then a developer atLast.fm, reintroduced the termNoSQL in early 2009 when he organized an event to discuss "open-sourcedistributed, non-relational databases".[20] The name attempted to label the emergence of an increasing number of non-relational, distributed data stores, including open source clones of Google'sBigtable/MapReduce and Amazon'sDynamoDB.

Types and examples

[edit]

There are various ways to classify NoSQL databases, with different categories and subcategories, some of which overlap. What follows is a non-exhaustive classification by data model, with examples:[21]

TypeNotable examples of this type
Key–value cacheApache Ignite,Couchbase,Coherence,eXtreme Scale,Hazelcast,Infinispan,Memcached,Redis, Velocity
Key–value storeAzure Cosmos DB,ArangoDB,Amazon DynamoDB,Aerospike,Couchbase,ScyllaDB
Key–value store (eventually consistent)Azure Cosmos DB,Oracle NoSQL Database,Riak,Voldemort
Key–value store (ordered)FoundationDB,InfinityDB,LMDB,MemcacheDB
Tuple storeApache River,GigaSpaces,Tarantool,TIBCO ActiveSpaces,OpenLink Virtuoso
TriplestoreAllegroGraph,MarkLogic,Ontotext-OWLIM,Oracle NoSQL database, Profium Sense,Virtuoso Universal Server
Object databaseObjectivity/DB,Perst,ZODB,db4o,GemStone/S,InterSystems Caché,JADE,ObjectDatabase++,ObjectDB,ObjectStore,ODABA,Realm,OpenLink Virtuoso,Versant Object Database,Indexed Database API
Document storeAzure Cosmos DB,ArangoDB,BaseX,Clusterpoint,Couchbase,CouchDB,DocumentDB,eXist-db,Google Cloud Firestore,IBM Domino,MarkLogic,MongoDB,RavenDB,Qizx,RethinkDB,Elasticsearch,OrientDB
Wide-column storeAzure Cosmos DB,Amazon DynamoDB,Bigtable,Cassandra,Google Cloud Datastore,HBase,Hypertable,ScyllaDB
Native multi-model databaseArangoDB,Azure Cosmos DB,OrientDB,MarkLogic,Apache Ignite,[22][23]Couchbase,FoundationDB,Oracle Database, AgensGraph
Graph databaseAzure Cosmos DB,AllegroGraph,ArangoDB,Apache Giraph,GUN (Graph Universe Node),InfiniteGraph,MarkLogic,Neo4J,OrientDB,Virtuoso
Multivalue databaseD3Pick database,Extensible Storage Engine (ESE/NT),InfinityDB,InterSystems Caché, jBASEPick database, mvBaseRocket Software, mvEnterpriseRocket Software,Northgate Information Solutions Reality (the original Pick/MV Database), OpenQM, Revelation Software's OpenInsight (Windows) and Advanced Revelation (DOS), UniDataRocket U2, UniVerseRocket U2

Key–value store

[edit]
Main article:Key–value database

Key–value (KV) stores use theassociative array (also called a map or dictionary) as their fundamental data model. In this model, data is represented as a collection of key–value pairs, such that each possible key appears at most once in the collection.[24][25]

The key–value model is one of the simplest non-trivial data models, and richer data models are often implemented as an extension of it. The key–value model can be extended to a discretely ordered model that maintains keys inlexicographic order. This extension is computationally powerful, in that it can efficiently retrieve selective keyranges.[26]

Key–value stores can useconsistency models ranging fromeventual consistency toserializability. Some databases support ordering of keys. There are various hardware implementations, and some users store data in memory (RAM), while others onsolid-state drives (SSD) orrotating disks (aka hard disk drive (HDD)).

Document store

[edit]
Main articles:Document-oriented database andXML database

The central concept of a document store is that of a "document". While the details of this definition differ among document-oriented databases, they all assume that documents encapsulate and encode data (or information) in some standard formats or encodings. Encodings in use includeXML,YAML, andJSON andbinary forms likeBSON. Documents are addressed in the database via a uniquekey that represents that document. Another defining characteristic of a document-oriented database is anAPI or query language to retrieve documents based on their contents.

Different implementations offer different ways of organizing and/or grouping documents:

  • Collections
  • Tags
  • Non-visiblemetadata
  • Directory hierarchies

Compared to relational databases, collections could be considered analogous to tables and documents analogous to records. But they are different – every record in a table has the same sequence of fields, while documents in a collection may have fields that are completely different.

Graph

[edit]
Main article:Graph database

Graph databases are designed for data whose relations are well represented as agraph consisting of elements connected by a finite number of relations. Examples of data includesocial relations, public transport links, road maps, network topologies, etc.

Graph databases and their query language
NameLanguage(s)Notes
AgensGraphCypherMulti-modelgraph database
AllegroGraphSPARQLRDF triple store
Amazon NeptuneGremlin,SPARQLGraph database
ArangoDBAQL,JavaScript,GraphQLMulti-model DBMSDocument,Graph database andKey-value store
Azure Cosmos DBGremlinGraph database
DEX/SparkseeC++,Java,C#,PythonGraph database
FlockDBScalaGraph database
GUN (Graph Universe Node)JavaScriptGraph database
IBM Db2SPARQLRDF triple store added in DB2 10
InfiniteGraphJavaGraph database
JanusGraphJavaGraph database
MarkLogicJava,JavaScript,SPARQL,XQueryMulti-modeldocument database andRDF triple store
Neo4jCypherGraph database
OpenLink VirtuosoC++,C#,Java,SPARQLMiddleware anddatabase engine hybrid
OracleSPARQL 1.1RDF triple store added in 11g
OrientDBJava, SQLMulti-modeldocument andgraph database
OWLIMJava,SPARQL 1.1RDF triple store
Profium SenseJava,SPARQLRDF triple store
RedisGraphCypherGraph database
Sqrrl EnterpriseJavaGraph database
TerminusDBJavaScript,Python,datalogOpen source RDF triple-store and document store[27]

Performance

[edit]

The performance of NoSQL databases is usually evaluated using the metric ofthroughput, which is measured as operations per second. Performance evaluation must pay attention to the rightbenchmarks such as production configurations, parameters of the databases, anticipated data volume, and concurrent userworkloads.

Ben Scofield rated different categories of NoSQL databases as follows:[28]

Data modelPerformanceScalabilityFlexibilityComplexityData integrityFunctionality
Key–value storehighhighhighnonelowvariable (none)
Column-oriented storehighhighmoderatelowlowminimal
Document-oriented storehighvariable (high)highlowlowvariable (low)
Graph databasevariablevariablehighhighlow-medgraph theory
Relational databasevariablevariablelowmoderatehighrelational algebra

Performance and scalability comparisons are most commonly done using theYCSB benchmark.

Handling relational data

[edit]

Since most NoSQL databases lack ability for joins in queries, thedatabase schema generally needs to be designed differently. There are three main techniques for handling relational data in a NoSQL database. (Seetable join and ACID support for NoSQL databases that support joins.)

Multiple queries

[edit]

Instead of retrieving all the data with one query, it is common to do several queries to get the desired data. NoSQL queries are often faster than traditional SQL queries, so the cost of additional queries may be acceptable. If an excessive number of queries would be necessary, one of the other two approaches is more appropriate.

Caching, replication and non-normalized data

[edit]

Instead of only storing foreign keys, it is common to store actual foreign values along with the model's data. For example, each blog comment might include the username in addition to a user id, thus providing easy access to the username without requiring another lookup. When a username changes, however, this will now need to be changed in many places in the database. Thus this approach works better when reads are much more common than writes.[29]

Nesting data

[edit]

With document databases like MongoDB it is common to put more data in a smaller number of collections. For example, in a blogging application, one might choose to store comments within the blog post document, so that with a single retrieval one gets all the comments. Thus in this approach a single document contains all the data needed for a specific task.

ACID and join support

[edit]

A database is marked as supportingACID properties (atomicity, consistency, isolation, durability) orjoin operations if the documentation for the database makes that claim. However, this doesn't necessarily mean that the capability is fully supported in a manner similar to most SQL databases.

DatabaseACIDJoins
AerospikeYesNo
AgensGraphYesYes
Apache IgniteYesYes
ArangoDBYesYes
Amazon DynamoDBYesNo
CouchbaseYesYes
CouchDBYesYes
IBM Db2YesYes
InfinityDBYesNo
LMDBYesNo
MarkLogicYesYes[nb 1]
MongoDBYesYes[nb 2]
OrientDBYesYes[nb 3]
  1. ^Joins do not necessarily apply to document databases, but MarkLogic can do joins using semantics.[30]
  2. ^MongoDB did not support joining from a sharded collection until version 5.1.[31]
  3. ^OrientDB can resolve 1:1 joins using links by storing direct links to foreign records.[32]

Query optimization and indexing in NoSQL databases

[edit]

Different NoSQL databases, such asDynamoDB,MongoDB,Cassandra,Couchbase, HBase, and Redis, exhibit varying behaviors when querying non-indexed fields. Many perform full-table or collection scans for such queries, applying filtering operations after retrieving data. However, modern NoSQL databases often incorporate advanced features to optimize query performance. For example, MongoDB supports compound indexes and query-optimization strategies, Cassandra offers secondary indexes and materialized views, and Redis employs custom indexing mechanisms tailored to specific use cases. Systems like Elasticsearch use inverted indexes for efficient text-based searches, but they can still require full scans for non-indexed fields. This behavior reflects the design focus of many NoSQL systems on scalability and efficient key-based operations rather than optimized querying for arbitrary fields. Consequently, while these databases excel at basicCRUD operations and key-based lookups, their suitability for complex queries involving joins or non-indexed filtering varies depending on the database type—document, key–value, wide-column, or graph—and the specific implementation.[33]

See also

[edit]

References

[edit]
  1. ^http://nosql-database.org/ "NoSQL DEFINITION: Next Generation Databases mostly addressing some of the points : being non-relational, distributed, open-source and horizontally scalable".
  2. ^"What Is a NoSQL Database? | IBM".www.ibm.com. 12 December 2022. Retrieved9 August 2024.
  3. ^"NoSQL (Not Only SQL)".NoSQL database, also called Not Only SQL
  4. ^Fowler, Martin."NosqlDefinition".many advocates of NoSQL say that it does not mean a "no" to SQL, rather it means Not Only SQL
  5. ^Mohan, C. (2013).History Repeats Itself: Sensible and NonsenSQL Aspects of the NoSQL Hoopla(PDF). Proc. 16th Int'l Conf. on Extending Database Technology.
  6. ^"Amazon Goes Back to the Future With 'NoSQL' Database". WIRED. 19 January 2012. Retrieved6 March 2017.
  7. ^Leavitt, Neal (2010)."Will NoSQL Databases Live Up to Their Promise?"(PDF).IEEE Computer.43 (2):12–14.Bibcode:2010Compr..43b..12L.doi:10.1109/MC.2010.58.S2CID 26876882.
  8. ^"RDBMS dominate the database market, but NoSQL systems are catching up". DB-Engines.com. 21 November 2013. Archived fromthe original on 24 November 2013. Retrieved24 November 2013.
  9. ^Vogels, Werner (18 January 2012)."Amazon DynamoDB – a Fast and Scalable NoSQL Database Service Designed for Internet Scale Applications". All Things Distributed. Retrieved6 March 2017.
  10. ^"Jepsen: MongoDB stale reads".Aphyr.com. 20 April 2015. Retrieved6 March 2017.
  11. ^"MongoDB ACID Transactions".GeeksforGeeks. 12 March 2024. Retrieved25 October 2024.
  12. ^Grolinger, K.; Higashino, W. A.; Tiwari, A.; Capretz, M. A. M. (2013)."Data management in cloud environments: NoSQL and NewSQL data stores"(PDF). Aira, Springer. Retrieved8 January 2014.
  13. ^"Large volume data analysis on the Typesafe Reactive Platform".Slideshare.net. 11 June 2015. Retrieved6 March 2017.
  14. ^Fowler, Adam."10 NoSQL Misconceptions".Dummies.com. Retrieved6 March 2017.
  15. ^"No! to SQL and No! to NoSQL".Iggyfernandez.wordpress.com. 29 July 2013. Retrieved6 March 2017.
  16. ^Chapple, Mike."The ACID Model".about.com. Archived fromthe original on 29 December 2016. Retrieved26 September 2012.
  17. ^Lawrence, Integration and virtualization of relational SQL and NoSQL systems including MySQL and MongoDB (2014). "Integration and virtualization of relational SQL and NoSQL systems including MySQL and MongoDB".International Conference on Computational Science and Computational Intelligence 1.
  18. ^Lith, Adam; Mattson, Jakob (2010)."Investigating storage solutions for large data: A comparison of well performing and scalable data storage solutions for real time extraction and batch insertion of data"(PDF). Department of Computer Science and Engineering, Chalmers University of Technology. p. 70. Retrieved12 May 2011.
  19. ^"NoSQL Relational Database Management System: Home Page". Strozzi.it. 2 October 2007. Retrieved29 March 2010.
  20. ^"NoSQL 2009". Blog.sym-link.com. 12 May 2009. Archived fromthe original on 16 July 2011. Retrieved29 March 2010.
  21. ^Strauch, Christof."NoSQL Databases"(PDF). pp. 23–24. Retrieved27 August 2017.
  22. ^https://apacheignite.readme.io/docs Ignite Documentation
  23. ^https://www.infoworld.com/article/3135070/data-center/fire-up-big-data-processing-with-apache-ignite.html fire-up-big-data-processing-with-apache-ignite
  24. ^Sandy (14 January 2011)."Key Value stores and the NoSQL movement". Stackexchange. Retrieved1 January 2012.Key–value stores allow the application developer to store schema-less data. This data usually consists of a string that represents the key, and the actual data that is considered the value in the "key–value" relationship. The data itself is usually some kind of primitive of the programming language (a string, an integer, or an array) or an object that is being marshaled by the programming language's bindings to the key-value store. This structure replaces the need for a fixed data model and allows proper formatting.
  25. ^Seeger, Marc (21 September 2009)."Key-Value Stores: a practical overview"(PDF). Marc Seeger. Retrieved1 January 2012.Key–value stores provide a high-performance alternative to relational database systems with respect to storing and accessing data. This paper provides a short overview of some of the currently available key–value stores and their interface to the Ruby programming language.
  26. ^Katsov, Ilya (1 March 2012)."NoSQL Data Modeling Techniques". Ilya Katsov. Retrieved8 May 2014.
  27. ^"TerminusDB an open-source in-memory document graph database".terminusdb.com. Retrieved16 December 2021.
  28. ^Scofield, Ben (14 January 2010)."NoSQL - Death to Relational Databases(?)". Retrieved26 June 2014.
  29. ^"Moving From Relational to NoSQL: How to Get Started".Couchbase.com. Retrieved11 November 2019.
  30. ^"Can't do joins with MarkLogic? It's just a matter of Semantics! - General Networks".Gennet.com. Archived fromthe original on 3 March 2017. Retrieved6 March 2017.
  31. ^"Sharded Collection Restrictions".docs.mongodb.com. Retrieved24 January 2020.
  32. ^"SQL Reference · OrientDB Manual".OrientDB.com. Retrieved24 January 2020.
  33. ^Sullivan, Dan.NoSQL for Mere Mortals.ISBN 978-0134023212.

Further reading

[edit]

External links

[edit]
Types
Concepts
Objects
Components
Functions
Related topics
Retrieved from "https://en.wikipedia.org/w/index.php?title=NoSQL&oldid=1335450843"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp