Actor Model outside Distributed Systems

Actor Model outside Distributed Systems


https://github.com/nahharris/ph-actors-tcc
mac0499

Summary

The Actor Model is a mathematical theory widely used in distributed systems architecture. This work explores the application of the Actor Model in the development of centralized applications (i.e., not distributed), seeking to understand whether it is possible to extract value from this architectural pattern even outside its natural context.

The objectives of this work are: to propose an architectural framework based on the Actor Model adapted for centralized applications in Rust; to implement an application using the proposed architecture through a case study in the Patch-Hub project; and to perform a qualitative and quantitative analysis of the produced application.

The developed application was evaluated from the perspectives of testability, performance, maintainability, and extensibility. The results demonstrate that, although the Actor Model is not naturally suited for centralized applications, it is possible to successfully adapt it through reimagining both the problem and the pattern. The proposed architecture resulted in significant improvements in testability, extensibility, and responsibility isolation, although it increased code complexity and introduced runtime overhead with inter-actor communication.

Objectives

  • Architecture design: Develop an Actor Model architecture tailored for centralized applications, balancing distributed patterns with simplicity.
  • Practical implementation: Implement a Rust/Tokio application using Actor Model principles to showcase message-passing in a centralized context.
  • Engineering assessment: Assess software engineering aspects like maintainability and testability when applying Actor patterns in non-distributed systems.

Roadmap

  • Study the theory: Dive into Actor Model foundations and understand how distributed system concepts can apply to centralized applications. Examine existing implementations to extract valuable patterns.
  • Propose an architecture: Design a Rust-based Actor Model approach specifically for patch-hub’s workflow. Create diagrams showing actor relationships and message flows while considering the constraints of a terminal application.
  • Start the implementation: Build the core system using Tokio’s async runtime, focusing on message-passing mechanics and actor lifecycle management. Implement enough patch-hub functionality to validate the architecture in real usage.
  • Test the implementation: Compare performance against the original patch-hub implementation through benchmarks and real-world usage. Gather feedback on both technical metrics and user experience.
  • Gather the results: Document the strengths and weaknesses found during development and testing. Analyze where the Actor Model provided benefits or introduced unnecessary complexity in a centralized context.
  • Wrap up: Document the journey, architectural decisions, and implementation details. Present conclusions about using the Actor Model for centralized applications along with lessons learned.

References

Full Thesis