Synclets logoSynclets

DataConnectorOptimizations

The DataConnectorOptimizations type lists optional bulk operations a connector can implement to improve performance.

{
  readAtoms?: (address: AtomsAddress<Depth>) => Promise<Atoms>;
  getData?: () => Promise<Data>;
}
TypeDescription
readAtoms?(address: AtomsAddress<Depth>) => Promise<Atoms>

The readAtoms optimization callback can retrieve all Atom values under a parent address in a single operation. Return an object mapping child IDs to their Atom values. Implementing this optimization can significantly improve sync performance by reducing the number of storage round-trips.

getData?() => Promise<Data>

The getData optimization callback can return the connector's complete data tree in a single operation. This is used by Synclet.getData() when available and can dramatically improve performance for full-tree reads. The returned Data object should match the structure of individual Atom reads.

Since

v0.0.0