Zum Inhalt springen

Migration guides overview

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

If you’re already familiar with another actor framework, the migration guides translate what you know into actor-ts conventions.

You’re coming fromGuide
Akka (JVM, Scala/Java)from-akka-jvm
Apache Pekkofrom-pekko
Microsoft Orleans (.NET grains)from-orleans
Akka.NETfrom-akka-net
Vanilla TS (Promises, EventEmitter)from-vanilla-ts

Each guide:

  • Maps the source framework’s concepts to actor-ts equivalents.
  • Shows before/after code for common patterns.
  • Lists what’s missing or different.
  • Points to the most relevant actor-ts pages.

If you’ve used any actor framework, the core ideas are identical:

  • Actors as units of state + behavior with one-at-a-time message processing.
  • Mailboxes as per-actor queues.
  • Supervision with directives like Restart / Resume / Stop / Escalate.
  • Death watch for actor lifecycle observation.
  • Event sourcing for state-via-events.

If you’ve used Akka specifically, even more carries over — actor-ts is heavily Akka-inspired, with Cluster, Sharding, Singleton, DistributedData, PersistentActor all using familiar naming.

Three categories of differences:

  • No fibers / no JVM — JavaScript is single-threaded per process; actor-ts uses the microtask + macrotask queues for scheduling.
  • No native Akka-Typed — the framework’s typed API (Behaviors) is inspired but not identical.
  • ts-pattern instead of pattern matching — TypeScript doesn’t have native match expressions; the framework uses ts-pattern as a peer dep.
  • No Streams — Akka Streams isn’t ported. Use Promise-based patterns or a separate library.
  • No FSM as a separate module in some frameworks; actor-ts has it but with a different API shape.
  • Fewer built-in patterns — actor-ts focuses on the 80 % of features.
  • Bun is the primary runtime — Node 20+ also supported, Deno best-effort.
  • JSON is the default serializer — CBOR + custom available.
  • K8s is the assumed deployment target — first-class K8s integration for seed discovery + lease + management endpoints.

For quick translation:

ConceptAkka JVM / PekkoOrleansAkka.NETactor-ts
ActorActor / Behavior[T]GrainActorBaseActor<T>
Actor identityActorRefIGrainKeyIActorRefActorRef<T>
Send (fire-forget)tell / !IGrainObserverTelltell()
Send (request-reply)ask / ?Grain method callAskask()
Supervisor strategySupervisorStrategy(limited)SupervisorStrategyOneForOneStrategy / AllForOneStrategy
Sharded entityCluster ShardingGrainCluster ShardingClusterSharding
SingletonCluster Singleton(manual)Cluster SingletonClusterSingleton
Event sourcingAkka PersistenceOrleans Event SourcingAkka.NET PersistencePersistentActor
Lease coordinationCoordination(manual)ClusterSingleton leaseLease
Test frameworkTestKit / TestProbeTestClusterTestKitTestKit / TestProbe

Read the guide for your source framework, then:

  1. Quickstart — 5-minute actor-ts hello world.
  2. Fundamentals overview — the conceptual map.
  3. Migration guide — this page.
  4. Specific guide for your source framework — pattern-by-pattern translations.

For most teams, migration is incremental:

  • Step 1: Run a small actor system alongside existing code. Maybe a new feature.
  • Step 2: Migrate one stateful concept (a registry, a job-runner). HTTP handlers still call it like a service.
  • Step 3: Add clustering / persistence as you go.
  • Step 4: Migrate more.

You don’t have to rewrite everything to benefit. See from-vanilla-ts for the staged adoption pattern.