Skip to content

Feat/store draft 1#7

Draft
wouter173 wants to merge 8 commits into
mainfrom
feat/store-draft-1
Draft

Feat/store draft 1#7
wouter173 wants to merge 8 commits into
mainfrom
feat/store-draft-1

Conversation

@wouter173
Copy link
Copy Markdown
Owner

@wouter173 wouter173 commented Apr 13, 2026

Store Draft v1

Design

The mxfx/store tries to solve multiple issues documented in PROBLEMS.md. Specifically, 2) the multiple db implementations (indexeddb, sqlite, memory) and 3) the data model. These problems are being tackled by making use of a repository dependency injection pattern to be exposed to the mxfx/client as well as the client developer.

Having a store in a matrix client-server api library means that it can be incredibly well designed and optimised however if not carefully thought out also explode in complexity and unmaintainable design.

Currently, this implementation is incredibly bare bones as it only supports next_batch and room events (timeline and state) to be stored and retrieved. Also, only imperative api's are available as required in the mxfx/client but these will be expanded in the future when data access patterns will become more clear.

The following repositories are defined:

  • global-repository (accountData, nextBatch)
  • room-repository (timeline & state events)

The following implementations could be developed as part of mxfx:

  • libsql for local sqlite storage (@mxfx/store-libsql)
  • expo-sqlite for usage in ios or android (@mxfx/store-expo-sqlite)
  • indexeddb for usage in the browser (@mxfx/store-indexeddb)

Problems

  1. There is no way to subscribe to changes in the store.
  2. Matrix specced features should work like redactions.
  3. Figure out a way to do ingestion of syncs (reducing syncs)
  4. Transactional design, should a sync be 1 transaction? What would this look like in the browser?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant