Here's my app:
When a user tries to access X from my site he is served it and his request is logged (his username). He can have only 10 requests/servings per day.
Now i can open, read, write to the mysql db without a problem but i was thinking of something that uses less resources, here's my idea:
Instead of connecting to the DB i create a local file for the user named <date>_<username>.txt
, so for example that would be:
2011-06-16_stackoverflow.txt
Then simply do a file exists, if yes, open the file, read the accesses and if <10, allow, and ++1. (Everyday i do a cron job to delete the last days files based on their date)
Wont this be a less resources solution than using the database for ~40,000 people?
Or is it still recommended to use a DB?
Thanks!