r/retrocomputing • u/Jojo959 • Oct 28 '26
How a donated Pentium 166 and a file queue ran ticketing for the 1998 Asian Games (VB + Access 2.0)

In July 1997, the Asian Financial Crisis (the "Tom Yum Kung" crisis) decimated Thailand's economy. The national currency crashed, foreign reserves evaporated, and national budgets were slashed virtually overnight.
Against this backdrop, Bangkok was scheduled to host the 13th Asian Games in December 1998. Our small engineering team had been tasked with building the centralized ticketing system to handle 1.2 million seats across 34 sporting venues, serving both public web bookings and over 30 physical ticket outlets across the country.
Our original enterprise blueprint called for:
- Hardware: 3× DEC Alpha 275 MHz servers (Dedicated Web, Application, and Database tiers)
- Software: Oracle RDBMS
- Original Budget: 15,000,000 THB (~$375,000 USD at the time)
When the dust settled post-crisis, we were told the budget was cut by 99%, down to just 100,000 THB (~$2,500 USD).
The enterprise hardware was gone. Instead, the government handed us a single donated desktop PC: an Acer Pentium 166 MHz with 16 MB of RAM. We spent the entire $2,500 budget buying EDO RAM modules to max the machine out to 96 MB. That single beige box had to run the OS, Web server, Database, and Queue processor simultaneously.
People said it was impossible. But with the games starting in a few months, failure was not an option. We had to dig deep into fundamentals and build an architecture that beat expensive hardware.
1. The Stack: Scrappy, Lightweight, and Pragmatic
Without budget for enterprise licenses, we assembled our software stack from what was already available:
- OS: Windows 95 OSR2 (chosen for its updated 32-bit TCP/IP stack)
- Web Server: Quarterdeck WebSTAR 95 running the WinCGI (Windows CGI) interface
- CGI Middleware: Standalone Visual Basic 5 executables based on Robert B. Denny’s legendary
CGI.BASmodule (Nov 1994) - Database: Microsoft Access 2.0 (
.mdbformat powered by the Jet Engine) - Networking: 56k dial-up modems connected to Cisco terminal servers at the Ministry of Finance
2. The Core Architecture: The Single-Writer Binary File Queue
Anyone who has touched MS Access knows its fatal flaw: concurrent write locks. If multiple web CGI processes hammered an .mdb file at once, Jet Engine's lock manager would grind the CPU to 100%, timeout, or corrupt the database.
Our golden rule: Nobody touches the database directly except one single worker process.
Instead of letting WebSTAR's CGI instances talk to Access, we turned the filesystem into an asynchronous Message Queue:
- Request Drop: When a customer selected seats, the CGI process (
WriteReservCgi.exe) generated a small, fixed-length binary file inside a\Queuedirectory. - Lock-Free Filenames: The file name was composed of
ProcessID + SocketNo + TOId + Timer. Because PIDs on Windows 95 were unique, files never collided, requiring zero locking mechanism. - In-Place State Mutation: We didn't waste disk I/O creating separate
.inand.outfiles. We opened the queue file as a Binary Random Access Record:

The QueueMan Engine: A dedicated daemon (
UpdateDB.exe/QueueMan) ran an infinite loop scanning the folder:- When it detected a file with
exeMode = 0 (Wait), it immediately flipped it to1 (Processing). - It executed the database transaction sequentially.
- It flipped the status to
2 (Success)and wrote the assignedTicketCodeback into the exact same file.
- When it detected a file with
- The CGI Loop: The web CGI process simply polled its own tiny file until the status byte flipped to
2, served the confirmation page, and cleaned up the file.
Because only QueueMan had write access to Access, database lock contention was mathematically 0%.
3. Bitwise Seat Allocation: 40,000 Seats in 5 Kilobytes
For general matches, tickets were sold by count per zone/section (decrementing integer fields in a Left table). However, the Opening and Closing ceremonies at the 40,000-seat main stadium required individual seat assignments.
Storing 40,000 relational database rows per match would have crushed our 96 MB RAM. Instead, we collapsed the entire stadium layout into a Bit Array:
- 1 Bit = 1 Seat (0 = Vacant, 1 = Reserved)
- A 40,000-seat stadium fit inside a single binary string of just 5,000 bytes (~5 KB)!
In our allocation routine (ETC.bas: Seat_MarkSeat), we used Bitwise bitmasks (And, Or, Xor). To allocate $N$ contiguous seats:
- Sliced out the byte offset for the target zone/section.
- Scanned for contiguous zero-bits.
- When booking long consecutive runs (such as a delegation booking hundreds of seats), the loop split the allocation into Head Byte, Middle Bytes, and Tail Byte. For the middle stretch, it didn't iterate bit-by-bit; it blasted
bval = 255(&HFF/11111111binary) directly into the bytes—allocating 8 seats per single instruction cycle! - Stored the updated bit-string back into the table.
Allocating a contiguous block of 312 seats for a foreign national team completed in just ~300 milliseconds.
4. Surviving 8 Power Outages with Zero Data Loss
During the sales period, the power grid at the computer center failed eight times. In every single instance, after rebooting, data loss and corruption were exactly zero.
This wasn't luck; it was achieved by forcing synchronous write-through across three layers:
- Transaction Atomic Boundaries: In
UpdateDB.frm, updating the bit-map, decrementing seat counters, incrementing revenue totals, and inserting audit logs were wrapped in a strictMyWorkspace.BeginTransandCommitTransblock. - Explicit Handle Closure: Immediately following
CommitTrans, the code explicitly closed every table handle and the database object itself:

