How to write a dynamically self-contained balancing system for testing?

I'm going to start writing a system that needs to rebalance the load distribution between the remaining nodes when one of the narrower nodes is down. Does anyone have any good references on what to avoid and what works?

In particular, I'm curious about how to get started in order to build such a system in order to be able to test it.

+2


source to share


2 answers


This question smells like my class of distributed systems. Therefore, I believe that I should point out the tutorial we used .

It covers many aspects of distributed systems at an abstract level, so most of its content will apply to what you intend to do.

It's pretty good work, pointing out pitfalls and common mistakes, and providing possible solutions.



The first edition is available for free download from the authors .

However, the book does not cover unit testing of distributed systems. I could see the whole book written on this one.

+1


source


This sounds like a task that involves a lot of out-of-process communication and other environment-dependent code.

To make your code Testable, it is important to detach such code from the main logic so that you can unit test the main engine without relying on any of these environment-specific things.



The recommended approach is to hide such components behind an interface, which can then be replaced with so-called test pairs in unit tests.

The xUnit Test Patterns book covers many of these things and more, very well.

+1


source







All Articles