Logo

dev-resources.site

for different kinds of informations.

Assassin ⚡️ - An open source, free database for killing slow webpages

Published at
1/4/2025
Categories
webdev
webperf
javascript
showdev
Author
hanzla-baig
Categories
4 categories in total
webdev
open
webperf
open
javascript
open
showdev
open
Author
11 person written this
hanzla-baig
open
Assassin ⚡️ - An open source, free database for killing slow webpages

Assassin ⚡️ - kill slow webpages

Assassin works to kill database transactions that block the UI.

Database operations can be slow, but no existing databases solve this problem the obvious way: outsource difficult tasks to web workers.

diagram

I wanted to make a database that is:

  • Open source
  • Responsive
  • Decentralized
  • Optimized for web workers
  • Designed for private browsing

That's why I created my own database with JavaScript.

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.
  • 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.
  • Read the database - Inside a web worker or the main thread, you can access the database through the variable called database.

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.
  • Highly Available : Assassin is highly available and eventually consistent. Assassin always saves the last edits made to the database when conflicts arise. This CRDT may change later.

Why is it called Assassin?

  • My personal 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 work in web workers.
  • Assassin is sort of (seriously, very little) like Gun but for web workers.
  • Gun + worker = Assassin 💥

Built with 🔧

  • Hyperdrive - Thanks for building an abstraction layer on top of the DAT protocol!
  • 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 on:

And if you really want to help make Assassin better, contribute to the GitHub repo!

Assassin is open source, and always will be.

Support me on:

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

webperf Article's
30 articles in total
Favicon
Redefining Web Performance Standards with INP
Favicon
How to avoid frontend tech making us resentful
Favicon
Understanding PHP-FPM: Key Differences from Traditional PHP Processes and Benefits
Favicon
How Mentimeter deliver reliable live experiences at scale
Favicon
The Art of Prefetching and Preloading: Enhancing Web Performance
Favicon
The curious case of the paragraph with the bad CLS
Favicon
JavaScript Frameworks - Heading into 2025
Favicon
Technical SEO for Developers: Mastering Site Structure and Performance
Favicon
Extending Lighthouse for custom image and video optimization analysis
Favicon
Assassin ⚡️ - An open source, free database for killing slow webpages
Favicon
A Comprehensive Guide to Web Vitals: Metrics That Matter for Performance
Favicon
Why should you care about website performance?
Favicon
Screener.in Search API: A Performance Checkup! 🔎
Favicon
How Sportsbet handles 4.5M daily chat messages on its 'Bet With Mates' platform
Favicon
Enhancing React Performance with Concurrent Rendering
Favicon
Optimizing React Performance: Avoiding Unnecessary Re-renders
Favicon
Master React Profiler: Optimize Your App's Performance
Favicon
Lightweight, Transparent, Animated: Get All of Them by WebP Format
Favicon
Prerender Pages in Browser For Faster Page Load
Favicon
How we optimized perceived performance to improve our KPIs: a Hotjar case study
Favicon
Sites speed optimisation is a destination, not a journey
Favicon
How to Build a High-Performance WordPress Website: A Developer’s Guide
Favicon
Performance Optimization in React
Favicon
Subsequent Page Load Optimization 🚀
Favicon
How to Build Blazing Fast Websites with Any Framework
Favicon
Everything to know about Mobile App Performance Test Tools, Metrics, & Techniques
Favicon
Efficient State Management in Next.js: Best Practices for Scalable Applications
Favicon
Top 5 Tips to Supercharge Your Express.js App for Lightning-Fast Performance
Favicon
A useState performance tip you may not have known
Favicon
🚀 V8 Engine Secrets How We Slashed Memory Usage by 66% with TypedArrays

Featured ones: