VDB (Viswath Database) NOSQL
π What is VDB?
VDB (Viswath Database) is a lightweight, terminal-driven NoSQL system built on top of flat JSON files. It simulates a developer-friendly database using natural, shell-like commands via a browser-based terminal.
Unlike traditional databases, VDB is:
-
File-based and schema-less
-
Nested JSON-compatible
-
Backend-accessible through secure tokenized API
-
Interactive via CLI-style terminal
βοΈ How VDB Works
VDB stores your data inside individual .json files. These files behave like collections in a NoSQL database. All database logic (create, fetch, write, modify, delete) is performed on the server using pure PHP, with command input passed via AJAX from the terminal UI.
Main parts:
-
π JSON file = Database (e.g.
users.json,orders.json) -
βοΈ PHP handles commands (via regex + file operations)
-
π AJAX frontend = terminal interface
-
π§ Supports nested JSON path access like
user.profile.name
π§ VDB Command Schemas
Below are the pure schemas (not examples) for each supported operation in VDB β all support dot notation for nested keys.
π§± 1. Create Database
π Creates a new JSON file as an empty array [].
π£ 2. Destroy Database
𧨠Permanently deletes the .json file.
π 3. Insert (Write) JSON Data
π₯ Appends a new JSON object to the file. The JSON must be enclosed in ().
π€ 4. Fetch All Records
π€ Returns all JSON records in the selected file.
π 5. Fetch by Field (Supports Nested)
π Filters and returns records where the nested field matches the value.
βοΈ 6. Modify (Update) Field Conditionally
βοΈ Finds records matching a condition and updates a specific field β both support nesting.
ποΈ 7. Drop (Delete) Record Conditionally
ποΈ Removes all records where a nested field matches the given value.
π₯οΈ VDB Terminal Mechanics
The terminal is a custom-built web UI that mimics command-line environments. It works like this:
-
You type a command
-
It is POSTed to the server via AJAX (
cmd) -
PHP matches the syntax using regex
-
Performs the corresponding action on the JSON file
-
JSON response is returned and shown in the terminal
β¨ All logic runs server-side. No client-side manipulation of data.
π Implemented Security: .json File Access
1. .htaccess Protection
In VDB folder:
β
This denies browser access to any .json file.
2. Cloudflare Worker Firewall
Iβve added a Cloudflare Worker that intercepts .json URL access requests globally:
β
Prevents .json access even if .htaccess fails or is bypassed.
π VDB Integration with Backend
π‘ Backend Use Case:
VDB can power:
-
Surveys
-
Form data collectors
-
Logs
-
Mini-CRMs
-
Simple backend APIs
-
Admin dashboards
-
Student/attendance managers
π Secure Backend Access with 256-bit Hash
Iβve added an optional secured access mechanism via PHP cURL, which allows backend scripts to access the JSON data using a 256-bit hash token.
π§ How it works:
-
The backend passes a hashed token using
Authorizationor a secure POST field. -
PHP verifies the token before giving access to VDB data.
-
It provides the relative path to the backend for that .json database, where only origin server can access the file through backend
β Protects your data when used in:
-
Internal scripts
-
Server-to-server communication
-
API microservices
π Live Demo
π» Try it now:
π https://viswath.me/try-vdb/
-
Full working web terminal
-
Try creating, writing, fetching, and deleting DBs
-
Supports nested JSON fields
-
Friendly error messages
-
Looks and behaves like a real shell interface
π Example Use Cases
-
Custom CMS storage
-
Client data capture form
-
Storing internal logs
-
Product feedback/bug report manager
-
Emergency data API (when DB fails)
π Conclusion
VDB is my signature creation β a unique, terminal-based, secure, and extensible NoSQL system built on native technologies. Itβs perfect for:
-
Low-resource apps
-
Developers experimenting with NoSQL
-
Educational platforms
-
Offline web apps
π§± Tech Stack
-
PHP (backend)
-
JSON (flat-file DB)
-
JavaScript + AJAX (terminal UI)
-
.htaccess+ Cloudflare Worker (security) -
cURL + 256-bit token access (API) for backend

Leave a Comment