The Haiku/BeOS Tip Server
Tips and tricks for Haiku/BeOS users

TrackerBase

December 14th, 2007 by shacker

This site now runs on WordPress. The TrackerBase info below is preserved for historical reasons.

The BeOS features a unique, high-performance file system that also happens to function as a database. Any filetype can have an associated array of customizable “attributes,” of any size or type. Once attributes have been associated with a given filetype, they can be displayed, organized, sorted, and queried directly in the Tracker (the BeOS file manager).

I’ve created a filetype called “TrackerBase” (MIME type: text/x-trackerbase) with associated attributes representing tip name, category, contributor, URL, e-mail address, AdKey, etc. I can now organize the collection of tips directly in the Tracker, without having to purchase, install, or configure a third-party commercial or freeware database.

TrackerBase
Click to enlarge

To turn TrackerBase files into web pages, I’ve used two systems. Until April 1999, I didn’t have a full-time Internet connection, so I wrote a bash shell script to query the collection of TrackerBase files, hoover out their attributes, and concatenate those variables with static chunks of HTML. The resulting HTML docs were then uploaded to my ISP’s web server and served like a normal site. That system (which I call TrackerBase I) includes a bash scripting tutorial and several sample TrackerBase projects, in case you want to set up a similar system.

Download TrackerBase

Now that I have a nailed-down Internet connection, I’ve re-written the system (TrackerBase II) to generate most of the site’s pages on the fly. The menu and index pages are generated statically with a separate perl script, but all of the actual tip pages are generated in real time.

If you’d like to study or hack the actual script that drives this site, just ask — I’ll be happy to send you a copy.

Considering the amount of work being done, the script is pretty fast — six attributes are extracted, the script is run, all parsing occurs, and an HTML file is generated … all in about a quarter of a second. Still, that’s not fast enough to hold up under very heavy loads, where a professional database solution would be more appropriate. After some real-world stress testing, I’ll know exactly how robust the system is under load. On the other hand, the system is incredibly easy to work with — very visual and very flexible. It can also be adapted to work with your collection of BeOS people files, e-mail messages, bookmarks, or any other attributed filetype. Consider creating a script that will create an instant HTML Rolodex out of your People files, which you can then access while on the road, from any operating system.

About BeOS Web Servers

Because the BeOS is pervasively multithreaded, 100% SMP-aware, and speaks TCP/IP natively, the platform potentially makes for an excellent web server. Note, however, that Be’s focus is currently on media content production and consumption, and the BeOS is not currently as well optimized as a server platform as are Linux or FreeBSD. Nevertheless, I’ve dished up well over 30,000 pages per day from BeOS without the system even blinking (a different site — this site isn’t that popular!), so if your site gets moderate levels of traffic, you’ll be fine. We can probably expect further networking optimizations from Be in the future.

There are a number of excellent web server solutions for BeOS. This site runs on Joe Kloss’ Robin Hood because it’s free, open source, very fast, and supports lots of add-on goodies. However, several aspects of this site would have been easier to build with the excellent diner from Stegemann & Stegemann, which is the only BeOS web server to support BeOS-specific functions like attributes and queries natively — if you’re new to this kind of stuff but still need advanced functionality and ease of development, you should definitely check out diner. BeOS ships with a simple web server called PoorMan, although future versions of BeOS are scheduled to ship with RobinHood rather than PoorMan. Hard-cores and migrating Linux users will be happy to know that Apache is in the process of being ported to the BeOS, and is being folded into the official source tree. The only reason I run RH rather than Apache right now is that RH is so fast and I just don’t have a need for more speed than it gives me. Robin Hood is also a piece of cake to set up.

This site is currently being hosted from my main work machine (named “pearl”): a dual PII 450, 256MB. setiathome is running at all times. If the site seems temporarily slow, I’m probably busy crunching audio, rendering video, or playing 10 MP3s at once :). If I need to boot into Windows or Linux for a while, I just boot up my laptop, which is also configured with Robin Hood and perl, and restart its network services (one click!) to operate on this machine’s IP address. You’ll never know whether you’re reading this from my desktop or laptop machine.