Decide bounded-staleness contract for parallel read connections

Open
#646 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
rust, sqlite
Domain
api, backend, databases

Research direction

The issue is about designing a consistency contract for parallel read connections in aw-datastore/src/worker.rs. Start by understanding the WAL changes from PR #616 and the current read/write patterns. Review the code in the worker.rs file to see the parallel-read TODO. Determine acceptable staleness bounds (average under 1 second, worst case under 1 minute) and whether read-your-writes is needed. This is a design decision, not an implementation task.

Written by the indexing model from the issue text.

Description

Question

Is bounded read staleness acceptable for ActivityWatch read endpoints when reads are served from parallel read-only SQLite connections? If yes, what bounds should we design for?

Erik's current preference is:

  • under 1 second in the average case
  • never more than 1 minute in the worst case

Why this gates the design

WAL landed in #616, so readers no longer need to block the serial writer. The remaining fork for the parallel-read TODO in aw-datastore/src/worker.rs is consistency:

  • if bounded staleness is acceptable, reads can use a read-only pool with that freshness contract;
  • if read-your-writes is required, dispatch needs a synchronization/guard path before serving a read.

This issue is only to settle the consistency contract; implementation and benchmarking can follow separately.

Dominant language
Rust
Stars
322
Forks
105
Avg merge
3d 10h
Merged PRs (30d)
22

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ActivityWatch/aw-server-rust

All issues in ActivityWatch/aw-server-rust

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.