|
Download a PDF version of this Article Table of contents: Building High-perfomance Object Oriented Databases
|
Using Databases and Containers for Fast Archival and Deletes: In order to sustain the rate of incoming messages, we’ll need to be able to archive older messages and delete them as fast as the incoming rate. We discussed earlier how this can be a problem if one is using queries to find the messages and delete them. The preferred design partitions data according to time so that large numbers of messages and attachments can be archived at once. This can be accomplished easily with Objectivity/DB by using the physical database and container concepts.
In this case, each database would have 3600 containers of data, one for each second in its hour. Two weeks of data would require 14*24 = 336 databases. If we run parallel threads or processes for ingesting the data, we’ll want to provide separate databases (and consequently separate containers) for each process or thread. This would multiply the number of databases required by the number of threads. We’ll examine how to optimize the number of concurrent threads later in the paper. Since Objectivity/DB uses a separate file for each database, copying a specific hour’s worth of data to an archive and deleting it requires little more than using the operating system calls to copy or move the appropriate file(s). Deleting an hour’s worth of data could actually be accomplished in a matter of seconds or less. This does not prevent optimizing queries that are not time-based, nor does this design require us to organize all the federation’s data by time. Logical query optimizations can be employed using indexes and customizable optimizations like hash maps. |
Copyright © Objectivity, Inc. 2000 - 2008. All Rights Reserved.