Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6029305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:51:59+00:00 2026-05-23T04:51:59+00:00

Here’s my app: When a user tries to access X from my site he

  • 0

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!

  • 1 1 Answer
  • 2 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T04:52:00+00:00Added an answer on May 23, 2026 at 4:52 am

    It is an interesting question. But as you know or will know, disk access is the most costly element of an application. In both cases, the server/application will have disk access but in the case of the database server, it will have severe optimizations involved.

    In the beginning, using your own system will prove much faster than the database system but building an application requires large vision.

    Structured data

    What if someday, your application will offer more acess for paying users? Wouldn’t it be very interesting to know which users use your service the most? To have data to define commercial offers? In that case having informations about logging that is queryable will help you a lot.

    Scalabilty

    What if tomorrow a lot af users start using your application, your I/O wil get saturated. Once again, the database server has several things to prevent that kind of behaviour, cache for example.
    Or imagine, your application is deployed on multiple servers, how are you going to do that?

    Server migration

    Another reason could be server migration. You will have to move the files during progres also. But hey, wait, going from a linux/unix server to a windows server is going to be a really fun task. (Ironic)

    …

    There are manys reasons out there. Do as you wish. It’s your application. Both are viable, one is standard, the other is homemade. No one can tell you what to do. Just be sure, you’re doing it for the right reasons! 😉

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is my code (seen on Google App Engine) public void doGet(HttpServletRequest request, HttpServletResponse
Here is a complete example. I want to forbid using A::set from objects casted
I have a jquery bug and I've been looking for hours now, I can't
Here's the basic setup: I have a thin bar at the top of a
Here is my problem : I have a post controller with the action create.
Here is an example: I have the generic type called Account. I wish to
Here is the problem that I am trying to solve. I have two folders
Here's a piece of code I copied from http://www.schillmania.com/content/projects/javascript-animation-1/demo/ Very simple JS animation: function
Here is my query: SELECT * FROM [GeoName] WHERE ((-26.3665122100029-Lat)*(-26.3665122100029-Lat))+((27.5978928658078-Long)*(27.5978928658078-Long)) < 0.005 ORDER BY
Here is what is supposed to happen: The moment the user chooses an option

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.