Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

distributed architecture and preparation for higher load pt. 2

See original GitHub issue


In relation to we would now like to introduce the possibility to start the pool-reference server in multiple instances (probably behind a reverse proxy). In order to achieve that, several looped tasks would have to be factored out from the Pool class, namely: create_payment_loop submit_payment_loop collect_pool_rewards_loop The reason for that is that multiple instances would inevitably try to “spend the same coin”. And while they would not succeed, at least eventually, this would cause a lot of unnecessary CPU usage and warning logs. The loops mentioned above would be moved to a class named PaymentManager. An instance of PaymentManager would be supplied at PoolServer creation, with the implementation functionally identical to the current one serving as default. (this is very similar to the changes I introduced in

The Idea we have in mind is that we would like to start N PoolServer instances and just one PaymentManager doing all the cron-like work (the N instances and the separate PaymentManager would use the same database).

My question is: would a PR introducing such refactor be welcome?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

alvaroslmcommented, Jul 7, 2021

@ppolewicz then fork it and stop tainting this repo. “SOLID” is dangerously misguided if followed to the letter and represents an obsessive-compulsive engineer mindset. It’s like having a desk with 200 drawers, one for each item you have on the table. Yeah you keep the table clean, at the cost of becoming insane. 21200 10-line functions, hierarchies 25 levels deep… sheer insanity. Obsessive modularity destroys software projects. It looks good on textbook examples, in the real world, not so much.

ppolewiczcommented, Jul 6, 2021

We are trying to iteratively increase the quality of the reference pool with a very sharp goal in mind. I think it would be good if the reference pool, or at least major parts of it, would be used by commercial pool operators. We are trying to make the pool code more modular, so that it’s more customizable and also more readable.

As #142 shows, this refactor moves a large chunk of functionality from, which I think makes the project easier to read. If perfect readability would be achieved by having a minimum number of classes in a project, everything would be in one file and one class, but that’s not how SOLID works.

As for helping nobody, I strongly disagree - those changes will help the pool operators who choose to run their pools on top of a customized reference pool implementation (which reduces the cost of implementing a pool by a lot). Not in some distant future, but this week.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Scaling Distributed Systems - Software Architecture ... - YouTube
Software Architecture Introduction Course covering scalability ... Scaling Distributed Systems - Software Architecture Introduction ( part 2 ).
Read more >
Top 5 distributed system design patterns -
1. Command and Query Responsibility Segregation; 2. Two-Phase Commit; 3. Saga; 4. Replicated Load-Balanced Services; 5. Sharded Services ...
Read more >
Best Practices for Designing Distributed Systems – Part 3
In the final installment of this series, I'll cover the design considerations and best practices for creating a distributed system.
Read more >
Distributed Training: Guide for Data Scientists -
Let's see the two ways of carrying out distributed training loops and the difference ... we divide the data into partitions and send...
Read more >
What Are Distributed Systems? Architecture Types, Key ...
Distributed systems work toward a common goal of delivering high performance by minimizing latency and enhancing response time and throughput.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found