The Story Behind PocketSQL
Empowering students, developers, and makers with a self-contained, enterprise-grade relational database running locally on Android.
Why We Built PocketSQL
Every database learner and mobile engineer encounters the same obstacle: setting up an SQL database server typically requires either a running desktop workstation or a paid cloud instance on AWS, Google Cloud, or Heroku. For millions of engineering students and indie developers, renting cloud instances or keeping laptops running simply to test an API endpoint is cumbersome and costly.
Modern smartphones contain quad-core and octa-core processors with multi-gigabyte RAM, sitting idle in pockets for hours. PocketSQL was born from a simple realization: your mobile phone has more than enough processing power to run a fully functional, high-speed relational database and HTTP server.
Instead of bundling slow, bloated virtual machines or emulators, we engineered a native, pure-Java SQL engine that executes queries in user space without requiring root privileges.
Architecture Philosophy
The four foundational pillars of PocketSQL's embedded execution model:
Pure-Java AST Parser
Lexes and parses standard ANSI SQL syntax into an abstract syntax tree without JNI overhead or external binary dependencies. Handles nested subqueries, joins, and expressions directly on Android ART.
B-Tree Indexed Page Storage
Data is organized in structured binary pages with fast index seeks and write-ahead logging (WAL). Reads execute in sub-milliseconds with minimal storage fragmentation on flash memory.
ACID Transaction Coordinator
Provides strict Atomicity, Consistency, Isolation, and Durability. Features checkpoint rollbacks, foreign key constraint verification, and atomic commit semantics.
Android Foreground Service
Runs as an official Android persistent foreground service with a persistent notification. Ensures the operating system does not kill the HTTP/TLS API server while your phone is asleep.
Our Guiding Principles
Zero Cloud Uploads
No telemetry, no tracking, and no external servers. Everything stays on the device you own.
Zero Vendor Lock-in
Export your databases anytime as standard SQL scripts, SQLite `.db` binaries, or Excel sheets.
Community Driven
Free for commercial and personal usage forever. Built for and supported by the global dev community.
The PocketSQL Core Team
Independent Open-Source Software Engineers