Databases Reference
In-Depth Information
To make this easier and more efficient, a key-value store can be modified to
include additional information in the structure of the key to indicate that the key-
value pair is associated with another key-value pair, creating a collection , or general-
purpose structures used to group resources. Though each key-value store system
might call it something different (such as folders, directories, or buckets), the concept
is the same.
The implementation of a collection system can also vary dramatically based on
what NoSQL data pattern you use. Key-value stores have several methods to group
similar items based on attributes in their keys. Graph stores associate one or more
group identifiers with each triple. Big data systems use column families to group simi-
lar columns. Document stores use a concept of a document collection. Let's take a
look at some examples used by key-value stores.
One approach to grouping items is to have two key-value data types, the first called
resource keys and the second collection keys . You can use collection keys to store a list of
keys that are in a collection. This structure allows you to store a resource in multiple
collections and also to store collections within collections. Using this design poses
some complex issues that require careful thought and planning about what should be
done with a resource if it's in more than one collection and one of the collections is
deleted. Should all resources in a collection be automatically deleted?
To simplify this process and subsequent design decisions, key-value systems can
include the concept of creating collection hierarchies and require that a resource be
in one and only one collection. The result is that the path to a resource is essentially a
distinct key for retrieval. Also known as a simple document hierarchy , the familiar concept
of folders and documents resonates well with end users.
Once you've established the concept of a collection hierarchy in a key, you can use
it to perform many functions on groups of key-value pairs; for example:
Associate metadata with a collection (who created the collection, when it was
created, the last time it was modified, and who last modified the collection).
Give the collection an owner and group, and associate access rights with the
owner group and other users in the same way UNIX filesystems use permissions.
Create an access control permission structure on a collection, allowing only
users with specific privileges the ability to read or modify the items within the
collection.
Create tools to upload and/or download a group of items into a collection.
Set up systems that compress and archive collections if they haven't been
accessed for a specific period of time.
If you're thinking, “That sounds a lot like a filesystem,” you're right. The concept
of associating metadata with collections is universal, and many file and document
management systems use concepts similar to key-value stores as part of their core
infrastructure.
Search WWH ::




Custom Search