CouchDB: Forskjell mellom sideversjoner

Fra Wikipedia, den frie encyklopedi
Slettet innhold Innhold lagt til
Cyberpower678 (diskusjon | bidrag)
m Reverted edits by InternetArchiveBot (talk) to last version by AnomieBOT
(Ingen forskjell)

Sideversjonen fra 15. aug. 2017 kl. 17:06

Apache CouchDB
[[fil:|center||frameless]]
Utvikler(e)Apache Software Foundation
Utgitt 2005
Nyeste versjon2.1.0 / 7. august 2017; 6 år siden (2017-08-07)
Kodelagerhttps://github.com/apache/couchdb
TypeDokumentorientert database, database,[1] HTTP,[1] nettverksklient,[1] serverprogramvare,[1] skytjenester,[1] Innholdsforvaltning,[1] stordata[1]
LisensApache License 2.0[2]
Nettstedcouchdb.apache.org (en)[3]

Apache CouchDB is open source database software that focuses on ease of use and having a scalable architecture. It has a document-oriented NoSQL database architecture and is implemented in the concurrency-oriented language Erlang; it uses JSON to store data, JavaScript as its query language using MapReduce, and HTTP for an API.[4]

CouchDB was first released in 2005 and later became an Apache Software Foundation project in 2008.

Unlike a relational database, a CouchDB database does not store data and relationships in tables. Instead, each database is a collection of independent documents. Each document maintains its own data and self-contained schema. An application may access multiple databases, such as one stored on a user's mobile phone and another on a server. Document metadata contains revision information, making it possible to merge any differences that may have occurred while the databases were disconnected.

CouchDB implements a form of multiversion concurrency control (MVCC) so it does not lock the database file during writes. Conflicts are left to the application to resolve. Resolving a conflict generally involves first merging data into one of the documents, then deleting the stale one.[5]

Other features include document-level ACID semantics with eventual consistency, (incremental) MapReduce, and (incremental) replication. One of CouchDB's distinguishing features is multi-master replication, which allows it to scale across machines to build high performance systems. A built-in Web application called Fauxton (formerly Futon) helps with administration.

History

Couch is an acronym for cluster of unreliable commodity hardware.[6] The CouchDB project was created in April 2005 by Damien Katz, former Lotus Notes developer at IBM. He self-funded the project for almost two years and released it as an open source project under the GNU General Public License.

In February 2008, it became an Apache Incubator project and was offered under the Apache License instead.[7] A few months after, it graduated to a top-level project.[8] This led to the first stable version being released in July 2010.[9]

In early 2012, Katz left the project to focus on Couchbase Server.[10]

Since Katz's departure, the Apache CouchDB project has continued, releasing 1.2 in April 2012 and 1.3 in April 2013. In July 2013, the CouchDB community merged the codebase for BigCouch, Cloudant's clustered version of CouchDB, into the Apache project. [11] The BigCouch clustering framework is included in the current release of Apache CouchDB. [12]

Native clustering is supported at version 2.0.0. And the new Mango Query Server provides a simple JSON-based way to perform CouchDB queries without JavaScript or MapReduce.

Main features

ACID Semantics
CouchDB provides ACID semantics.[13] It does this by implementing a form of Multi-Version Concurrency Control, meaning that CouchDB can handle a high volume of concurrent readers and writers without conflict.
Built for Offline
CouchDB can replicate to devices (like smartphones) that can go offline and handle data sync for you when the device is back online.
Distributed Architecture with Replication
CouchDB was designed with bi-direction replication (or synchronization) and off-line operation in mind. That means multiple replicas can have their own copies of the same data, modify it, and then sync those changes at a later time.
Document Storage
CouchDB stores data as "documents", as one or more field/value pairs expressed as JSON. Field values can be simple things like strings, numbers, or dates; but ordered lists and associative arrays can also be used. Every document in a CouchDB database has a unique id and there is no required document schema.
Eventual Consistency
CouchDB guarantees eventual consistency to be able to provide both availability and partition tolerance.
Map/Reduce Views and Indexes
The stored data is structured using views. In CouchDB, each view is constructed by a JavaScript function that acts as the Map half of a map/reduce operation. The function takes a document and transforms it into a single value that it returns. CouchDB can index views and keep those indexes updated as documents are added, removed, or updated.
HTTP API
All items have a unique URI that gets exposed via HTTP. It uses the HTTP methods POST, GET, PUT and DELETE for the four basic CRUD (Create, Read, Update, Delete) operations on all resources.

CouchDB also offers a built-in administration interface accessible via Web called Futon.[14]

Use cases and production deployments

Replication and synchronization capabilities of CouchDB make it ideal for using it in mobile devices, where network connection is not guaranteed, and the application must keep on working offline.

CouchDB is well suited for applications with accumulating, occasionally changing data, on which pre-defined queries are to be run and where versioning is important (CRM, CMS systems, by example). Master-master replication is an especially interesting feature, allowing easy multi-site deployments.[15]

Users

Users of CouchDB include:

Data manipulation: documents and views

CouchDB manages a collection of JSON documents. The documents are organised via views. Views are defined with aggregate functions and filters are computed in parallel, much like MapReduce.

Views are generally stored in the database and their indexes updated continuously. CouchDB supports a view system using external socket servers and a JSON-based protocol.[23] As a consequence, view servers have been developed in a variety of languages (JavaScript is the default, but there are also PHP, Ruby, Python and Erlang).