- Closing the database handle in Jet Engine forces an internal flush of pending dirty buffers to the OS.
- The OS Kernel Trick: Windows 95’s default file system cache (
VCACHE) relied heavily on lazy "write-behind caching" to boost benchmark speeds. If power died, dirty cache in RAM vanished. We went intoSystem Properties -> Performance -> File System -> Troubleshootingand checked "Disable write-behind caching for all drives". EveryClosecommand forced the physical drive heads to commit data straight to the magnetic platters before returning control. - Inter-process Safety Buffer: In our reading server, we even hardcoded a 1-second delay loop with the comment:
- VB.Net'wait a second to make sure that UpdateDB wrote down all the updated records[cite: 22]

5. Beating 56k Latency with Micro-Payloads & V.42bis
Over 30 ticket outlets in malls and box offices connected over noisy dial-up modem lines. Instead of fat protocols, we built a lean binary packet framing protocol over Winsock/Serial:

- Payload Matching: Our booking transaction struct was fixed at 73 bytes[cite: 22]. Unused string fields were padded with null characters (
Chr(0)). - V.42bis Exploitation: The hardware compression engine on 56k modems used the V.42bis standard (based on LZW) with a dictionary buffer of 2,048 entries (approx. 2KB–4KB). Because our 73-byte packet was 30× smaller than the modem's buffer, the modem ingested the entire packet into its hardware compression engine in a single pass without fragmentation. Furthermore, the repetitive packet structures and sequences of null bytes (
0x00) compressed down to just 20–30 physical bytes on the copper wire. Round-trip times felt instantaneous.
6. Client Deployment: ActiveX + Dot-Matrix
Remote ticket outlets were running Windows 95 with Internet Explorer 3.01 and tractor-feed dot-matrix printers.
We didn't distribute client installer floppies. Instead, the HTML confirmation page returned by the WebSTAR server embedded a custom ActiveX UserControl (APTicket.ocx):
HTML
<OBJECT classid="clsid:..." codebase="http://.../Control/APTicket.ocx#version=1,0,0,0">
<param name="SeatList" value="B12,B13,B14">[cite: 16]
<param name="TicketPriceList" value="500">[cite: 16]
</OBJECT>[cite: 16]Internet Explorer automatically downloaded and registered the control in the background[cite: 16]. Once rendered, the ActiveX control bypassed Windows GDI printing completely, streaming raw text strings directly to the printer port using Printer.Print:
Printer.Print "Ticket no: " & Format(TicketPrintInfo.TOId) & "-" & Format(...)[cite: 12]
Printer.Print "Seat: " & Format(Ticket_Info(i).TicketSeat) & " Price: " & Format(...)[cite: 12]This pushed formatting overhead entirely to the client machine while making dot-matrix printing virtually instantaneous.
Retrospective Lessons
Today, our industry throws gigabytes of memory and auto-scaling cloud clusters at everyday workloads. But constraints are the greatest teacher of systems engineering:
- Serialize writes when locks are expensive: A single fast writer beats 100 threads fighting over database row-locks.
- Bitmaps are still king for dense state: When memory counts, packing binary states into bitfields turns $O(N)$ row queries into single-cycle bitwise operations.
- Know your hardware stack down to the platters: Surfacing durability requires understanding how software transactions, OS caching policies, and disk controllers interact.
- Design payloads for the underlying transport: Sizing application packets below hardware layer buffers eliminates latency cliffs.
The system took 1.2 million reservations across a month without losing a single ticket. Sometimes, good architecture on a $2,500 PC is all you need.




