Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Design pattern to monitor distributed system?

I have a distributed system: 12-14 applications running on 10 boxes (each with about 8 cores). My apps are heavily multithreaded.

In the course of the day my apps are pretty busy. Latency is critical for what I do.

Given the circumstances, I have a new additional requirement that I have to monitor a bunch of in memory objects spread across these apps and generate some reports (could be a web page or a text file doesn't matter).

I am looking for design patterns relevant to the monitoring work. What is bothering me is that I should not be introducing any latency by way of some monitoring/observer threads doing anything nasty. If it helps, I am mostly C++ at this point so low level stuff like shared memory etc are definitely on the table.

like image 937
Fanatic23 Avatar asked Jun 11 '13 19:06

Fanatic23


People also ask

What is design pattern in DP?

A design pattern provides a general reusable solution for the common problems that occur in software design. The pattern typically shows relationships and interactions between classes or objects. The idea is to speed up the development process by providing well-tested, proven development/design paradigms.

How do you design interactions in a distributed system to prevent failures?

Best Practices:Implement loosely coupled dependencies: Dependencies such as queuing systems, streaming systems, workflows, and load balancers are loosely coupled. Loose coupling helps isolate behavior of a component from other components that depend on it, increasing resiliency and agility.

What is SDM design pattern?

In software engineering, a design pattern is a general repeatable solution to a commonly occurring problem in software design. A design pattern isn't a finished design that can be transformed directly into code. It is a description or template for how to solve a problem that can be used in many different situations.


1 Answers

Yours is a very broad question!

Here are some starting ideas:

  • Event driven architecture allows you to invert the message flow and makes it easier to have asynchronous workflows.

  • EDA also works nicely with Event Sourcing strategies for state management.

  • Message queues are typically well suited as a transport mechanism for events and, well, messages. They normally adhere to some specified set of performance characteristics, but you have to see if they are adequate for your purposes.

  • If you need even more speed, you can use a lock-free structure like a ring buffer as an in-memory queue to decouple the main business logic from the reporting logic.

I realize my answer is very generic, but hopefully it will be of help.

like image 144
Sklivvz Avatar answered Sep 30 '22 14:09

Sklivvz