NeoAccess 5.0 Revealed
Volume Number: 14
Issue Number: 4
Column Tag: Tools Of The Trade
NeoAccess 5.0 Revealed
by Michael Marchetti
Taking a look at this high-performance object database
management system
Introduction
As a developer of custom software, I have the opportunity to work on a variety of
projects, from the design phase all the way through the maintenance cycle. In 1989,
ITA designed and implemented a program which stored and retrieved a number of
different kinds of data. Its data storage mechanism consisted of MacApp's dynamic
arrays, stored in a simple custom file format. Over the last eight years our
requirements changed in a number of ways. The sheer volume of data increased
greatly, resulting in increased memory usage, longer search times, and longer
program startup times. New features required us to implement new access
mechanisms, adding complexity to our original design. Finally, we were asked to port
the program to Windows. Our Mac-centric data storage used Pascal strings and
assumed big-endian integer and floating-point representations. We were looking at a
major overhaul. After evaluating a number of storage mechanisms, we chose
NeoAccess.
Why NeoAccess?
At first, the idea of using a full-featured object database management system seemed
like overkill. As we evaluated NeoAccess, however, its advantages became apparent.
NeoAccess does not load all of a database's data at once. Instead, objects are brought into
memory on demand and cached in a bounded amount of memory. A reference-counting
mechanism allows NeoAccess to effectively manage the cache with minimal developer
involvement. This provides developers with a number of benefits.
Memory requirements: NeoAccess can store large amounts of data
using a bounded amount of memory as an object cache. Objects are
reference-counted, allowing NeoAccess to effectively manage the cache with
minimal developer involvement.
Startup time: Documents open faster because not all the data is loaded at
once.
Flexibility: NeoAccess allows the application developer to easily change
the database format and still support reading, converting, and even creating
databases using older formats.
Access mechanisms: NeoAccess supports relational queries as well as
referential (object network) access. Database developers can choose the most
appropriate method for each situation.
Cross-platform compatibility: NeoAccess is available for
Macintosh, Windows, and Unix, with a uniform feature set across all
supported platforms. Database files are written in a canonical form that can be
read on any platform.
Object-oriented design: NeoAccess is written entirely in
object-oriented C++. Databases store and retrieve true C++ objects.
Framework support: NeoAccess application, document, stream, and
persistent object classes are integrated into the frameworks available for each
platform. NeoAccess also includes a "standalone mode" for use with custom
frameworks or without any framework.
Multi-threading: NeoAccess can be safely used in a multi-threaded
environment and takes advantage of asynchronous I/O operations to improve
throughput.
Capacity: NeoAccess can store up to 4 billion objects per database. The
Mac OS limits database files to 4GB; NeoAccess can be configured to use 63-bit
file offsets on platforms that support larger files.
First Impressions
The NeoAccess 5.0 package I reviewed is for Macintosh only (the multi-platform
version has identical core code but includes source and project files specific to the
other platforms). The package consists of one CD and two manuals. The installation
procedure involves simply copying the contents of the CD to a hard drive. The CD
includes:
• Full source code to the database engine.
• The complete manual in PDF form.
• Several add-on features (called "Extras"), with source code and PDF
documentation.
• Two demo programs with source code and CodeWarrior projects.
The two demo programs come pre-built in a number of configurations, with SYM files.
This means you can use the debugger to learn how a NeoAccess program and the
NeoAccess engine work. The demos come in different flavors for different frameworks.
Version 5.0 supports standalone (no framework) and PowerPlant. This is a change
from version 4.0, which included support for MacApp 3.3 and TCL.
The demo programs are NeoBench and Laughs. NeoBench is a benchmarking program to
test the speed of the database engine. Laughs illustrates most of the core constructs in
NeoAccess, including inheritance, part managers, blobs, strings, and indices. The
documentation includes a tutorial which describes the classes used in the Laughs
application and how they interact.
Technical Introduction
The main storage container in NeoAccess is the database, modeled by the class
CNeoDatabase. A database is a file containing a set of objects. These objects are
partitioned into classes which correspond to the subclasses of CNeoPersist defined in
the program. (Application-specific classes inherit their persistence properties from
CNeoPersist.) The program supplies NeoAccess with information about the inheritance
relationships between classes. This enables the program to limit a search to objects of
one specific class or allow it to range over a class and all subclasses.