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 🙏

© 2026 – Pkg Stats / Ryan Hefner

sails-riak

v0.0.1

Published

Riak adapter for Sails.js

Readme

image_squidhome@2x.png

Riak DB adapter for Sails.js

Implementation of a Riak database adapter for the Sails.js web-framework.

Current status

This is only the first implementation attempt. The main focus was to make sure that all the unit-test defined by the sails.js NPM module pass.

Known limitations

  1. Support for auto-increment capabilities are not natively supported by a Riak database. These capabilities are emulated in software and the solution will not scale to a multi-instance/cluster setup.
  2. All model creation operations for a particular collection are serialized. This ensures that the auto-increment value for that collection remains consistent. However, it is possible to create two models in parallel if the models do not belong to the same collection.
  3. Transactions are also supported, but the Riak back-end must be configured to have the "search" functionality enabled. This means that one needs to edit the app.config file and enable the "search" support for the Riak instance.

Running the tests

  1. Install Riak on your machine. Enable the "search" support by editing the app.config file.
  2. Link the sails-riak module into the sails.js module.
  3. Modify the User.js file in the tests folder to use the sails-riak adapter.
  4. Run the sails.js tests.

Test results

All tests should just pass except two test-cases. These test cases have been slightly altered in order to make them pass. Below is a short description of these changes

stream.test.js - 'should grab the same set of data as findAll'

The problem is that the test assumes that both the stream and the findAll APIs provide the same list of models in the same order. This is why a string representation is created for the results provided by these two APIs, and it's this string representation that is subject to the equality test.

This is only half true for the case of a Riak back-end. Both the stream and 'findAll' APIs provide the same list of models, but not necessarily in the same order. This is why the test case has been altered so that the equality test is applied on the sorted-list of models provided by each of the two APIs.

transactions.test.js - 'should support 200 simultaneous dummy transactions'

I was simply unable to squeeze the required performance out of the transactions engine to support 200 simultaneous transactions in a time-span of 8 secs. With the default implementation I was able to do a maximum of 40 transactions. This is why I had to implement a custom transaction logic where the search for locks is performed using Riak's own search capabilities. With this new implementation I was able to sustain up to 120 simultaneous transactions.

For this reason I modified the test case to reduce the 200 simultaneous transactions limit to 100.

All these modifications are available at: https://github.com/andreifecioru/sails

Future work

I need to find a way to add support for Riak-specific features such as links, bucket configuration, etc.