samedi 23 mai 2015

Storing data for a newsletter send-log, open-log & click-log system

Sending newsletter E-Mails is nice, but I and my customers also want to know, how many e-mails were opened and who clicked on a link in a specific newsletter.

Set-Up: typical shared lamp-server.

While I first thought storing each send-, open- and click-events in separate files (eg. csv), I noticed that analyzing these files would be a pain.

Storing it in the (MySQL) database would make the size of the db explode.

So I finally decided to go with SQLite, as it stores the data on the disk, however I'm still unsure about the best possible db scheme for this situation. Most obvious solution would be, to create normalized tables for send-, open- and click-events and store each log as a separate row in the corresponding table. While I really would like this solution, I'm afraid of heavy performance issues.

Let's assume we got hundreds of ten thousands open-rows in the open table and I want to get all events form newsletter id, let's say, 1079, I would assume the system to take quite a long time.

This leads to 2 questions.

  1. Is SQLite the best solution for the problem described or would you prefer other solutions?
  2. Would you recommend a specific table design? Aside from the above mentioned design, it would be possible to create log-tables for every day, like: sendlog_2015_05_23, and per newsletterid: sendlog_1079. This would create some redundancy but would keep table size small.

Aucun commentaire:

Enregistrer un commentaire