Ask HN: Need help with distributed application infrastucture design
I hope some smart brains here can lead me to the right direction. I am looking for a simple yet robust data replication and transfering mechanism for a web application i am writing.
The main things i need:
1) Replicate login & configuration data to X nodes (email servers)
2) Count emails by status (dropped, forwarded, ...) [statistics]
3) Save (some) emails back to the Web application [logging]
4) 2 & 3 are A LOT of data. It must be able to handle that without losing any
The guys from the postgres IRC made me realize that multimaster is not only overkill (and many people are afraid of running them) but also simply not the right solution.
1) is easy using Postgres master slave replication
2 & 3 however are not so easy in my head. And 4 is kind of out my knowledge scope.
I've thought about the following 3 implementations:
a) Doing a Master-Master replication. Having the secondary master doing the hard work. Like replicating to others, plus receiving statistics (directly over network). I am not sure how smart it is to use the same database, even more in such a approach.
b) Doing statistics (and most likely also the email logs) in a seperate database, that provides a thin API my application can query & cache. Statistics are everywhere in my interface, so i would likely still replicate/cache the relevant data back to my main application. But the heavy writing does not directly impact my web application.
c) Maybe using something like logstash to handle the information load and drip the relevant info out into the web applications database.
I realize this topic is just hard, however i feel like i am missing something obvious.