Actor Model outside Distributed Systems

Actor Model outside Distributed Systems


mac0499

https://github.com/OJarrisonn/ph-actors-tcc

Summary

In the beginning, networking was born and connected machines and people over distance. The Actor Model emerged, providing a framework for distributed computation. The 80s saw the rise of distributed systems, as resources were shared on networks. Erlang was born, a language designed for distributed systems that embraced the Actor Model, with each process behaving as an independent actor communicating with each other through messages.

This introduction was just to show how the Actor Model is closely related to distributed systems architecture. But what if it was not? What if someone built a centralized (non-distributed) application using a distributed system paradigm? What would be better? What would be worse? These are the questions that this project aims to respond to.

This work is about building a centralized application based on patch-hub in Rust using the Tokio async runtime. The architecture used will be based on the Actor Model but adapted to Rust/Tokio and patch-hub needs.

To give some more context: patch-hub is a terminal application that helps Linux Kernel developers review contributions, so it has little to no need for concurrency/parallelism. It will be used as the laboratory to test different approaches to reimplement it using the Actor Model.

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.
  • User experience analysis: Evaluate user experience metrics comparing Actor Model implementation against traditional approaches.
  • 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