Socket
Socket
Sign inDemoInstall

mps3

Package Overview
Dependencies
2
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    mps3

Provide clientside multiplayer and optimistic updates over any s3-compatible storage API


Version published
Weekly downloads
4
decreased by-33.33%
Maintainers
1
Install size
442 kB
Created
Weekly downloads
 

Readme

Source

mps3

Multiplayer over any s3-compatible storage. Written to provide a fast path for multiplayer without vendor locking. Designed with orthogonality:

  • pluggable storage thanks to the de factor standardization of the s3 API.
  • pluggable auth through axios interceptors (including off-the-shelf solutions like aws4-axios).

You can use this library over S3, R2 or self hosted solutions like Minio

Features

  • Optimistic updates
  • Pluggable authentication
  • Atomic bulk s3 operations
  • Multiplayer
  • Sha256 Checksums

coming soon

  • Offline first

API

subscribe(key, callback)

Receive notifications snapshots of state at the key, delivered to the callback. Local writes will trigger the callback without a network round trip. Remote writes are received in the order they are written to the remote state (monotonic), however, you are not gauranteed to receive every intermediate state, so your communication style should be stateless/declarative (i.e. RESTFul)

How it works

Manifest files the metadata required to resolve snapshot state.

  • all files and their version
  • the update operation (used to resolve concurrent writes)
  • ref to the previous manifest the update was based on

Avoiding mid-air collision

The normal way is is etag and in-none-match headers, but s3 does not support this.

There is no conditional if-none-match PUT request on S3. Thus all writes will make it to the bucket, even those made concurrently. Thus the previous pointer does not necissaril include all writes made in parrallel. Resolution has do be done at read time. We query for all object bersions made from a manifest file to the previous pointer, using the update parameter to rebase over the current state.

FAQs

Last updated on 06 Aug 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc