Best practice for database archives in searches

Options

Hi everyone!

The issue

Currently, we're storing logs in the database, so thousands of new entries are added every hour.

We also need to be able to perform fast searches in these log entries.

Most of the time, we don't need to perform searches in entries older than 10 days.


I am wondering what would be the best practice in order to archive old entries to make the search faster.

  • Move the oldest entries out to another database (not convenient for maintainability)
  • Create a true/false type index on an "is_archived" field (but would it be equally efficient as the first solution?)

Thanks 😉

Comments