The backendjs provides a comprehensive set of modules and utilities for
building scalable, distributed applications with features like database management, caching, job queues, event processing, and more.
Visit the tutorial or all docs.
-
Modular Architecture
- The framework is built around a modular design, where each module (e.g.,
db,cache,queue,api) can be loaded independently. - Modules can be configured via command-line arguments or configuration files.
- The framework is built around a modular design, where each module (e.g.,
-
Database Abstraction
- Supports multiple databases: SQLite, Rqlite, PostgreSQL-wire compatible (PostgreSQL, DSQL, CockroachDB), DynamoDB, Elasticsearch.
- Provides a unified API for CRUD operations, caching, and transactions, access to native engine allows to send raw SQL or JSON directy.
- Supports primary keys, indexes, and schema migrations.
-
Caching
- Built-in caching with support for Redis, NATS, and local memory caches.
- Features like LRU (Least Recently Used) caching, token bucket rate limiting, and locking mechanisms.
-
Job Queue & Event Processing
- Supports SQS, NATS, DB and Redis queues for job processing.
- Workers can be spawned to handle jobs asynchronously.
- Event-based architecture for real-time processing.
-
API Layer
- Trie router kind of similar to Express/Hono with middleware for authentication, rate limiting, static and logging.
- Includes WebSocket support for real-time communication.
- Includes simple but powerful input validation
-
AWS Integration
- Supports AWS services like S3, SQS, SNS, DynamoDB, and EC2.
- Automated instance metadata retrieval and configuration.
-
Logging & Monitoring
- Advanced logging with syslog, file, and console support.
- Metrics collection for CPU, memory, network, and API performance.
- Integration with Elasticsearch for log aggregation.
-
Push Notifications
- Supports WebPush, FCM (Firebase Cloud Messaging), and APNs (Apple Push Notification Service).
-
Configuration Management
- Supports remote configuration via databases or files.
- Dynamic reloading of configurations without restarting the server.
-
Security
- CSRF protection, sessions, and rate limiting.
- JWT (JSON Web Tokens) support for authentication.
-
Log watcher, notify about errors by parsing log files
-
Image composing with Sharp.js from JSON schema, supports avatars, shadows, outline fonts, wrapping, padding
-
Web scraping with Puppeteer
The runtime can be configured via:
- Command-line arguments (e.g.,
-db-pg-pool pg://localhost/dbname). - Configuration files (e.g.,
bkjs.conf). - Environment variables (e.g.,
BKJS_DB_POOL=pg://localhost/dbname). - Database (e. g.
-db-config dynamodb) - AWS Secrets Manager (e. g.
-aws-config-secrets production-worker) - AWS S3 file (e. g.
-aws-config-s3-file mybucket/config) - AWS Config Parameters Store (e. g.
-aws-config-parameters /my-config)
- Docker: Can be containerized for easy deployment, no init-shim required.
- AWS ECS/EC2: Can be deployed on AWS for cloud scalability.
Visit the tutorial.
Check out examples.
Visit the docs.
Vlad Seryakov
(summary was generated by local LLM but edited)
