Web Application Architecture: Future Testing

I have a web application that is currently sending emails. At the time when my web applications send emails (sending emails is based on user actions, not automatic), it should start other processes, such as files with the extension.

I'm trying to make my application β€œfuture proof” - therefore, when there are a large number of users, I do not want the server to be stressful, so I thought that I need to send emails that need to be sent, and the files that you need to be archived in queues. Put them in a table, and then use the cron job to check every second and execute them (one x rows at a time).

Is this a good idea? Or is there a better approach? I really need help to do it right, to save my headaches later :)

Thank you all

+3
source share
7 answers

This is a good approach, but the most important thing you can do right now is a clear interface for message queuing and one for consuming a queue. Do not make use at both ends hard-coded for the database.

Later, if this becomes a bottleneck, you might want to send mail from another machine that might not even have access to the database, so this tiny investment ahead will give you options later.

+6
source

, , , , - , , , zip- ( ), , .

, zipping , (MP3, ZIP, DOCX, XLSX, JPG, GIF ..) , ( TXT, XML, DOC, XLS ..), .

+2

, , cron , , - - .

, , , , , , cronjob , , .

+1

?

? .. , . , . - , cron , , - , .

+1

. , cron - . . , , . , - .

, , cron 1 . , , , . , .

, , (sendmail, postfix, Exchange) . , , , , . , , . MTA .

- BMB

+1

-, . , , .

cron ? ? , , n- , , , .

-, . , - .

+1

. :

  • cron, .
  • /.
  • The reader must discharge the queue β€” do not block until the read in the queue is empty.
  • Keep it simple. Put complexity and subtlety in the conversation of the writer / reader.

In my experience, this will scale well.

+1
source

All Articles