All Projects → genderev → Assassin

genderev / Assassin

Assassin is a decentralized database that uses background threads to kill slow JavaScript.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Assassin

Trino
Official repository of Trino, the distributed SQL query engine for big data, formerly known as PrestoSQL (https://trino.io)
Stars: ✭ 4,581 (+7936.84%)
Mutual labels:  database, distributed-systems
Cothority
Scalable collective authority
Stars: ✭ 372 (+552.63%)
Mutual labels:  distributed-systems, decentralized
Waltz
Waltz is a quorum-based distributed write-ahead log for replicating transactions
Stars: ✭ 328 (+475.44%)
Mutual labels:  database, distributed-systems
Dbtester
Distributed database benchmark tester
Stars: ✭ 214 (+275.44%)
Mutual labels:  database, distributed-systems
Orbit Db
Peer-to-Peer Databases for the Decentralized Web
Stars: ✭ 6,381 (+11094.74%)
Mutual labels:  database, decentralized
Materialize
Materialize lets you ask questions of your live data, which it answers and then maintains for you as your data continue to change. The moment you need a refreshed answer, you can get it in milliseconds. Materialize is designed to help you interactively explore your streaming data, perform data warehousing analytics against live relational data, or just increase the freshness and reduce the load of your dashboard and monitoring tasks.
Stars: ✭ 3,341 (+5761.4%)
Mutual labels:  database, distributed-systems
Bigchaindb
Meet BigchainDB. The blockchain database.
Stars: ✭ 3,768 (+6510.53%)
Mutual labels:  database, decentralized
Ctlstore
Control Data Store
Stars: ✭ 171 (+200%)
Mutual labels:  database, distributed-systems
Memento
Simple + Powerful interface to the Mnesia Distributed Database 💾
Stars: ✭ 597 (+947.37%)
Mutual labels:  database, distributed-systems
Copycat
A novel implementation of the Raft consensus algorithm
Stars: ✭ 551 (+866.67%)
Mutual labels:  database, distributed-systems
3box Js
3Box JavaScript SDK: User identities, storage, messaging
Stars: ✭ 195 (+242.11%)
Mutual labels:  database, decentralized
Ddia
《Designing Data-Intensive Application》DDIA中文翻译
Stars: ✭ 10,458 (+18247.37%)
Mutual labels:  database, distributed-systems
Gun
An open source cybersecurity protocol for syncing decentralized graph data.
Stars: ✭ 15,172 (+26517.54%)
Mutual labels:  database, decentralized
Layr
A decentralized (p2p) file storage system built atop Kademlia DHT that enforces data integrity, privacy, and availability through sharding, proofs of retrievability, redundancy, and encryption, with smart-contract powered incentive scheme
Stars: ✭ 90 (+57.89%)
Mutual labels:  distributed-systems, decentralized
Scalardb
Universal transaction manager
Stars: ✭ 178 (+212.28%)
Mutual labels:  database, distributed-systems
Software
DeepValueNetwork is a peer-to-peer database network managed and hosted by its community. It contains a browser to render 2D/3D content and allow the creation of scripted applications built on top of the p2p database network and managed by its creators, without intermediary platform.
Stars: ✭ 357 (+526.32%)
Mutual labels:  database, decentralized
Etcd
Distributed reliable key-value store for the most critical data of a distributed system
Stars: ✭ 38,238 (+66984.21%)
Mutual labels:  database, distributed-systems
Etcd Cloud Operator
Deploying and managing production-grade etcd clusters on cloud providers: failure recovery, disaster recovery, backups and resizing.
Stars: ✭ 149 (+161.4%)
Mutual labels:  database, distributed-systems
Corfudb
A cluster consistency platform
Stars: ✭ 539 (+845.61%)
Mutual labels:  database, distributed-systems
Microservices Connector
Inter-Service communication framework, support for microservice architecture and distributed system
Stars: ✭ 17 (-70.18%)
Mutual labels:  distributed-systems, decentralized
ASSASSIN

GitHub license GitHub license1 GitHub license GitHub license2 GitHub license31 GitHub license3 GitHub license4 GitHudk

Background

Usage

Why do we need a new database?

  • No existing decentralized databases are compatible with web workers.

What are web workers?

  • You can outsource JavaScript to web workers.
  • Web workers allow you to run multi-threaded JavaScript.
  • When you run JavaScript in parallel to the main thread, the main thread is free to respond to user input.

Can you explain web workers with a picture?

You can see in the diagram that without web workers (that's the "before" part of the picture), the main thread has to finish processing all JavaScript before responding to user input. With the use of web workers (that's the "after" part of the picture), the main thread can send JavaScript to web workers and then focus on updating the UI.

web worker diagram

Features 💥

💫  Lightweight: Shipped with less than 100 lines of client side code.

⚖️  Decentralized: Your database has no single point of failure. If the server goes down, your data is easy to retrieve.

✨  Works in private browsing: I researched databases like LevelDB, PouchDB, and Gun, which rely on IndexedDB for client-side storage. I wanted these databases to be effective, but I ended up creating this database partly because IndexedDB is disabled in private browsing, which means none of these databases work for me.

Methods:

  • killer.connect(url) - Connect to the server. url refers to the url of the server. You put the server's url into this this function.
  • killer.create(key,value) - Add an entry to the database.
  • killer.update(key,new value) - Update the value of a key in the database.
  • killer.delete(key) - Delete an entry in the database.
  • database - Inside the main thread, you can always access the database through the variable called database.

Get Started: Server

First, you need to make a fly.io account. If you haven't already installed Docker, install it and have the daemon running while you deploy your server. To deploy your server, type this in your terminal and hit "Enter" after the end of each line. shell

You can copy and paste:

cd /path/to/where_you_want_this_to_be_stored
git clone https://github.com/genderev/assassin_server.git
cd assassin_server
flyctl init
flyctl deploy

You can also deploy your server to buddy.works or begin.com on your own, if you want.

Get Started: Browser

You can save this file or you can clone this repo and use assassin.js in the dist folder. assassin.js goes inside the web worker that the main thread posts messages to. You can see an example of how to do this in the source code for the demo.

Architecture:

  • Data Model: Assassin is a key/value store that supports mapping a key to its corresponding value.
  • System Architecture: The DAT protocol distributes and hosts data between many computers, so there is no one location where data is stored. Assassin relies on the the DAT protocol for data persistence. The metadata of the key-value pairs are stored in a distributed trie structure.
  • Isolation Levels: The isolation level is determined by the end user of the database. Assassin is designed to have a low isolation level.
  • Storage Model: Assassin sends data to the server, which then stores the metadata in the distributed file system Hyperdrive, which is built on the DAT protocol. The data itself is distributed and hosted between multiple peers.

Why is it called Assassin?

  • My website currently uses the Gun database.
  • Gun has many features I like and the founder is pretty nice.
  • Gun stopped working for me.
  • Gun's storage adapter RAD relies on IndexedDB, which is disabled in private browsing.
  • Gun syncs data peer to peer through WebRTC, which doesn't function in web workers.
  • Assassin is sort of (seriously, very little) like Gun but for web workers.
  • Gun + worker = Assassin 💥

Demo 🚀

https://assassin-demo.surge.sh

Built with 🔧

  • Hyperdrive - Thanks for the abstraction layer on top of DAT!
  • HTML - For creating the web demo
  • CSS - For styling the web demo
  • JavaScript - For logic
  • Node.js - To serve the logic

Make sure to share your opinion in:

And if you really want to help make Assassin better, make a pull request! I really want to Assassin to have these things, so make a pull request showing how to add them:

  • User authentication

Assassin is open source, and always will be.

Support me on:

Star the repo, Tweet, and share among your friends, teams and contacts!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].