Node-redlock Alternatives
Similar projects and alternatives to node-redlock based on common topics and language
-
express-mongodb-rest-api-boilerplate
A boilerplate for Node.js apps / Rest API / Authentication from scratch - express, mongodb (mongoose). Typescript
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
-
Deno-Redlock
Deno's first lightweight, secure distributed lock manager utilizing the Redlock algorithm
NOTE:
The number of mentions on this list indicates mentions on common posts plus user suggested alternatives.
Hence, a higher number means a better node-redlock alternative or higher similarity.
node-redlock reviews and mentions
Posts with mentions or reviews of node-redlock.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2024-02-28.
-
Build an Idempotent API in Node.js with Redis
async function create(req, res) { let lock; try { // Try to acquire the lock lock = await service.urlService.acquireLock( "URL:CREATE:ExclusiveLock", 100 ); const { longURL } = req.body; // Check if the mapping already exists const mapping = await service.urlService.findByLongURL(longURL); if (mapping) { return res.status(HTTP_STATUS_CODES.SUCCESS).json({ status: true, message: "Short slug created successfully", data: { slug: mapping.slug }, }); } // New long URL, generate a new and unique slug const slug = service.urlService.generateNewSlug(); // save short URL <> long URL mapping to the database await service.urlService.saveToDB(slug, longURL); // Return the newly generated short slug return res.status(HTTP_STATUS_CODES.SUCCESS).json({ status: true, message: "Short slug created successfully", data: { slug }, }); } catch (err) { return res.status(HTTP_STATUS_CODES.INTERNAL_SERVER_ERROR).json({ status: false, message: "Could not create short slug", error: err, }); } finally { /** * Manually release the lock when the operation is complete * * NOTE: Redlock's release method is not a no-op, it throws an error if you try to release an already expired lock ([more here](https://github.com/mike-marcacci/node-redlock/issues/168#issuecomment-1165700540)). Setting a small TTL usually triggers this unexpected behavior. * As a workaround, we're ignoring the errors from lock.release() */ if (lock) await lock.release().catch(() => {}); } }
-
Advanced caching mechanisms using distributed locks and async pub/sub systems.
Example: The following example uses Node.js npm module Redlock, which implements Redlock. Redlock is available as a package in many languages.
Stats
Basic node-redlock repo stats
2
1,729
3.7
3 months ago
mike-marcacci/node-redlock is an open source project licensed under MIT License which is an OSI approved license.
The primary programming language of node-redlock is TypeScript.
Popular Comparisons
Sponsored
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com