s3db.js 9.3.0 → 10.0.1
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 +72 -13
- package/dist/s3db.cjs.js +2342 -540
- package/dist/s3db.cjs.js.map +1 -1
- package/dist/s3db.es.js +2341 -541
- package/dist/s3db.es.js.map +1 -1
- package/package.json +1 -1
- package/src/client.class.js +8 -7
- package/src/concerns/high-performance-inserter.js +285 -0
- package/src/concerns/partition-queue.js +171 -0
- package/src/errors.js +10 -2
- package/src/partition-drivers/base-partition-driver.js +96 -0
- package/src/partition-drivers/index.js +60 -0
- package/src/partition-drivers/memory-partition-driver.js +274 -0
- package/src/partition-drivers/sqs-partition-driver.js +332 -0
- package/src/partition-drivers/sync-partition-driver.js +38 -0
- package/src/plugins/audit.plugin.js +4 -4
- package/src/plugins/backup.plugin.js +380 -105
- package/src/plugins/backup.plugin.js.backup +1 -1
- package/src/plugins/cache.plugin.js +203 -150
- package/src/plugins/eventual-consistency.plugin.js +1012 -0
- package/src/plugins/fulltext.plugin.js +6 -6
- package/src/plugins/index.js +2 -0
- package/src/plugins/metrics.plugin.js +13 -13
- package/src/plugins/replicator.plugin.js +108 -70
- package/src/plugins/replicators/s3db-replicator.class.js +7 -3
- package/src/plugins/replicators/sqs-replicator.class.js +11 -3
- package/src/plugins/s3-queue.plugin.js +776 -0
- package/src/plugins/scheduler.plugin.js +226 -164
- package/src/plugins/state-machine.plugin.js +109 -81
- package/src/resource.class.js +205 -0
- package/PLUGINS.md +0 -5036
package/README.md
CHANGED
|
@@ -329,11 +329,65 @@ const s3db = new S3db({
|
|
|
329
329
|
});
|
|
330
330
|
```
|
|
331
331
|
|
|
332
|
-
#### 3.
|
|
332
|
+
#### 3. MinIO (Self-hosted S3)
|
|
333
333
|
```javascript
|
|
334
|
+
// MinIO running locally (note: http:// protocol and port)
|
|
334
335
|
const s3db = new S3db({
|
|
335
|
-
connectionString: "
|
|
336
|
-
|
|
336
|
+
connectionString: "http://minioadmin:minioadmin@localhost:9000/mybucket/databases/myapp"
|
|
337
|
+
});
|
|
338
|
+
|
|
339
|
+
// MinIO on custom server
|
|
340
|
+
const s3db = new S3db({
|
|
341
|
+
connectionString: "http://ACCESS_KEY:SECRET_KEY@minio.example.com:9000/BUCKET_NAME/databases/myapp"
|
|
342
|
+
});
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
#### 4. Digital Ocean Spaces (SaaS)
|
|
346
|
+
```javascript
|
|
347
|
+
// Digital Ocean Spaces (NYC3 datacenter) - uses https:// as it's a public service
|
|
348
|
+
const s3db = new S3db({
|
|
349
|
+
connectionString: "https://SPACES_KEY:SPACES_SECRET@nyc3.digitaloceanspaces.com/SPACE_NAME/databases/myapp"
|
|
350
|
+
});
|
|
351
|
+
|
|
352
|
+
// Other regions available: sfo3, ams3, sgp1, fra1, syd1
|
|
353
|
+
const s3db = new S3db({
|
|
354
|
+
connectionString: "https://SPACES_KEY:SPACES_SECRET@sgp1.digitaloceanspaces.com/SPACE_NAME/databases/myapp"
|
|
355
|
+
});
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
#### 5. LocalStack (Local AWS testing)
|
|
359
|
+
```javascript
|
|
360
|
+
// LocalStack for local development/testing (http:// with port 4566)
|
|
361
|
+
const s3db = new S3db({
|
|
362
|
+
connectionString: "http://test:test@localhost:4566/mybucket/databases/myapp"
|
|
363
|
+
});
|
|
364
|
+
|
|
365
|
+
// LocalStack in Docker container
|
|
366
|
+
const s3db = new S3db({
|
|
367
|
+
connectionString: "http://test:test@localstack:4566/mybucket/databases/myapp"
|
|
368
|
+
});
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
#### 6. Other S3-Compatible Services
|
|
372
|
+
```javascript
|
|
373
|
+
// Backblaze B2 (SaaS - uses https://)
|
|
374
|
+
const s3db = new S3db({
|
|
375
|
+
connectionString: "https://KEY_ID:APPLICATION_KEY@s3.us-west-002.backblazeb2.com/BUCKET_NAME/databases/myapp"
|
|
376
|
+
});
|
|
377
|
+
|
|
378
|
+
// Wasabi (SaaS - uses https://)
|
|
379
|
+
const s3db = new S3db({
|
|
380
|
+
connectionString: "https://ACCESS_KEY:SECRET_KEY@s3.wasabisys.com/BUCKET_NAME/databases/myapp"
|
|
381
|
+
});
|
|
382
|
+
|
|
383
|
+
// Cloudflare R2 (SaaS - uses https://)
|
|
384
|
+
const s3db = new S3db({
|
|
385
|
+
connectionString: "https://ACCESS_KEY:SECRET_KEY@ACCOUNT_ID.r2.cloudflarestorage.com/BUCKET_NAME/databases/myapp"
|
|
386
|
+
});
|
|
387
|
+
|
|
388
|
+
// Self-hosted Ceph with S3 gateway (http:// with custom port)
|
|
389
|
+
const s3db = new S3db({
|
|
390
|
+
connectionString: "http://ACCESS_KEY:SECRET_KEY@ceph.internal:7480/BUCKET_NAME/databases/myapp"
|
|
337
391
|
});
|
|
338
392
|
```
|
|
339
393
|
|
|
@@ -732,16 +786,21 @@ await users.insert({ name: "John", email: "john@example.com" });
|
|
|
732
786
|
|
|
733
787
|
#### Available Plugins
|
|
734
788
|
|
|
735
|
-
- **💾 Cache Plugin** - Intelligent caching (memory/S3) for performance
|
|
736
|
-
- **💰 Costs Plugin** - Real-time AWS S3 cost tracking
|
|
737
|
-
- **🔍 FullText Plugin** - Advanced search with automatic indexing
|
|
738
|
-
- **📊 Metrics Plugin** - Performance monitoring and analytics
|
|
739
|
-
- **🔄 Replicator Plugin** - Multi-target replication (S3DB, SQS, BigQuery, PostgreSQL)
|
|
740
|
-
- **📝 Audit Plugin** - Comprehensive audit logging for compliance
|
|
741
|
-
- **📬 Queue Consumer Plugin** - Message consumption from SQS/RabbitMQ
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
789
|
+
- **💾 [Cache Plugin](./docs/plugins/cache.md)** - Intelligent caching (memory/S3) for performance
|
|
790
|
+
- **💰 [Costs Plugin](./docs/plugins/costs.md)** - Real-time AWS S3 cost tracking
|
|
791
|
+
- **🔍 [FullText Plugin](./docs/plugins/fulltext.md)** - Advanced search with automatic indexing
|
|
792
|
+
- **📊 [Metrics Plugin](./docs/plugins/metrics.md)** - Performance monitoring and analytics
|
|
793
|
+
- **🔄 [Replicator Plugin](./docs/plugins/replicator.md)** - Multi-target replication (S3DB, SQS, BigQuery, PostgreSQL)
|
|
794
|
+
- **📝 [Audit Plugin](./docs/plugins/audit.md)** - Comprehensive audit logging for compliance
|
|
795
|
+
- **📬 [Queue Consumer Plugin](./docs/plugins/queue-consumer.md)** - Message consumption from SQS/RabbitMQ
|
|
796
|
+
- **🔒 [S3Queue Plugin](./docs/plugins/s3-queue.md)** - Distributed queue processing with zero race conditions
|
|
797
|
+
- **📈 [Eventual Consistency Plugin](./docs/plugins/eventual-consistency.md)** - Event sourcing for numeric fields
|
|
798
|
+
- **📅 [Scheduler Plugin](./docs/plugins/scheduler.md)** - Task scheduling and automation
|
|
799
|
+
- **🔄 [State Machine Plugin](./docs/plugins/state-machine.md)** - State management and transitions
|
|
800
|
+
- **💾 [Backup Plugin](./docs/plugins/backup.md)** - Backup and restore functionality
|
|
801
|
+
|
|
802
|
+
**📖 For complete plugin documentation and overview:**
|
|
803
|
+
**[📋 Plugin Documentation Index](./docs/plugins/README.md)**
|
|
745
804
|
|
|
746
805
|
### 🎛️ Resource Behaviors
|
|
747
806
|
|