Accessing data via HTTP

Applications interact with CouchDB via HTTP. The following demonstrates a few examples using cURL, a command-line utility. These examples assume that CouchDB is running on localhost (127.0.0.1) on port 5984.

Action Request Response
Accessing server information
curl http://127.0.0.1:5984/
{
  "couchdb": "Welcome",
  "version":"1.1.0"
}
Creating a database named wiki
curl -X PUT http://127.0.0.1:5984/wiki
{"ok": true}
Attempting to create a second database named wiki
curl -X PUT http://127.0.0.1:5984/wiki
{
  "error":"file_exists",
  "reason":"The database could not be created, the file already exists."
}
Retrieve information about the wiki database
curl http://127.0.0.1:5984/wiki
{
  "db_name": "wiki",
  "doc_count": 0,
  "doc_del_count": 0,
  "update_seq": 0,
  "purge_seq": 0,
  "compact_running": false,
  "disk_size": 79,
  "instance_start_time": "1272453873691070",
  "disk_format_version": 5
}
Delete the database wiki
curl -X DELETE http://127.0.0.1:5984/wiki
{"ok": true}
Create a document, asking CouchDB to supply a document id
curl -X POST -H "Content-Type: application/json" --data \
'{ "text" : "Wikipedia on CouchDB", "rating": 5 }' \
http://127.0.0.1:5984/wiki
{
  "ok": true,
  "id": "123BAC",
  "rev": "946B7D1C"
}

Open source components

CouchDB includes a number of other open source projects as part of its default package.

Component Description License
Erlang Erlang is a general-purpose concurrent programming language and runtime system. The sequential subset of Erlang is a functional language with strict evaluation, single assignment, and dynamic typing Apache 2.0 (Release 18.0 and later)
Erlang Public License (Earlier releases)
ICU International Components for Unicode (ICU) is an open source project of mature C/C++ and Java libraries for Unicode support, software internationalization and software globalization Unicode License
jQuery jQuery is a lightweight cross-browser JavaScript library that emphasizes interaction between JavaScript and HTML MIT License
OpenSSL OpenSSL is an open source implementation of the SSL and TLS protocols. The core library (written in the C programming language) implements the basic cryptographic functions and provides various utility functions Apache 1.0 and the four-clause BSD License
SpiderMonkey SpiderMonkey is a performant JavaScript engine maintained by the Mozilla Foundation. It contains an interpreter, a JIT compiler and a garbage collector MPL 2.0

See also

References

  1. ^ a b c d e f g https://projects.apache.org/json/projects/couchdb.json; besøksdato: 8. april 2020.
  2. ^ https://couchdb.apache.org/.
  3. ^ projects.apache.org, besøkt 8. april 2020[Hentet fra Wikidata]
  4. ^ Apache Software Foundation. «Apache CouchDB». Besøkt 15 April 2012.  Sjekk datoverdier i |besøksdato= (hjelp)
  5. ^ Smith, Jason. «What is the CouchDB replication protocol? Is it like Git?». StackOverflow. Stack Exchange. Besøkt 14 April 2012.  Sjekk datoverdier i |besøksdato= (hjelp)
  6. ^ «Exploring CouchDB». Developer Works. IBM. March 31, 2009. Besøkt September 30, 2016.  Sjekk datoverdier i |besøksdato=, |dato= (hjelp)
  7. ^ Apache mailing list announcement on mail-archives.apache.org
  8. ^ Re: Proposed Resolution: Establish CouchDB TLP on mail-archives.apache.org
  9. ^ "CouchDB NoSQL Database Ready for Production Use", article from PC World of July 2010
  10. ^ Katz, Damien. «The future of CouchDB». Besøkt 15 April 2012.  Sjekk datoverdier i |besøksdato= (hjelp)
  11. ^ Slater, Noah. «Welcome BigCouch». Besøkt 25 July 2013.  Sjekk datoverdier i |besøksdato= (hjelp)
  12. ^ «'2.0'». Besøkt 13 January 2017.  Sjekk datoverdier i |besøksdato= (hjelp)
  13. ^ CouchDB, Technical Overview Arkivert oktober 20, 2011, hos Wayback Machine
  14. ^ "Welcome to Futon" from "CouchDB The Definitive Guide"
  15. ^ Cassandra vs MongoDB vs CouchDB vs Redis vs Riak vs HBase comparison from Kristóf Kovács
  16. ^ "CouchDB in the wild" article of the product's Web, a list of software projects and websites using CouchDB
  17. ^ Cutler, Kim-Mai (9 June 2012). «Meebo Gets The Classic Google Acq-hire Treatment: Most Products To Shut Down Soon». TechCrunch. AOL Inc. Besøkt 7 January 2016.  Sjekk datoverdier i |besøksdato=, |dato= (hjelp)
  18. ^ «npm-registry-couchapp». GitHub. npm. 17 June 2015. Besøkt 7 January 2016.  Sjekk datoverdier i |besøksdato=, |dato= (hjelp)
  19. ^ CouchDB at the BBC as a fault tolerant, scalable, multi-data center key-value store
  20. ^ Email from Elliot Murphy (Canonical) to the CouchDB-Devel list
  21. ^ Canonical Drops CouchDB From Ubuntu One (Slashdot)
  22. ^ AirFi has CouchDB as its job requirements
  23. ^ View Server Documentation on wiki.apache.org

Bibliography

Mal:Refbegin

Mal:Refend

External links