P2P for a Resilient Technical Architecture

Many times I have confidently started from this simple, effective, and resilient  Technical Architecture (TA) for a production-ready, minimal cluster of servers. Most often acting as a server-side to some Web Applications.

mirrored HA cluster
Classical Mirrored Pair Architecture

Two (load balanced) web servers in the front, two application servers in the middle, and classical database mirroring in the back (active or passive). Clustering is too complicated in this case. It requires more involved installation and monitoring and thus it is more expensive as a solution.

What can be better than this? Simple to explain, simple to install and monitor. Simple to pay for? And very hard to break. Machines with 128 GB RAM, RAID10 multi-disk arrays, and some Xeon quartets are definitely not more than 10K a pop. Two (2) of them in this configuration can serve an amazing number of simultaneous calls. All the way from the Load Balancer to the DB and back. But.

It is very easy to get carried away looking into this beautiful symmetry.

Because symmetrical it is not. And this is simply because only one database (machine) is in use at any one time. The “P” or Primary on this diagram. “M” or Mirror simply receives the copy of everything that is happening on the Primary side. It is not bothered at all by any of the Application servers.

And of course, DB mirroring requires yet another machine: Mirroring Witness. Usually a single point of failure (SPOF).

P2P against “The Simple Fact”

Simple Fact: The typical load is 80% on the Primary and 50% on the Mirror database server.

Do not forget that.  But, we have the way out: P2P technology galloping to the rescue. Here is one implementation of that architecture, but with no classical DB mirroring, we delivered this year (2020) :

The diagram shows two physical machines only. There is no VM’s and there is no DB Mirroring and there is no need for DB Mirroring “witness”,  as a third machine and obvious SPOF aka “Single Point of Failure”.

So how this P2P “secret sauce” actually works? P2P sync we use is OS level service. It can be installed on home PC’s, laptops or Windows Severs.

P2P Server Sync on the LAN

That is the logical architecture diagram. The central server is completely optional, it can host some kind of monitoring or admin tools. We use only two servers (as diagramed above) but there can be many. Data on all of them will be in perfect sync.

The vendor (Resilio Inc) claims that is “10 x Faster Server Farm Synchronization“, up to 10Gbps. Is that fast enough for our kind of architecture?  The answer is it depends on the kind of application it is hosting. Web App’s response to end-users does not have to be in real-time, thus this kind of back end data synchronization is certainly “fast enough”.

P2P Sync technology. is only several years young. I know it performs rather well over a WAN. We always use it on a LAN.  As a matter of fact, we always used it on the same rack. In the above configuration, performance must be as close to the real-time ideal target, as possible.

P2P sync technology is a “secret sauce” to a very resilient and feasible Technical Architecture.