axiodb 2.30.88 → 2.30.90
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +229 -32
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,44 +1,241 @@
|
|
|
1
|
-
# AxioDB:
|
|
1
|
+
# AxioDB: The Next-Generation Caching Database for Node.js
|
|
2
2
|
|
|
3
3
|
[](https://badge.fury.io/js/axiodb)
|
|
4
4
|
[](https://github.com/AnkanSaha/AxioDB/actions/workflows/github-code-scanning/codeql)
|
|
5
5
|
[](https://socket.dev/npm/package/axiodb)
|
|
6
6
|
[](https://github.com/AnkanSaha/AxioDB/actions/workflows/Push.yml)
|
|
7
7
|
|
|
8
|
-
AxioDB is a blazing-fast,
|
|
9
|
-
|
|
10
|
-
👉 **[Official Documentation](https://axiodb.site/)**: Access
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
- **
|
|
29
|
-
- **
|
|
30
|
-
- **
|
|
31
|
-
- **
|
|
32
|
-
- **
|
|
33
|
-
- **
|
|
34
|
-
- **
|
|
35
|
-
- **
|
|
36
|
-
- **
|
|
37
|
-
- **
|
|
38
|
-
- **
|
|
8
|
+
> **AxioDB** is a blazing-fast, production-ready caching database designed for modern Node.js applications, APIs, and frontend frameworks. It combines intelligent memory management, secure file-based storage, and seamless integration with a developer-friendly API. AxioDB was created to solve the pain points of traditional cache management, manual file I/O, and unreliable global object storage—delivering a simple, fast, and reliable solution for projects of any size.
|
|
9
|
+
|
|
10
|
+
👉 **[Official Documentation](https://axiodb.site/)**: Access full guides, examples, and API references.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## � Why AxioDB Exists
|
|
15
|
+
|
|
16
|
+
As a Node.js backend engineer, setting up Redis for small prototypes, struggling with manual file I/O, and relying on global object storage for caching was inefficient and unreliable. AxioDB was born to:
|
|
17
|
+
|
|
18
|
+
- Provide a simple, fast, and reliable caching solution for any project size
|
|
19
|
+
- Offer proper algorithms and memory management for production environments
|
|
20
|
+
- Deliver sub-millisecond response times with intelligent architecture
|
|
21
|
+
- Eliminate the complexity of traditional cache management systems
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## 🚀 Key Features
|
|
26
|
+
|
|
27
|
+
- **Intelligent Caching:** Advanced `InMemoryCache` system with automatic eviction policies and smart data persistence
|
|
28
|
+
- **Production Security:** Enterprise-grade AES-256 encryption for sensitive cached data and secure access controls
|
|
29
|
+
- **Frontend Integration:** Seamless integration with React, Vue, Angular, and all modern frontend frameworks
|
|
30
|
+
- **Chainable Query Methods:** Fluent API for real-time data retrieval and filtering (`.query()`, `.Sort()`, `.Limit()`, `.Skip()`)
|
|
31
|
+
- **Aggregation Pipelines:** MongoDB-compatible aggregation operations (`$match`, `$group`, `$sort`, `$project`, etc.)
|
|
32
|
+
- **Bulk Operations:** High-performance bulk insert, update, and delete operations (`insertMany`, `UpdateMany`, `DeleteMany`)
|
|
33
|
+
- **Tree-like Structure:** Hierarchical data storage for efficient retrieval and organization
|
|
34
|
+
- **Auto Indexing:** Optimized indexes on document IDs for lightning-fast queries
|
|
35
|
+
- **Single Instance Architecture:** Unified management for unlimited databases, collections, and documents
|
|
36
|
+
- **Web-Based GUI Dashboard:** Visual database administration, query execution, and real-time monitoring at `localhost:27018`
|
|
37
|
+
- **Zero-Configuration Setup:** Serverless architecture—install and start building instantly
|
|
38
|
+
- **Custom Database Path:** Flexible storage locations for better project organization
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## 🏆 Performance Comparison
|
|
43
|
+
|
|
44
|
+
| Feature | Traditional JSON DBMS | AxioDB |
|
|
45
|
+
| ----------- | --------------------- | ---------------------- |
|
|
46
|
+
| Storage | Single JSON file | Tree-structured files |
|
|
47
|
+
| Caching | None | InMemoryCache |
|
|
48
|
+
| Indexing | None | Auto documentId |
|
|
49
|
+
| Query Speed | Linear | Sub-millisecond (O(1)) |
|
|
50
|
+
| Scalability | Poor | Excellent |
|
|
51
|
+
|
|
52
|
+
**Benchmark:** AxioDB's documentId search is up to **10x faster** than traditional JSON DBMSs (tested with 1M+ documents).
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## 🛡️ Security
|
|
57
|
+
|
|
58
|
+
- **AES-256 Encryption:** Optional for collections, with auto-generated or custom keys
|
|
59
|
+
- **Secure Storage:** Data stored in `.axiodb` files with file-level isolation and locking
|
|
60
|
+
- **InMemoryCache:** Minimizes disk reads and exposure of sensitive data
|
|
61
|
+
- **Configurable Access Controls:** Protects against unauthorized access
|
|
62
|
+
- **Automatic Cache Invalidation:** Ensures stale data is never served
|
|
63
|
+
|
|
64
|
+
**Best Practices:**
|
|
65
|
+
|
|
66
|
+
- Use strong, unique encryption keys
|
|
67
|
+
- Never hardcode keys—use environment variables or secure key management
|
|
68
|
+
- Implement proper access controls and regular backups
|
|
69
|
+
|
|
70
|
+
For vulnerabilities, see [SECURITY.md](SECURITY.md).
|
|
39
71
|
|
|
40
72
|
---
|
|
41
73
|
|
|
74
|
+
## ⚙️ Architecture & Internal Mechanisms
|
|
75
|
+
|
|
76
|
+
### Tree Structure for Fast Data Retrieval
|
|
77
|
+
|
|
78
|
+
Hierarchical storage enables O(1) document lookups, logarithmic query time, and efficient indexing. Each document is isolated in its own file, supporting selective loading and easy backup.
|
|
79
|
+
|
|
80
|
+
### Worker Threads for Parallel Processing
|
|
81
|
+
|
|
82
|
+
Leverages Node.js Worker Threads for non-blocking I/O, multi-core utilization, and scalable performance—especially for read operations.
|
|
83
|
+
|
|
84
|
+
### Two-Pointer Searching Algorithm
|
|
85
|
+
|
|
86
|
+
Optimized for range queries and filtered searches, minimizing memory usage and computational overhead.
|
|
87
|
+
|
|
88
|
+
### Query Processing Pipeline
|
|
89
|
+
|
|
90
|
+
Intelligent caching, parallelized processing, lazy evaluation, and just-in-time query optimization for maximum throughput.
|
|
91
|
+
|
|
92
|
+
### Single Instance Architecture
|
|
93
|
+
|
|
94
|
+
Ensures ACID compliance, strong data consistency, and simplified deployment. One AxioDB instance manages all databases and collections.
|
|
95
|
+
|
|
96
|
+
### Designed for Node.js Developers
|
|
97
|
+
|
|
98
|
+
Native JavaScript API, promise-based interface, lightweight dependency, and simple learning curve.
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## 📦 Installation
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
npm install axiodb@latest --save
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## 🛠️ Usage
|
|
111
|
+
|
|
112
|
+
> **Note:** Only one AxioDB instance should be initialized per application for consistency and security.
|
|
113
|
+
|
|
114
|
+
### Collection Creation Options
|
|
115
|
+
|
|
116
|
+
```javascript
|
|
117
|
+
createCollection(
|
|
118
|
+
name: string, // Name of the collection (required)
|
|
119
|
+
isSchemaNeeded: boolean, // Whether schema validation is needed (required)
|
|
120
|
+
schema?: object | any, // Schema definition (required if isSchemaNeeded is true, empty {} if false)
|
|
121
|
+
isEncrypted?: boolean, // Whether to encrypt the collection (default: false)
|
|
122
|
+
encryptionKey?: string // Custom encryption key (optional)
|
|
123
|
+
)
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Example
|
|
127
|
+
|
|
128
|
+
```javascript
|
|
129
|
+
const { AxioDB, SchemaTypes } = require("axiodb");
|
|
130
|
+
const db = new AxioDB();
|
|
131
|
+
const schema = {
|
|
132
|
+
name: SchemaTypes.string().required(),
|
|
133
|
+
age: SchemaTypes.number().min(0).required(),
|
|
134
|
+
email: SchemaTypes.string().email().required(),
|
|
135
|
+
};
|
|
136
|
+
const userDB = await db.createDB("MyDB");
|
|
137
|
+
const userCollection = await userDB.createCollection(
|
|
138
|
+
"Users",
|
|
139
|
+
true,
|
|
140
|
+
schema,
|
|
141
|
+
true,
|
|
142
|
+
"mySecretKey",
|
|
143
|
+
);
|
|
144
|
+
await userCollection.insert({
|
|
145
|
+
name: "John Doe",
|
|
146
|
+
email: "john.doe@example.com",
|
|
147
|
+
age: 30,
|
|
148
|
+
});
|
|
149
|
+
const results = await userCollection
|
|
150
|
+
.query({ age: { $gt: 25 } })
|
|
151
|
+
.Limit(10)
|
|
152
|
+
.Sort({ age: 1 })
|
|
153
|
+
.exec();
|
|
154
|
+
console.log(results);
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## 🌟 Advanced Features
|
|
160
|
+
|
|
161
|
+
- **Multiple Databases:** Architect scalable apps with multiple databases and collections, each with specific schemas and security
|
|
162
|
+
- **Aggregation Pipelines:** Complex data processing with MongoDB-like syntax
|
|
163
|
+
- **Encryption:** Military-grade AES-256 encryption for collections
|
|
164
|
+
- **Bulk Operations:** Efficient batch insert, update, and delete
|
|
165
|
+
- **Flexible Collection Types:** Basic, encrypted, schema-only, or both
|
|
166
|
+
- **Custom Query Operators:** `$gt`, `$lt`, `$in`, `$regex`, etc.
|
|
167
|
+
- **Schema Validation:** Type, field requirements, and value constraints
|
|
168
|
+
- **Performance Optimization:** Fast lookups, pagination, and intelligent caching
|
|
169
|
+
- **Enterprise Data Management:** Bulk operations, conditional updates, atomic transactions
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
## 📖 API Reference
|
|
174
|
+
|
|
175
|
+
### AxioDB
|
|
176
|
+
|
|
177
|
+
- `createDB(dbName: string, schemaValidation: boolean = true): Promise<Database>`
|
|
178
|
+
- `deleteDatabase(dbName: string): Promise<SuccessInterface | ErrorInterface>`
|
|
179
|
+
|
|
180
|
+
### Database
|
|
181
|
+
|
|
182
|
+
- `createCollection(name: string, schema: object, crypto?: boolean, key?: string): Promise<Collection>`
|
|
183
|
+
- `deleteCollection(name: string): Promise<SuccessInterface | ErrorInterface>`
|
|
184
|
+
- `getCollectionInfo(): Promise<SuccessInterface>`
|
|
185
|
+
|
|
186
|
+
### Collection
|
|
187
|
+
|
|
188
|
+
- `insert(document: object): Promise<SuccessInterface | ErrorInterface>`
|
|
189
|
+
- `query(query: object): Reader`
|
|
190
|
+
- `update(query: object): Updater`
|
|
191
|
+
- `delete(query: object): Deleter`
|
|
192
|
+
- `aggregate(pipeline: object[]): Aggregation`
|
|
193
|
+
|
|
194
|
+
### Reader
|
|
195
|
+
|
|
196
|
+
- `Limit(limit: number): Reader`
|
|
197
|
+
- `Skip(skip: number): Reader`
|
|
198
|
+
- `Sort(sort: object): Reader`
|
|
199
|
+
- `setCount(count: boolean): Reader`
|
|
200
|
+
- `setProject(project: object): Reader`
|
|
201
|
+
- `exec(): Promise<SuccessInterface | ErrorInterface>`
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
## ⚠️ Current Limitations
|
|
206
|
+
|
|
207
|
+
- **Manual Relationship Management:** No built-in ODM relationship tools; references between collections must be handled manually
|
|
208
|
+
- **Workload Optimization:** Best for moderate to high-traffic apps; extremely high-throughput scenarios may require specialized solutions
|
|
209
|
+
- **Main Thread Processing:** Ensures consistency but may need optimization for CPU-intensive queries
|
|
210
|
+
- **Query Complexity:** Comprehensive MongoDB-like operations; some advanced patterns are in development
|
|
211
|
+
- **Single-Node Architecture:** Distributed replication and clustering planned for future releases
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
## 🔮 Future Roadmap
|
|
216
|
+
|
|
217
|
+
- **Data Export & Import:** JSON, CSV, and native formats
|
|
218
|
+
- **Enhanced Web GUI:** Real-time analytics, visual query builder, performance monitoring
|
|
219
|
+
- **Comprehensive Documentation:** Tutorials, interactive examples, and API references
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
## 🤝 Contributing
|
|
224
|
+
|
|
225
|
+
We welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
## 📜 License
|
|
230
|
+
|
|
231
|
+
MIT License. See [LICENSE](LICENSE).
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
## 🙌 Acknowledgments
|
|
236
|
+
|
|
237
|
+
Special thanks to all contributors and supporters of AxioDB. Your feedback and contributions make this project better!
|
|
238
|
+
|
|
42
239
|
## ⚠️ Current Limitations
|
|
43
240
|
|
|
44
241
|
While AxioDB offers many powerful features, there are some limitations to consider:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "axiodb",
|
|
3
|
-
"version": "2.30.
|
|
3
|
+
"version": "2.30.90",
|
|
4
4
|
"description": "A blazing-fast, lightweight, and scalable nodejs package based DBMS for modern application. Supports schemas, encryption, and advanced query capabilities.",
|
|
5
5
|
"main": "./lib/config/DB.js",
|
|
6
6
|
"types": "./lib/config/DB.d.ts",
|