7. Design Documents

CouchDB supports special documents within databases known as “designdocuments”. These documents, mostly driven by JavaScript you write, are usedto build indexes, validate document updates, format query results, and filterreplications.

Note: Previously, the functionality provided by CouchDB’s design documents,in combination with document attachments, was referred to as “CouchApps.” Thegeneral principle was that entire web applications could be hosted in CouchDB,without need for an additional application server.

Use of CouchDB as a combined standalone database and application server is nolonger recommended. There are significant limitations to a pure CouchDB webserver application stack, including but not limited to: fully-fledgedfine-grained security, robust templating and scaffolding, complete developertooling, and most importantly, a thriving ecosystem of developers, modules andframeworks to choose from.

The developers of CouchDB believe that web developers should pick “the righttool for the right job”. Use CouchDB as your database layer, in conjunctionwith any number of other server-side web application frameworks, such as theentire Node.JS ecosystem, Python’s Django and Flask, PHP’s Drupal, Java’sApache Struts, and more.

原文: http://docs.couchdb.org/en/stable/ddocs/index.html