Code Monkey home page Code Monkey logo

grsql's Introduction

Grsql is a great tool to allow you set up your remote sqlite database as service and CRUD (create/ read/ update/ delete) it using gRPC.

Why Create This

Since I often use micro-service and database intergration is often required. for some "heavy" database like MySQL, MongoDB or something similar, it is a luxury to use them. A sqlite database with fast server backend would be a great solution for this.

This lead to the birth of Grsql.

How to Use

this project consist of two parts:

  • server
  • client

each part can run independently. the server normally run on remote/cloud side, the client make request to it.

use the following code run server,

cargo build --bin server

then the server starts listening on localhost port 7749.

on another side, to run client

cargo build --bin client 

It will insert the file's content input.txt into remote server, then read it, update its id and finally delete it.

Development

First of all, you need to be familiar with proto-buffer, if not, go to the site and see around.

since grsql is built on crates tonic, you need some pre-developing experience of rust, as well as tonic. see these examples to quick start.

you can modify/add/delete the message and service in proto/data.proto according to your requests then implement them according to that in src/server.rs

Notes

  • No authentication implement so far

  • gRPC is designed to deal with service that processes small and frequent communication, not for large file tranfer(file upload/download), if you do so, the performance is worse than HTTP2. It is better that the workload is less than 1M according to this, So use it with care!

you can refer these articles for more:

Sending files via gRPC

Upload/Download performance with gRPC

Use gRPC to share very large file

Feature to Add

  • Add Athentication

Due to the issues mentioned above, it is desired to

  • add a http2 module to handle large file upload/download.

To make transfer more efficient, it is resonable to

  • add a compression

grsql's People

Contributors

hominee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

djun

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.