Skip to content

Concepts

  • Adapter (platform adapter)
    • An adapter can instantiate a client session for a given platform (e.g. web, Expo)
  • Client
    • A logical group of client sessions
    • Client session
      • Store
      • Reactivity graph
      • Responsible for leader election
  • Devtools
  • Events
    • Event definition
    • Eventlog
    • Synced vs client-only events
  • Framework integration
    • A framework integration is a package that provides a way to integrate LiveStore with a framework (e.g. React, Solid, Svelte, etc.)
  • Reactivity system
    • Db queries queryDb()
    • Computed queries computed()
    • Signals signal()
  • Schema
  • State
    • Derived from the eventlog via materializers
    • Materializer
      • Event handler function that maps an event to a state change
    • SQLite state / database
      • In-memory SQLite database within the client session thread (usually main thread)
        • Used by the reactivity graph
      • Persisted SQLite database (usually running on the leader thread)
      • Fully derived from the eventlog
  • Store
    • A store exposes most of LiveStore’s functionality to the application layer and is the main entry point for using LiveStore.
    • To create a store you need to provide a schema and a platform adapter which creates a client session.
    • A store is often created, managed and accessed through a framework integration (like React).
    • A is identified by a storeId which is also used for syncing events between clients.
  • Sync provider
    • A sync provider is a package that provides a sync backend and a sync client.
    • Sync backend
      • A central server that is responsible for syncing the eventlog between clients
  • Leader thread
    • Responsible for syncing and persisting of data
  • Sync processor
    • LeaderSyncProcessor
    • ClientSessionSyncProcessor

LiveStore is designed to be pluggable in various ways:

  • Platform adapters
  • Sync providers
  • Framework integrations