npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

tissue-roll

v5.0.2

Published

Very simple read/write database with a no-sql.

Downloads

365

Readme

Tissue Roll

node.js workflow

Very simple read/write database with a NoSQL.
It's written in JavaScript using pure Node.js API and pretty easy and small.

tissue-roll comes in two flavors: key-value database and document-oriented database.
You have the freedom to choose based on your needs, but most users will likely prefer the document-oriented database.

For details on how to use each database, please refer to the links below.

Why

Why use tissue-roll?

JavaScript has numerous fantastic database libraries available, but at times, they can seem overly complex.
This particular solution is ideal for situations where you need to store data for an extended period, making it well-suited for less critical data that doesn't require a rigid structure. Or, when everything is too bothersome.

Why should I use this instead of JSON?

When the JSON files get large, quick data read and write operations can become challenging.
tissue-roll handles data input and output in real-time, ensuring fast and lightweight performance. Check the performance tests below.

How

How does it differ from a Map object?

The Map object is memory-based, while tissue-roll is file system-based.

How does tissue-roll work?

tissue-roll manages files by breaking them into blocks called pages. You can set the page size when creating the database.

When you insert data, the ID you get back includes information about where the data is stored on the page. This makes it possible to work with large files quickly. This value could be seen by users, but it's encrypted to make it hard to predict. This way, it stops users from trying to steal data by requesting fake record IDs.

How many can I own data?

tissue-roll can make a unsigned 32bit range of page block. This is a 4,294,967,296. And each page can own unsigned 32bit range of records also. So you can theoretically insert 4,294,967,295 * 4,294,967,295 records.

Performance Test

The test result is the average value from 10 attempts.

tissue-roll supports two databases, and this test tested the core functions of data reading/writing of the two databases. Therefore, it's not a perfect test result, but it's enough to show the time complexity.

If you're adding data to the database in real-time, the results would be as follows:

WRITE

For a little data, JSON is faster, but when you've got a big file, it's the other way around, and the gap gets bigger.

|WRITE|JSON|TISSUE-ROLL|RESULT| |---|---|---|---| |1,000 times|1014ms|1990ms|-49% Slower| |2,000 times|2200ms|3800ms|-42% Slower| |4,000 times|5674ms|7509ms|-24% Slower| |8,000 times|15332ms|14788ms|+4% Faster| |16,000 times|46617ms|29755ms|+57% Faster|

READ

tissue-roll maintains a steady reading speed no matter the database size. In contrast, JSON files slow down as they get bigger.

|READ|JSON|TISSUE-ROLL|RESULT| |---|---|---|---| |from 8,000 records|1.8ms|5.6ms|-68% Slower| |from 16,000 records|4ms|2ms|+100% Faster| |from 32,000 records|5.4ms|2.2ms|+145% Faster| |from 64,000 records|11.4ms|2ms|+470% Faster| |from 128,000 records|26.4ms|2.6ms|+915% Faster|

RESULT

WRITE READ

NOTICE!

This is the usual case, but the results can be different depending on programming optimizations. Please note that this test takes a square of the sample size to easily show the error with a small number of tests. Therefore, the graph appears to increase exponentially, but in terms of time complexity, JSON has O(n), and tissue-roll has a speed of O(1).

Install

|Site|Link| |---|---| |NPM|View| |Github|View|

License

MIT LICENSE