Giter Club home page Giter Club logo

kwil-extension-db-sync's Introduction

Kwil DB Sync & Restore

This tool includes 2 repositories: one is for an extension and the other is for a gRPC server that runs as a container alongside the sync extension. This tool saves database actions to Arweave (through Bundlr) along with specific tags enabling actions to be easily traced and synced with other Kwil Providers running the service.

gRPC Server: https://github.com/martin-opensky/kwil-db-sync-server

When the DB Sync extension is initialised it communicates with the Sync Server to restore any actions that exist on Arweave for that DB ID. It does this using the Bundlr GraphQL API and the server executes any found actions on the local DB. This enables actions to be re-played when a server has been taken down or when the schema is re-deployed on another server.

Once the initial actions have been restored, the Sync Server will continue to listen for transactions on the GQL API. This enables another Provider to run on a different server and submit actions to the same DB. By running 2 or more Providers with this service, specific databases can remain synced. If all Providers were to be destroyed, there is still the option to fully restore the DB, given the permanent storage of actions on Arweave.

Each action that is synced must have a private equivalent so that the data can be restored by the DB Owner / Admin only. This is as certain information such as @caller, $date, $id etc could not be replayed successfully at another time by different account.

Once the save_action method is called on the extension the data is saved to Arweave and can be found through the Bundlr GQL API.

The file stored on Arweave contains information about which action to run and what parameters to use:

Another server can deploy the same schema and remain in sync with the original DB by supplying the ID when registering the extension:

kwil-extension-db-sync's People

Contributors

martin-opensky avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.