
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
StormiDB is a lightweight, document-oriented database library that uses cloud object storage (Azure Blob Storage and S3-compatible) as its backend. It's designed for simplicity, scalability, and resilience.
StormiDB is a flexible and efficient NoSQL database library that uses Azure Blob Storage as its backend. It provides a simple interface for performing CRUD operations, creating indexes, and querying data.
npm install stormidb
const { StormiDB, AzureBlobStorage } = require('stormidb');
const connectionString = 'your_azure_storage_connection_string';
const storage = new AzureBlobStorage(connectionString);
const db = new StormiDB(storage);
const stormi = new StormiDB(storage);
const collections = await stormi.getCollections();
console.log(collections); // This will print an array of collection names
const collection = 'users';
const userData = {
name: 'John Doe',
email: 'john@example.com',
age: 30
};
const userId = await db.create(collection, userData);
console.log('Created user with ID:', userId);
const user = await db.findById('users', userId);
console.log('Found user:', user);
const user = await db.findOne('users', { email: 'john@example.com' });
console.log('Found user:', user);
const updatedData = { age: 31 };
await db.update('users', userId, updatedData);
console.log('Updated user age');
await db.delete('users', userId);
console.log('Deleted user');
await db.createIndex('users', 'email', { unique: true });
console.log('Created unique index on email field');
const query = { age: { $gte: 25, $lt: 35 } };
const users = await db.find('users', query);
console.log('Users aged 25-34:', users);
await db.createIndex('users', ['name', 'email'], { type: 'compound' });
console.log('Created compound index on name and email fields');
await db.createIndex('events', 'eventDate', { type: 'date', granularity: 'daily' });
console.log('Created date index on eventDate field');
const startDate = new Date('2023-01-01');
const endDate = new Date('2023-12-31');
const events = await db.find('events', {
eventDate: { $between: [startDate, endDate] }
});
console.log('Events in 2023:', events);
StormiDB supports pagination through the limit and offset options in the find method:
const pageSize = 10;
const page = 1;
const users = await db.find('users', {}, {
limit: pageSize,
offset: (page - 1) * pageSize
});
console.log(`Users on page ${page}:`, users);
To implement pagination in your application:
offset = (pageNumber - 1) * pageSize.find method options.limit and offset.StormiDB supports three types of indexes:
Default Index: Used for general-purpose indexing on a single field.
await db.createIndex('users', 'age');Compound Index: Used for indexing multiple fields together.
await db.createIndex('users', ['lastName', 'firstName'], { type: 'compound' });Date Index: Optimized for date-based queries.
await db.createIndex('events', 'eventDate', { type: 'date', granularity: 'daily' });Choose the appropriate index type based on your query patterns:
Remember that indexes improve query performance but can slow down write operations. Balance the number of indexes with your read/write patterns.
StormiDB uses Azure Blob Storage as its backend, with the following key components:
Collections: Each collection is represented as a container in Azure Blob Storage.
Documents: Each document is stored as a JSON blob within its collection's container.
Indexes: Indexes are stored as separate blobs in a special __indexes container.
CRUD Operations:
Querying:
Indexing:
Concurrency Control: Uses ETags for optimistic locking to handle concurrent modifications.
Pagination: Implemented using the limit and offset options in the query process.
This architecture allows StormiDB to provide a document database-like interface while leveraging the scalability and durability of Azure Blob Storage.
constructor(storage): Creates a new StormiDB instance with the given storage backend.create(collection, data, id = null): Creates a new document in the specified collection.findById(collection, id): Retrieves a document by its ID.find(collection, query, options = {}): Finds documents in the collection that match the query.findOne(collection, query): Finds the first document that matches the query.update(collection, id, data): Updates a document with the specified ID.delete(collection, id): Deletes a document with the specified ID.createIndex(collection, field, options = {}): Creates an index on the specified field(s).dropCollection(collection): Drops the entire collection.constructor(connectionString, options = {}): Creates a new AzureBlobStorage instance.create(collection, id, data): Creates a new document in the specified collection.read(collection, id): Reads a document with the specified ID.update(collection, id, data): Updates a document with the specified ID.delete(collection, id): Deletes a document with the specified ID.find(collection, query, options = {}): Finds documents in the collection that match the query.createIndex(collection, fields, options = {}): Creates an index on the specified field(s).dropCollection(collection): Drops the entire collection.StormiDB supports the following query operators:
$eq: Equality$ne: Not equal$gt: Greater than$gte: Greater than or equal to$lt: Less than$lte: Less than or equal to$in: In array$nin: Not in array$and: Logical AND$or: Logical OR$not: Logical NOT$exists: Field exists$type: Field is of specified type$regex: Regular expression match$between: Between two values (inclusive)Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.
FAQs
StormiDB is a lightweight, document-oriented database library that uses cloud object storage (Azure Blob Storage and S3-compatible) as its backend. It's designed for simplicity, scalability, and resilience.
We found that stormidb demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.