I've got a large database table in SQLExpress on Home windows, having a particular area of great interest 'code'.

I've an Apache web server with MySQL on Linux. The net application around the Linux box needs accessibility listing of all codes. The only real factor it'll make use of the list for is checking for the presence of confirmed code.

Getting the Linux server call to the Home windows server is not practical because the Home windows server is behind a NAT'ed office web connection, and it might not continually be accessible. I've place it therefore the Home windows server will push their email list of codes to the net server by way of an easy HTTP Publish request. However, at this time I haven't implemented the storage from the codes around the Linux box.

Must I store these questions MySQL table having a single area 'code'? I Quickly get fast indexed searches O(1), however think synchronization is going to be an problem - given an up-to-date listing of codes, pressed in the Home windows box, wouldso would I brilliantly synchronize their email list using the database? TRUNCATE, then Place?

Must I rather store these questions flat file? I Quickly have O(n) lookup time instead of O(1). Furthermore an additional constant-time overhead too, as I'll be processing the file in Ruby. However, synchronization is simple - simply replace the file.

UPDATE

Another approach: Abuse the filesystem: Given a code, say "ABCDEF", produce a path like "A/AB/ABC/ABCDEF", and 'touch' personal files there. I believe I love this method probably the most. Is that's an awful idea?

First, in case your web application has persistence, just add the codes to the present persistence store. (simpler)

But, it realy is dependent on how big your code list. Since you'll be able to HTTP Publish the codes, it doesn't appear to become gb large when saved to some flat file.

Thus, in case your flat file adopts some MBs (or some 1000's of codes), choose MySQL. Anything under say 1MB i believe could be an overkill to utilize a database server.

So, should you file is small: allow it to be flat.