FairCom's c-tree Plus
Price: $895; additional same site programmer licenses may be purchased for 40% off retail price.
Reviewer: Nick Xidis
Industrial strength cross-platform btree file management.
c-tree Plus is a professional developer's package. It has a complex set of features and can produce commercial grade multi-user applications. It will work on almost every platform with a C compiler and applications written on one platform can quickly and easily be ported to others. It can even work around most of the platforms' native file handling weaknesses. If you aren't a professional programmer odds are that you may have never heard of FairCom or c-tree Plus. The manual says:
c-tree Plus is a sophisticated file management product designed to be used in a variety of operating system environments. Written in the C language it is designed to be integrated with your C application program to provide easy to use, yet flexible data file manipulation and indexing.
Wow, what a mouthful! Let's cover the basics first. For those of us who don't eat and sleep C programming, a simple, and therefore good, way to think of c-tree Plus is as a library of C functions that manage data files and indices similar to the way Borland's dBase worked on old DOS platforms. You'll see later that this is professional development package with a lot more to offer than DOS dBase, but bear with me.
In the simplest application, like a business's database of customers, a single data file can be accessed through multiple binary tree (btree) index files. Each time your application accesses the data through a different index, your data looks like another data file sorted by the index you are using. You may create one index on the customer's name and another on the customer's account number. Looking though the customer name index the data appears to be sorted by customer name. Use the account number index and through the magic of btree indexing the same data appears to be a new data file sorted by account number.
Let's run through an outline of how a simple application is built. c-tree Plus offers a full suite of Indexed Sequential Access Method (ISAM) functions that can perform multiple file and index operations in a single ISAM function call. The low-level c-tree Plus functions are also available if you really need to have complete control, but the author and FairCom recommend that you stick with the ISAM functions. In order to be fully compatible across a wide variety of platforms, c-tree Plus uses it own data types. For example, an “int” may be a two-byte integer on one system and a four byte integer another. With c-tree Plus you use COUNT, which is always a two-byte signed integer.
C-tree also provides a pointer to its custom types in the form of pCOUNT, which is the equivalent to COUNT *. One of the most important custom data types is the IFIL, which defines the parameters for an ISAM file instances. You can declare your data structure in your sources or use separate parameter files. I like using the structures in my sources because when you open and close files individually with ISAM parameter files it's all or nothing.
The IFIL structure is pretty straightforward—it contains a pointer to the file name, a file number, the data record length and pointer to an IIDX index file structure. Next you'll declare the parameters for the index keys within the data records for each instance of the data using an IIDX structure containing a key length, key type and flags if duplicate keys or null keys are allowed, and a pointer to the index file name. The ability to have duplicate keys is an important feature of the c-tree package. When you use duplicate keys, the c-tree system actually pads each to make it unique. Your application doesn't have to deal with any of it—it's all taken care of for you.
The last structure is an ISEG which tells c-tree where to find the key values in data records via a segment length and offset. That's it! Just three basic structures and your data schema is laid out. The functions to work with the file structure are well thought out and very intuitive. CreateFile, OpenFile, AddRecord, GetRecord and DeleteRecord all do exactly what you'd expect.
Now a few words about modes. There are four c-tree modes, two single-user and two multi-user. The features vary between each but the base functionality is the same. The simplest, single-user mode, gives you get all the features except file security. The other mode adds Online Transaction Processing (OLTP). C-tree's OLTP suite is awesome; you can roll back transactions, use all kinds of save points, and enjoy wonderful logging and easy recovery. In the author's biased opinion, OLTP is really a must for mission-critical business applications—this package does it right.
Now for the multi-user modes, where the horsepower of this package really shines. First is the non-client/server mode. It uses the traditional methods for file and record locking to which Unix programmers are accustomed. Using Linux's NFS capabilities you could use this mode to create a client/server application, but you'll give up OLTP and a lot of c-tree's file buffering. We compiled some simple applications and found that this mode quickly slowed as you added users. For small businesses where OLTP would not unduly hold things up, using NFS and multi-user mode may be a very cost-effective solution for shared data applicants.
Now for the crown jewel of the c-tree suite: client/server mode. The package includes one FairCom server binary for the platform you specify (Linux, OS/2, Netware, DOS, NT, etc.); this is the only portion of the package for which source code is not available. I was surprised to find there are servers for just about every platform—yes, even lowly DOS can run the FairCom server and handle record locking and file security.
On multi-tasking platforms such as Linux, the server runs in the background and is very well-behaved. When you use client/server mode you get the full set of OLTP, file security, and file and record locks. The FairCom server seems to be fast, but I don't have the facilities to really load it up. Your applications communicate with the server via TCP/IP sockets, shared memory or message queues. I ran it using TCP/IP over Ethernet and PPP dial-up and found the performance to be very good. Another neat trick is that in client/server mode you're able to transparently access the local disk with or without OLTP at the same time. For the most part, you can change modes by recompiling your applications with the right c-tree libraries for that mode. This is very cool, since you can go from a single-user OLTP application to a client/server application by recompiling with a different c-tree library.
|Speed Up Your Web Site with Varnish||Jun 19, 2013|
|Non-Linux FOSS: libnotify, OS X Style||Jun 18, 2013|
|Containers—Not Virtual Machines—Are the Future Cloud||Jun 17, 2013|
|Lock-Free Multi-Producer Multi-Consumer Queue on Ring Buffer||Jun 12, 2013|
|Weechat, Irssi's Little Brother||Jun 11, 2013|
|One Tail Just Isn't Enough||Jun 07, 2013|
- Speed Up Your Web Site with Varnish
- Containers—Not Virtual Machines—Are the Future Cloud
- Linux Systems Administrator
- Non-Linux FOSS: libnotify, OS X Style
- Lock-Free Multi-Producer Multi-Consumer Queue on Ring Buffer
- Senior Perl Developer
- Technical Support Rep
- UX Designer
- RSS Feeds
- Reply to comment | Linux Journal
3 hours 50 min ago
- Yeah, user namespaces are
5 hours 7 min ago
- Cari Uang
8 hours 38 min ago
- user namespaces
11 hours 31 min ago
11 hours 57 min ago
- One advantage with VMs
14 hours 26 min ago
- about info
14 hours 59 min ago
15 hours 32 sec ago
15 hours 1 min ago
15 hours 3 min ago
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?