nqlite provides an easy-to-use solution for deploying lightweight relational databases globally. Built on SQLite and powered by NATS JetStream, it simplifies data management without the complexities of traditional setups. Perfect for edge deployments, nqlite ensures your data is accessible while streamlining operations.
nqlite is a lightweight and user-friendly relational database built on SQLite for data storage and NATS JetStream for seamless replication and persistence. Inspired by rqlite, nqlite simplifies the data API without the necessity of a RAFT leader, making it ideal for deploying relational databases globally and at the edge.
Key Benefits
nqlite addresses several challenges faced in distributed data management:
- Efficient Management of IP addresses and DNS records.
- Elimination of complexities associated with read/write splitting and proxy configurations.
- Placement of relational data in proximity to applications.
- Enhanced disaster recovery and failover orchestration.
- Purpose-built for edge deployments, where traditional databases might fall short.
Notable Features
- Simple HTTP API for seamless interaction with SQLite via the
/db/query
endpoint. - Built-in snapshotting and restoration capabilities using Object Store.
- Utilizes NATS JetStream for reliable SQL replication and persistence, featuring an Ephemeral Push Consumer.
- Lightweight setup – just run the executable and configure with the NATS WebSocket URL.
- Versatile Deployment Options – supports Linux, macOS, Windows, ARM, Kubernetes, Docker, and more.
Vision for nqlite
At VOXO, we've combined the strengths of rqlite and NATS to create nqlite. Our vision is to enable the deployment of relational databases at the edge while simplifying the complexities surrounding IP management, DNS, and orchestration. With nqlite, there's no need for leader election or primary/replica configurations; NATS JetStream provides a robust layer for message sequencing and at-least-once delivery, streamlining global deployment of relational databases.
Quick Start and Usage
To initiate nqlite, simply run the following command, specifying the NATS host URL and credentials:
$ nqlite --nats-host=wss://FQDN --creds=./nats.creds
For Docker users:
docker run voxo/nqlite -p 4001:4001 --nats-host=wss://FQDN --creds=./nats.creds
Interacting with the Database
nqlite supports various operations like inserting, updating, and querying data through its API. Here’s how you can create a table and insert data:
# Create a table
curl -XPOST 'localhost:4001/db/query' -H "Content-Type: application/json" -d '["CREATE TABLE foo (id INTEGER NOT NULL PRIMARY KEY, name TEXT, age INTEGER)"]'
# Insert data
curl -XPOST 'localhost:4001/db/query' -H "Content-Type: application/json" -d '["INSERT INTO foo(name, age) VALUES(\"fiona\", 20)"]'
Advanced Functionality
nqlite also supports parameterized queries, bulk operations, and named parameters for optimized database interactions. Error handling is integrated into the API, ensuring you receive meaningful feedback on operation outcomes.
Future Enhancements
We are continually evolving nqlite, with upcoming features including Prometheus exporter support, transaction capabilities, API authentication, and more. Your contributions and ideas are welcome to shape the future of nqlite.
For detailed documentation, examples, and troubleshooting, refer to the repository or reach out to the community.
Embrace simplicity and efficiency with nqlite, your go-to solution for edge-ready relational databases.