Here's a new use for Linux--selling pizzas--and about time, too.
by Steve O'Connor
I am fortunate in that I started my career in the mid-80s as a UNIX applications programmer. Computers were fun then: Ataris and Amigas were breaking new ground each month, UNIX minis were fighting hard against the tide of IBM system 36s and 38s, and innovation ruled the day. Toward the end of the 80s, a new system, MS Windows, began gaining a tiny toehold in corporate computing. This new system offered three main advantages over minis :
By 1994, I was a true believer. I lived and breathed MFC, VC++, OLE, VXD's and DLL's. Yet somewhere in the back of my mind lurked a deep yearning for the power of a UNIX command line. One day, when I got the money together, I would buy a Sun workstation and get a real computer for the home office. At that same time, one of my co-workers started telling me about Linux. I dismissed it at first--I simply assumed that a ``free UNIX clone'' would be some toy system that ran slowly, crashed often and lacked fundamental commands such as grep and find. To me, Windows was the key to the future, because in any objective comparison, the cost plus power of Windows would prove to be a better buy. I remember saying to him at the time: ``The day that Linux is running the local pizza bar, I will start to change my mind.''
As 1995 came around, I was annoyed at having to upgrade all of my tools (again) in order to keep on the leading edge. Windows 95 was due out soon and the Win32 API was the thing to be using. I was faced with the prospect of possibly having to rewrite all of my core libraries (again) due to a company on the other side of the world which decided to change its APIs (again). I began to feel somewhat trapped.
The day Win95 was released to the public, I walked down to the software shop at lunchtime, slipped past the queues of people holding Win95 boxes, and (purely out of curiosity) purchased a copy of Getting Started With Linux. For $35, this was half the cost of a book covering some of the new Win32 APIs. I was amazed to discover the book also included a CD for that price.
I installed Linux within a few hours and was literally stunned at what I found. I really did not expect to get a real system with X, compilers, source, etc. The whole experience changed the way I looked at a lot of things.
In the intervening period, I have used Linux at each place of work as a development platform for all manner of applications, web servers, database servers and more.
In October 1997, a chance meeting with an old friend led me to a potential client who was looking to computerize a pizza bar/restaurant in Adelaide. While I normally work on large contract projects on enterprise level systems, I felt compelled for a number of reasons to take this job. While the irony of fulfilling my own comment from two years ago was indeed a factor, I also saw this as a good opportunity to prove that Linux can compete on traditional PC home ground.
A number of existing systems were available at the time for the restaurant owner to choose from; two other systems running under DOS, and one under Windows. All of the other systems were proven in existing restaurants and available at a low price. The decision on which system to purchase would come down to a number of factors:
Linux helped us in the following ways:
Figure 3. Displays the customer details, along with statistics and a history of orders.
The requirements for this system were aimed at handling pick-up and delivery orders for pizzas and various other food items. This involves the usual items of a customer database, an items for sale database, an order entry screen, receipt printing and sales reports.
Some of the more esoteric requirements included :
We decided to go with Red Hat Linux 4.2 and use the JDK 1.0.2 as the development platform. In order to keep system quality under control, we used a simplified requirement traceability system (like we use on larger defense projects) and regression testing suite. These management tools were cobbled together out of shell scripts in just a few days.
We were all quite familiar with Java, so it took us only one week to produce a working prototype of the screen layouts to present to the client. When the time came to demonstrate our proposal, we brought in a laptop and demonstrated the layout of the system to the client in person. During this initial discussion, we learned of more requirements we had not previously considered. We were able to add these into our requirements-tracking database on the spot, and in some cases, make alterations to the screens to reflect how we might cover these additions in the future. It was pretty obvious to the client that, unlike the other contenders, we did not have a working system we could install tomorrow. However, the client was happy the interface was easy to use, and more importantly, they felt comfortable we would produce something unique and customized for their particular business. Whatever we said, it must have been the right thing, because we were awarded the order. Now we had to prove it could be done.
Development was to be performed at our own discretion, with collaboration via e-mail. This led to a very different development culture than we were used to in our ``normal'' working lives. When you are feeling very focused, you stay up and write code all night; otherwise, you go out, watch a movie, play Nintendo or just relax. I don't believe this development model had any adverse effect on the timing of the project, but I do believe it added greatly to the quality of the finished product. We all felt very motivated to prove that it was possible to deliver excellent customer service and excellent product quality in a short time frame. We did this with discipline, but also in a relaxed manner.
For a database, we looked at using PostgreSQL, but had some problems running this with Java 1.0.2, so we settled for creating our own simple database system. This database uses a flat file with all of the objects representing customers, orders, items and such. In order to maintain good performance with this arrangement, we set a flag that says ``the data needs saving'' and we have a separate thread to monitor system activity. When an idle period exceeds a threshold time (two minutes with no data changes), the data is saved and the flag is cleared. Despite the fact that we are using a non-JIT implementation of Java, the whole system responds very fast. I would like to say that even if we have achieved nothing else, we have proven that Java and Linux are a robust combination that you can bet your business on.
Within the next three weeks, we got the system installation ready. After this, we set up the following equipment:
It has taken an intensive period of three more months of development to bring the initial system up to the required standard. This has involved periods of time where I personally worked behind the bar and took orders, so that I could truly appreciate the business requirements and not just focus on the computer aspects. This has resulted in an excellent level of attention to detail. For example, no amount of pure computer analysis will alert you to the fact that when you hand the order docket to the cook (whose fingers are smeared in a sticky combination of flour and tomato sauce), the lower right-hand side of the order docket becomes unreadable. Adding a few line feeds to the printout gives the cook a nice spot where he can grab the docket without smearing sauce all over the printing.
We also set up an off-site backup arrangement so that at 4 AM each day, the client's machine dials into my machine and, using FTP, uploads the data files to act as an off-site backup. Should a disaster occur, I can load their data onto a spare machine and have them back in business within hours.
Now that the system has been enhanced to the client's satisfaction, another machine is being installed in the restaurant to handle the order processing and an additional machine and printer being installed to run a new point-of-sale system for the restaurant customers who dine in. (This is another product of ours written in Java 1.1 and PostgreSQL.)
The pizza bar is now expanding to three new locations. This is being done by locating existing pizza bars in other suburbs and selling them a franchise to join the chain. Part of the franchise arrangement involves the installation of at least one computer and running our Linux-based order processing system. This system adds value to the overall franchise.
To achieve the distributed database requirement, we are currently porting the existing application across to Java 1.1 so that we can use PostgreSQL for the database management. In order to synchronize the databases at the lowest possible cost, we have the main store dial up each branch store in turn to retrieve the last period's new data. The main system then consolidates all of the new data, dials each store again and disseminates the new (complete) database. Because this happens during a period when all stores are closed, there is no possibility of lost data. This approach should work well until we get to the point where the chain of pizza bars is spread across time zones. We will address this point if and when it becomes a requirement.
Another enhancement which PostgreSQL will make possible is the ability to pre-load the system with data commonly available on CD-ROM containing all names and phone numbers for an area. We have tested our Java and PostgreSQL implementation with 1,000,000 names and phone numbers on an AMD K6-233 server and response times are still excellent.
I would like to report soon that Linux + Java + PostgreSQL is also a combination that you can bet your business on.
At the time of writing, we are currently experimenting with the GTK+ toolkit, with a view to porting the application over to pure C. This appears to be a long road to travel, with GTK+ currently lacking a lot of data-entry-type features. However, the performance improvements do look promising. We may be able to make a contribution to GTK/Gnome by adding some features in this area.
We all feel that we owe a debt to the Linux community, the GNU community and Sun (for Java) for giving us such a firm foundation on which to build a product. Therefore, we are releasing all of our software under the GPL for others to use. A very old release is currently on the Sunsite archives, but we will release the newer version there as soon as possible.
I sincerely hope that some readers will take the opportunity to download a copy of the software and sell it to pizza bars in their local areas. We do not ask for, or expect, any form of royalty in return; we just get a kick out of knowing that people are using Linux.
I thought it might be interesting to add a random ``Powered by Linux'' line at the end of the docket printout. I hear that in Redmond, Microsoft employees working late on the latest bug fix for NT often send out for pizzas. I wonder what their reaction would be to get a docket with this line.
Steve O'Connor (soconnor@baea.com.au) is the Director of Eljay Pty. Ltd. in Adelaide, Australia. Steve has been working with UNIX systems since 1984 and advocates Linux wherever possible. Steve would eventually like to create a suite of business applications under the GPL for a variety of small businesses with unusual requirements. If you have any good ideas for the next opportunity, please e-mail him.