Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8615393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:22:00+00:00 2026-06-12T05:22:00+00:00

I’m wondering what is the best way to implement high availability for a self-developed

  • 0

I’m wondering what is the best way to implement high availability for a self-developed SMTP Relay Server that needs to handle 30-100 emails per second.

What this server essentially does is to authenticate with various smtp clients, and then relay to specific mail servers and handle errors, e.g. mail server not available, etc. Hence, a queue is required to contain the email messages, which can contain big attachments. For high availability, the system should support clustering, which I can use Windows Clustering for a primary/secondary active cluster.

I reckon that the Email Queue can reside in:

  1. Memory (this method is out for obvious reason.)
  2. RDMS
  3. File (I believe this is what IIS Virtual SMTP uses?)
  4. Embedded DB such as SQLite
  5. Mix of SQLite and File
  6. Some fanciful 3rd party Queue product that needs to be installed and configured?

The usual method for high availability is to use an RDBMS such as MySQL, but using an RDBMS for a message queue is going to slow down the performance significantly unless I have a powerful MySQL server. On top of that, I will have to implement MySQL clustering which is not easy. Also, I read somewhere that no one should use MySQL as a queue – http://www.engineyard.com/blog/2011/5-subtle-ways-youre-using-mysql-as-a-queue-and-why-itll-bite-you/

Alternatively, I can use SQLite+File, this will probably be the fastest (other than pure memory) and easiest to deploy method (nothing to install), but there’s no clustering for SQLite so if the server crashes, the unsent messages may still be lost.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T05:22:01+00:00Added an answer on June 12, 2026 at 5:22 am

    2 and 4 is the same thing – RDBMS. It is poor choice for this since RDBMS is targeted at complex queries and have to maintain itself tiem to time. Collect garbage, rebuild indices, grow db files… Any time next INSERT would be slow or even outright blocked for a while. Even in version-based engines like Firebird and Postgress. More so with lock-based like MS SQL and SQLite.

    If you wish it reliable, then probably you’d to implement it as several narrow-task workers, that would also give you benefit of multithreading using OmniThreaLibrary or AsyncCalls.

    “Sink” worker should receive mail into memory buffer, perhaps extract some metadata form headers and store it to the current receiving queue. Since Win32 threads are expensive, it would be nice to make one thread working with several sockets at once, a la “actors” framework of Erlang/Scala. You’d even be able to move some threads to separate exe’s like qmail designed, to make crashes localized. And in future even across cluster of computers.

    “Dumper” would take an isolated queue and ump it into a contiguous non-SQL file (you’d not want separate files due to HDD thrashing data-filesystem-data-filesystem-…), then he’d switch the queues: isolate aforementioned receiving queue for dumping and subsitute it with the queue it just emptied. That “have two queues and switch them” is a common “page flipping” trait used for example in 3D gaming. TForm.DoubleBuffering is similar yet reduced concept. BTW, you also should have two folders with those files, like the in-memory queue above.

    “dbkeeper” would similarly take one of the file dumps, move it into RDBMS, and switch.

    You would have to set communications between those workers around those switching activities. Each queue is to be either receiving, or dumping, minimizing concurrent accesses (both frequency and longevity).

    You may read about mailinator design – its maintainer refactored his software few times after stepping one or another bottleneck, that would also give you an estimation when those bottlenecks start to influence performance.


    But really, why not use some ready and tested server instead ?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I am doing a simple coin flipping experiment for class that involves flipping a
I know there's a lot of other questions out there that deal with this
I need a function that will clean a strings' special characters. I do NOT
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.