Gossamer Forum
Home : Products : DBMan : Discussions :

auth.pl and flock

Quote Reply
auth.pl and flock
Can anyone advise on this one?

DBMan's auth.pl file has a number of open file and close file statements, but only some are covered by flock (file locking).

In general, is it good practice to flock all open and close statements or is there some other reason for not file locking?

Thanks in advance for any comments!

Quote Reply
Re: auth.pl and flock In reply to
Typically, if data is being written to an existing flat file, then flocking is always a good idea. To simply read or create a separate flat file, like a session file, then you don't really need flocking enabled.

Got it?

Regards,

Eliot Lee
Quote Reply
Re: auth.pl and flock In reply to
Thanks Eliot!

It makes alot of sense when you put it like that.

Can you advise what might happen if two users try to read a file at exactly the same time? Does one request get ignored or are the requests simply qued? Will it depend on the operating system on the server?

Quote Reply
Re: auth.pl and flock In reply to
The request does not get ignored, but goes into a virtual "que". The problem with flat file systems is that it is like waiting in ONE line at the local rural grocery store.

Other database storage applications, like MySQL, MSSQL Server, and Oracle, they allow concurrent/persistent connections to the database (like 1,500 - 2,000 users for MySQL/MSSQL, and 100,000+ users for Oracle, MS Access via DSN/ODBC files ain't better either, since only between 6-12 concurrent users can access, read, write, etc. to a database). This is like shopping at CostCo or a large mega-store with tons and tons of cashiers waiting to take your cash...both figuratively and literally.

Does this make sense?

So, the bottom line is...flat file systems are fine for low traffic, low use systems/applications, but for medium to large traffic with tons of use, they suck!

And, yes, operating systems (hardware/software) will affect processing of data, however, if you ever expect your DBMAN project to be used by a lot of people (I'm talking about more than 3,000 unique visitors per day), then you should consider upgrading to DBMAN SQL.

Regards,

Eliot Lee
Quote Reply
Re: auth.pl and flock In reply to
Thanks for the info and the simple explanation.

Quote Reply
Re: auth.pl and flock In reply to
No problem. You're welcome.

BTW: I should've added that rather than a cash register machine/computer, that in the rural grocery store uses a calculator and hand writes all receipts. Wink

Regards,

Eliot Lee