Which database should be used for tracking statistics and archiving emails sent via PHP

The question has two sides.

  • We host many static files for public download. PDF, Zips, images, people download thousands every day. We track the counters in our MySQL database, the details are tracked in MongoDB (details, for example, where the download is downloaded from and when).

  • We send many letters through PHP. Our application sends hundreds of thousands of letters every month, many of which are newsletters, notifications and invitations for projects. These sent emails are stored in the MySQL database with their important data serialized (never by the body or actual contents of the email, just headers, recipient, time of sending, etc.).

Is MySQL a good choice for this? Mongo Should we use something else? Right now, our email archive table and download statistics table are quickly approaching 2 GB each.

Note. The data that we store is regularly available, so there is no reason to store anything and forget about it. We use download statistics to notify content authors that their downloads have reached X, and we use an email archive to check delivery status, etc. And we show it to our employees who monitor this on a regular basis. (we use Sendgrid metrics for delivery)

+5
source share
3 answers

I think mysql might serve your purpose well. it is more flexible for the Internet, you can use the mysql ARCHIVEdb engine to track your log . mysql has several different engines for different purposes. I think the archive will be best suited for your structure.

mysql 60 . .

+1

:

, MySQL , postgres . postgres . ( , , , .)

- , , , , .

+1

MongoDB. , MongoDB , , , , . , MongoDB ( , , ), , .

The overall data size is not a problem in terms of performance; it can be many, many times larger than your working set, if that is not a problem. Keep track of the size of the resident memory (MMS is your friend there) and be prepared for a splinter if you start a trend towards the upper boundaries of your equipment.

2GB is really not much for a Mongo dataset or even for a working dataset. I have seen data sizes that range from a few terabytes. Based on the information you provide, I think your choice of MongoDB is perfect for the foreseeable future.

+1
source

All Articles