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

  • Home
  • SEARCH
  • 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 3722118
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T05:47:22+00:00 2026-05-19T05:47:22+00:00

I need to implement a simple logging mechanism for my web application. I have

  • 0

I need to implement a simple logging mechanism for my web application. I have two options available, one is to put the logging records into a local file, e.g. somewhere like /tmp/file.log, the other way is to use an InnoDB table(located in a busy database), which is write only and has no read operation involved. The table is straight forward, with two columns one is the primary id column which is auto incremented, the other is the logging text of type text(1024). The logging will be called 10 times per second, means it does 10 writes per second. Currently I do not have access to the production server to actually benchmark these two different ways in the real environment. Which one would be faster, generally speaking, and why?

Personally I would perfer to go with the InnoDB way, coz it simplifies my code a little bit. And I believe there is a reason why most web applications encourage to turn off runtime file logging in production env. However the innoDB table does locate in a busy database, will that degrade the logging performance and make it slower than file logging?

Thanks.

  • 1 1 Answer
  • 0 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-19T05:47:24+00:00Added an answer on May 19, 2026 at 5:47 am

    The database can buffer things and thereby optimise disk access (which is horribly slow compared to memory) which the file logging option won’t do, making it quite a bit faster. I mean, it shouldn’t be slower, worst-case scenario is it behaves just like file logging.

    How much faster it is depends on way too many variables (e.g. if it has a memory limit it might not be able to hold lots of data in memory so it will save to disk often, which depends on the OS, the database implementation, the table engine, the load on the server, other things the database is doing, etc.), although benchmarking over a day or so (which should represent different loads etc.) should give you some idea of how much faster.

    Google buffer cache for a peek into the world of database buffering (which is more often referenced for disk reads, although its true for disk writes as well)

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

Sidebar

Related Questions

No related questions found

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.