Giter Site home page Giter Site logo

go-rest-grpc's Introduction

Go Rest / Grpc comparison

How to run

Create a /config/.env file. There is an example available inside the config folder.

Docker

Download this repository and run

docker-compose -f docker/docker-compose.yaml up --build

Profiles

Profiles can be used to start only a group of containers, and not all of them. The available profiles are:

  • db: only db containers
  • server: only db and server containers

Example

docker-compose -f docker/docker-compose.yaml --profile db up

With local go installation

Install golang, the run

go mod vendor
go mod download
go run entrypoints/api/main.go

Protocol buffer

There is a configured container for compiling the protocol buffers. Run:

docker-compose -f docker/docker-compose.yaml run grpc-dev
sh protoc.sh

Migrations

Migration are run on the startup of the applications. To create a new migration, run:

go run entrypoints/cli/migrate.go --action create --name create_subjects_table

This will create two files in database/migrations folder (up and down file). To run the migrations without starting the application, run go run entrypoints/cli/migrate.go --action migrate

Poc Result (WIP)

Payload size

With 1000 registers in students database: Rest: 149,000kB GRPC: 45,916kB

go-rest-grpc's People

Contributors

janainaludwig avatar

Stargazers

honki avatar

Watchers

 avatar

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.