Search code examples
phpmysqlmongodbstatisticsarchive

Which database should one use for stats tracking and archiving emails sent via PHP


The question has two sides.

  1. We host a lot of static files for public download. PDFs, Zips, images, people download thousands of each every day. We track the counters in our MySQL database, with details being tracked in MongoDB (details like where the download came from and when).

  2. We send a lot of emails via PHP. Our application tends to send out hundreds of thousands of emails every month, many of which are newsletters, notifications and invitations for projects. These sent emails are saved into out MySQL database with their crucial data serialized (never the body or actual email content, just the headers, recipient, time of sending etc.)

Is MySQL an ok choice for this? Is Mongo? Should we use something else? Right now both our emails archive table and the download stats table are rapidly approaching 2GB each.

Note: The data we store is accessed regularly, so something to store it in and forget about it is out of the question. We use the download stats to notify the authors of the content that their download count has reached X, and we use the email archive to check the delivery status etc and display it to our employees who track this on a regular basis. (we use Sendgrid for delivery metrics)


Solution

  • I think mysql can serve your purpose well. it is more flexible for web, for tracking your log you can use mysql ARCHIVE db engine. mysql has some different db engine for different purpose. i think archive will be the best fit for your structure.

    in recent i manage a mysql database of 60GB. its was high scaled database and performance is good.