npm install hamt-sharding

JavaScript implementation of sharding using hash array mapped tries

About hamt-sharding

The npm package "hamt-sharding" is a cutting-edge JavaScript implementation designed to enhance the efficiency and scalability of data management systems through the use of sharding with hash array mapped tries (HAMT). Sharding is a database architecture pattern that partitions data across multiple servers, thus enhancing performance and scalability. By implementing HAMT, "hamt-sharding" provides an efficient way of storing and retrieving data, allowing for high-speed access and manipulation. This makes it an excellent choice for developers working on applications that require handling large datasets or high transaction rates, ensuring that data is both accessible and manageable.

To utilize the "hamt-sharding" module in your project, the installation process is straightforward and can be accomplished by running the command `npm install hamt-sharding`. This command integrates the package into your Node.js environment, setting you up to leverage its powerful sharding capabilities. Once installed, developers can easily implement the module's functionality to distribute data loads evenly across servers, which can significantly reduce the latency and increase the throughput of database operations. The "hamt-sharding" package is also well-documented, making it accessible for developers to integrate and adapt its capabilities within their projects effectively.

The "hamt-sharding" package is not only robust but also versatile. It supports various features that are crucial for modern applications, such as fault tolerance and data distribution efficiency. The use of hash array mapped tries ensures that the sharding is done in a way that minimizes collision and maximizes performance. For developers looking to build scalable and efficient applications, integrating "hamt-sharding" can be a game-changer. The package's ability to handle large volumes of data efficiently makes it an indispensable tool in the arsenal of modern software development, particularly for applications that require reliable and fast data retrieval systems.

More from ipfs

ipfs npm packages

Find the best node modules for your project.

Search npm

interface-datastore

datastore...

Read more
,

ipfs-unixfs

JavaScript implementation of IPFS' unixfs (a Unix FileSystem representation on top of a...

Read more
,

hamt-sharding

JavaScript implementation of sharding using hash array mapped...

Read more
,

ipfs-unixfs-importer

JavaScript implementation of the UnixFs importer used by...

Read more
,

is-ipfs

A set of utilities to help identify IPFS resources on the...

Read more
,

ipfs-unixfs-exporter

JavaScript implementation of the UnixFs exporter used by...

Read more
,

blockstore-core

Contains various implementations of the API contract described in...

Read more
,

ipfs-car

Convert files to content-addressed archives (...

Read more
,

datastore-core

Wrapper implementation for...

Read more
,

ipns

IPNS record...

Read more
,

datastore-level

Datastore implementation with level(up|down)...

Read more
,

ipfs-bitswap

JavaScript implementation of the Bitswap data exchange protocol used by...

Read more

Dependencies

Core dependencies of this npm package and its dev dependencies.

sparse-array, uint8arrays, aegir, it-length, multihashing-async

Documentation

A README file for the hamt-sharding code repository. View Code

hamt-sharding

codecov CI

JavaScript implementation of sharding using hash array mapped tries

About

A Hash Mapped Trie implementation for JavaScript.

This is used by @helia/unixfs for it's HAMT-sharded directory implementation.

Example

import { createHAMT } from 'hamt-sharding'
import crypto from 'crypto-promise'

// decide how to hash buffers made from keys, can return a Promise
const hashFn = async (buf) => {
  return crypto
    .createHash('sha256')
    .update(buf)
    .digest()
}

const bucket = createHAMT({
  hashFn: hashFn
})

await bucket.put('key', 'value')

const output = await bucket.get('key')
// output === 'value'

Install

$ npm i hamt-sharding

Browser <script> tag

Loading this module through a script tag will make it's exports available as HamtSharding in the global namespace.

<script src="https://unpkg.com/hamt-sharding/dist/index.min.js"></script>

API Docs

License

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.