Giter Site home page Giter Site logo

linkxzhou / lessdb Goto Github PK

View Code? Open in Web Editor NEW
387.0 2.0 0.0 13.87 MB

LessDB a serverless SQLite service designed to simplify the use of cloud-based MySQL, PostgreSQL, and other databases.

Home Page: https://less-db.vercel.app

Go 13.28% C 85.11% HTML 0.05% Svelte 1.45% CSS 0.03% JavaScript 0.07% Dockerfile 0.01%
serverless cloud sqlite

lessdb's Introduction

LessDB

build build

LessDB a serverless SQLite service designed to simplify the use of cloud-based MySQL, PostgreSQL, and other databases. The project is still in the planning stage, and the planned features include.

  • HTTP JSON API
  • Optimizing Security
  • Sqlite Cli
  • S3 Object Storage
  • Asynchronously Execute SQL for Eventual Consistency
  • Local Cache File
  • Compatible with MySQL Protocol
  • Support Uploading Various Data Formats and Converting them into SQLite Files
  • Prometheus Metrics Data
  • Optimizing WebUI

Installation

go get github.com/linkxzhou/LessDB

OR

git clone [email protected]:linkxzhou/LessDB.git
cd LessDB/cmd/http
go build .

Startup:

cd LessDB/cmd/http
./http

Architecture

avatar

HTTP JSON API

(1)create databases

POST http://localhost:18090/api/v1/createdb
Content-Type: application/json

{
    "list": [
        {
            "cmd": "CREATE TABLE IF NOT EXISTS foo1 (id text NOT NULL PRIMARY KEY,title text)",
            "args": []
        },
        {
            "cmd": "CREATE TABLE IF NOT EXISTS foo2 (id text NOT NULL PRIMARY KEY,title text)",
            "args": []
        },
        {
            "cmd": "INSERT INTO foo1 (id, title) values (?, ?)",
            "args": [415, "romantic-swell"]
        },
        {
            "cmd": "INSERT INTO foo2 (id, title) values (?, ?)",
            "args": [415, "romantic-swell"]
        }
    ]
}

(2)query tables

GET http://localhost:18090/api/v1/{readkey}/tables?limit=10&offset=0
Content-Type: application/json

(3)query rows

GET http://localhost:18090/api/v1/{readkey}/tables/foo1/rows?limit=100&offset=0
Content-Type: application/json

(4)execute sql: asynchronously execute SQL

POST http://localhost:18090/api/v1/{readkey}/execute
Content-Type: application/json

{
    "list": [
        {
            "cmd": "CREATE TABLE IF NOT EXISTS foo1 (id text NOT NULL PRIMARY KEY,title text)",
            "args": []
        },
        {
            "cmd": "CREATE TABLE IF NOT EXISTS foo2 (id text NOT NULL PRIMARY KEY,title text)",
            "args": []
        },
        {
            "cmd": "INSERT INTO foo1 (id, title) values (?, ?)",
            "args": [1, "unique-title-1"]
        },
        {
            "cmd": "INSERT INTO foo1 (id, title) values (?, ?)",
            "args": [2, "unique-title-2"]
        }
    ],
    "writekey": "{writekey}"
}

(5)execute sql for query data

POST http://localhost:18090/api/v1/{readkey}/query
Content-Type: application/json

{
    "list": [
        {
            "cmd": "select * from foo1"
        },
        {
            "cmd": "select * from foo2"
        }
    ]
}

(6)query asynchronously log

POST http://localhost:18090/api/v1/{readkey}/executelog
Content-Type: application/json

{
    "seqid": "{seqid}"
}

Goal

Serve small and medium-sized developers, reducing the cost of cloud services.

Quotation

[1] https://github.com/rqlite/rqlite
[2] https://github.com/psanford/sqlite3vfs
[3] https://github.com/mattn/go-sqlite3
[4] https://github.com/kahing/goofys
[5] https://github.com/turbobytes/infreqdb
[6] https://github.com/rclone/rclone
[7] https://ieeexplore.ieee.org/abstract/document/9101371
[8] https://dl.acm.org/doi/abs/10.1145/1376616.1376645
[9] https://github.com/nalgeon/redka

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.