User:Rfc1394/Scenario

The following gives an example of a scenario where an application program makes more sense than a web server.

Consider a large transaction-oriented application. A medium-sized school district, having, say, 60,000 employees, 400,000 students, hundreds of vendors and lots of equipment. Now, data entry can be done in a couple of ways. Bills, invoices and purchase orders can be entered by clerks. Payroll information can be transmitted by electronic time clocks in real time over the school's intranet to a server. Either a dedicated order-entry program or a web browser-based system would work.

But when it comes to processing the issuance of employee payments, either direct deposit with printed pay stub or checks, using a web server won't give you the economies of scale you could get by running a program on each computer to generate a payment. Having each machine send a request to the server to do this wastes the capability of individual machines to do the work, simply querying the main database for the next record. Also, the workload on the server of only handling database requests is going to be much less than also running 60 web server instances. And you don't have timeout issues as you do when a web browser is waiting for a response.

Also, if you have multiple machines normally doing data entry, those same machines can be set up to compute and print payroll or accounts payable checks (or, as is probably more likely, creating a transmission record to generate a direct deposit, while printing a pay stub instead of a check.)

Done using separate machines will do work like this much faster than having everything run on a single web server.

But here is where Free Pascal can make a difference. Those machines could be PCs running Windows, or Linux, or instead of 60 PCs it could be a cluster of 240 Raspberry Pis running a Linux distribution. The same program, unmodified, could be compiled for all of them' and run on any of these and work exactly the same.

Well, actually thinking about it, you could have them designed to run unattended, possibly from a master console. Instead of printing messages on screen, each machine would send a request to the master console. The master console might assign the next record to process and sends it to one of the machines, in effect making each computer a kind of web server. Then it would create a payroll record and either print locally, or send the record to be printed, mark the record as completed (instead of in progress) then ask for the next record. When a machine runs out of paper, it can send that message, and the master console can report that.