Databases Reference
In-Depth Information
4.4.2
Document collections
Most document stores group documents together in collections . These collections look
like a directory structure you might find in a Windows or UNIX filesystem. Document
collections can be used in many ways to manage large document stores. They can
serve as ways to navigate document hierarchies, logically group similar documents,
and store business rules such as permissions, indexes, and triggers. Collections can
contain other collections and trees can contain subtrees.
If you're familiar with RDBMS s, you might think it natural to visualize document
collections as an RDBMS . It might seem natural because you've used an XML column
data type within your system. In this example, the RDBMS is a single table that contains
XML documents. The problem with this view is that in the relational world, RDBMS s
don't contain other tables, and you'd be missing the power and flexibility that comes
with using a document store: allowing collections to have collections.
Document collections can also be used as application collections, which are con-
tainers for the data, scripts, views, and transforms of a software application. Let's see
how an application collection (package) is used to load software applications into a
native XML database like eXist.
4.4.3
Application collections
In some situations, the collection in a document
store is used as a container for a web application
package, as shown in figure 4.22.
This packaging format, called a xar file, is similar
to a Java JAR file or a WAR file on Java web servers.
Packaged applications can contain scripts as well as
data. They're loaded into the document store and
use packaging tools (scripts) to load the data if it's
not already there. These packaging features make
document stores more versatile, expanding their
functionality to become application servers as well as
document stores.
The use of collection structures to store applica-
tion packages shows that a document store can be
used as a container of high-level reusable compo-
nents that can run on multiple NoSQL systems. If
these developments continue, a market for reusable
applications that are easy to install by nonprogram-
mers and can run on multiple NoSQL systems will
soon be a reality.
Figure 4.22 Document store
collections can contain many
objects, including other collections
and application packages. This is
an example of a package repository
that's used to load application
packages into the eXist native XML
database.
Search WWH ::




Custom Search