Skip to main content

Backend Strategies

Replicache defines abstract push and pull endpoints that servers must implement to sync. There are a number of possible strategies to implement these endpoints with different tradeoffs.

The main difference between the strategies is how they calcuate the patch required by the pull endpoint. Different approaches to calculating this patch require different state to be stored in the backend database, affect the push and pull implementations, and also some features Replicache can support.


StrategyWhen to UsePush PerformancePull PerformanceImplementationPartial SyncDynamic Auth
ðŸĪŠ ResetFor very tiny or slowly-updating applications.👍🏞 Little overhead compared to standard web app👎🏞 Read and transmit entire client view on each pull👍🏞 Trivial👍🏞 Automatic👍🏞 Automatic
🌏 Global VersionSimple apps with low concurrency and no need for partial sync or dynamic auth👎🏞 Limited to about 50/second👍🏞 Efficient to compute patch👍🏞 Trivial👎🏞 Possible but inefficient.ðŸĪ·ðŸŧ Extra effort.
ðŸ›ļ Per-Space VersionSimple apps that can be partitioned easily along some boundary like organization or account👎🏞 Limited to about 50/second/space👍🏞 Efficient to compute patch👍🏞 Trivial👎🏞 Possible but inefficient.ðŸĪ·ðŸŧ Extra effort.
ðŸšĢ Row VersioningApps that need greater concurrency, partial sync, or dynamic auth👍🏞 Little overhead compared to standard web app👍🏞 More overhead than standard web app but scales wellðŸĪ·ðŸŧ Moderately difficult👍🏞 Automatic👍🏞 Automatic