Upgrade to Pro — share decks privately, control downloads, hide ads and more …

gRPC e Go um passo antes

gRPC e Go um passo antes

Esta apresentação tenta mostrar um pouco da história dos protocolos HTTP e como funciona sobre as camadas de TCP e UDP. Demostrando sua evolução até chegarmos no SPDY, QUIC e HTTP/3.
Fazemos um apanhando no rEST utilizando HTTP/1, HTTP/2 e finalmente mostramos o RPC utilizando TCP e UDP.
Agora aprender gRPC ficou mais fácil, depois de todo este embasamento demostramos o funcionamento do gRPC e como podemos tirar proveito de sua utilização.

Jefferson Otoni Lima

July 22, 2020
Tweet

More Decks by Jefferson Otoni Lima

Other Decks in Technology

Transcript

  1. @jeffotoni Comunidade Telegram https://t.me/go_br https://t.me/go_bh https://t.me/golangcwb Slack https://gophers.slack.com (members >~45k)

    GopherCon Brasil 2020 https://2020.gopherconbr.org Wiki Conferencias https://github.com/golang/go/wiki/Conferences Meetup https://www.meetup.com/go-belo-horizonte https://www.meetup.com/pt-BR/golangbr https://www.meetup.com/pt-BR/Women-Who-Go-Sampa https://www.meetup.com/pt-BR/Golang-Campinas/ https://www.meetup.com/pt-BR/golang-poa/ https://www.meetup.com/pt-BR/GolangCWB/
  2. @jeffotoni HTTP Versões HTTP/0.9 1991; one method HTTP/1.0 1996; headers,

    caching, languages HTTP/1.1 1999; keepalives, upgrades, ranges, hosts SPDY 2009; one tcp, gzip headers, flow control QUIC 2012; UDP, handshake, baixa latência HTTP/2.0 2015; HPACK, priorities, server push HTTP/3.0 2019; no head-of-line blocking,TLS 1.3
  3. @jeffotoni HTTP/3.0 Um bolo de camada HTTP / 3 Fonte:

    https://blog.cloudflare.com/http-3-from-root-to-tip/
  4. @jeffotoni HTTP/2.0 . Multiplexing . Bidirectional Streaming . HTTPS .

    SSL/TLS . Token auth . Channel credentials . Performance
  5. HTTP/2.0 $ curl -I -L https://app.guula.com.br HTTP/2 200 server: nginx/1.14.0

    (Ubuntu) date: Wed, 22 Jul 2020 17:33:15 GMT content-type: text/html; charset=utf-8 vary: Origin @jeffotoni
  6. serviços/protocolos @jeffotoni RPC TCP/UDP/http REST http SOAP http xml-RPC http

    RMI tcp Representational State Transfer Remote Procedure Call Simple Object Access Protocol Remote Method Invocation webSocket http/tcp comunicação bidirecional por canais full-duplex e usa o schema: ws:// ou wss://
  7. /auth POST /user GET /user/{uuid} GET /user/{uuid} DELETE /user/{uuid} PUT

    1M requests/s 50k requests/s 100k requests/s 60k requests/s 1k requests/s service 1 service 2 service 3 service 4 service 5
  8. @jeffotoni Api rEST em Go - Endpoints - Middleware -

    Instrumentar - Dockerfile - Deploy
  9. . encoding/json . encoding/xml . github.com/tinylib/msgp . github.com/golang/protobuf . github.com/gogo/protobuf

    . Apache/Thrift . Apache/Avro . gotiny . vmihailenco/msgpack/v4 Alguns tipos de serializações
  10. @jeffotoni Api rEST em Go - Endpoints - Middleware -

    Instrumentar - Dockerfile - Deploy
  11. RPC server Go - Register - Metodos - Instrumentar -

    Dockerfile - Deploy @jeffotoni
  12. referências https://jobs.kenoby.com/engineering https://golang.org https://grpc.io/docs/tutorials/basic/go https://github.com/grpc/grpc-go/tree/master/examples https://developers.google.com/protocol-buffers/docs/gotutorial https://github.com/uw-labs/bloomrpc (curl ou posltman

    para grpc) https://itnext.io/learning-go-mongodb-crud-with-grpc-98e425aeaae6 https://encurtador.com.br/fHKSU https://encurtador.com.br/eqvJ2 https://gokit.io/examples/ https://github.com/smallnest/gosercomp https://easyengine.io/tutorials/nginx/configuring-http-2-server-push https://www.digitalocean.com/community/tutorials/http-1-1-vs-http-2-what-s-the-difference https://medium.com/@factoryhr/http-2-the-difference-between-http-1-1-benefits-and-how-to-use-it-38094fa0e95b https://blog.cloudflare.com/how-to-test-http-3-and-quic-with-firefox-nightly/ https://blog.cloudflare.com/http-3-vs-http-2 https://kinsta.com/blog/http3 https://blog.cloudflare.com/http3-the-past-present-and-future links