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

Kafka e Go

Kafka e Go

Uma breve introdução a utilização de Libs kafka em Go. Mostrando um pouco de arquiteturas de microservices, distribuídas e o que é o Kafka.
Fiz uma poc utilizando libs Kafka em Go em um ambiente do Google Cloud usando GKE e montando um ambiente local utilizando docker-compose.

Jefferson Otoni Lima

September 10, 2020
Tweet

More Decks by Jefferson Otoni Lima

Other Decks in Technology

Transcript

  1. http://s3wf.com
    @jeffotoni
    Sensendia 10/09
    Jefferson Otoni
    Explorando kafka e Go

    View full-size slide

  2. @jeffotoni
    Fácil de
    implementar
    Altamente
    escalável
    Resiliente
    desafios

    View full-size slide

  3. arquitetura
    @jeffotoni
    Go Go Goc
    o
    mongo rethinkDB postgres
    app
    browsers

    View full-size slide

  4. nossa arquitetura
    gokafka.poc
    @jeffotoni

    View full-size slide

  5. modelo 1
    @jeffotoni

    View full-size slide

  6. Dados do Game
    Pub/Sub Cloud Function
    Cloud Function
    Cloud Function
    Cloud Function
    @jeffotoni

    View full-size slide

  7. Aws Sqs Lambda
    Lambda
    Lambda
    Lambda
    Dados do game
    @jeffotoni

    View full-size slide

  8. postgres
    Pub/Sub
    microservice
    @jeffotoni
    consumer
    rest
    rpc
    write

    View full-size slide

  9. Pub/Sub
    @jeffotoni
    RabbitMQ
    Sqs
    kubemq.io

    View full-size slide

  10. @jeffotoni
    consumer

    View full-size slide

  11. @jeffotoni
    Cloud function

    View full-size slide

  12. @jeffotoni
    Cloud function

    View full-size slide

  13. novo Cenário
    @jeffotoni

    View full-size slide

  14. postgres
    BigQuery
    Redis
    RethinkDB
    mongo
    nossos BDs
    @jeffotoni
    Spanner

    View full-size slide

  15. Solução 2
    @jeffotoni

    View full-size slide

  16. @jeffotoni
    service service service
    service service service
    service service service
    apache kafka

    View full-size slide

  17. @jeffotoni
    possível solução

    View full-size slide

  18. @jeffotoni
    Kafka producer

    View full-size slide

  19. @jeffotoni
    Kafka consumer

    View full-size slide

  20. @jeffotoni
    Algumas libs em Go
    - [o] segmentio kafka-go
    - [x] sarama
    - [x] confluent-kafka-go
    - [o] goka
    - [o] Google/go-cloud/kafkapubsub

    View full-size slide

  21. Por quê usar Go?
    @jeffotoni

    View full-size slide

  22. @jeffotoni
    @jeffotoni
    Ritchie

    View full-size slide

  23. @jeffotoni
    25 Keywords
    break default func interface select
    case defer go map struct
    chan else goto package switch
    const fallthrough if range type
    continue for import return var

    View full-size slide

  24. @jeffotoni
    Goroutines

    View full-size slide

  25. @jeffotoni
    Pprof
    Profiling Go
    https://eltonminetto.dev/post/2020-04-08-golang-pprof

    View full-size slide

  26. https://golang.org/pkg/testing @jeffotoni

    View full-size slide

  27. @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/

    View full-size slide

  28. @jeffotoni
    Paradigma
    concorrente
    Compilada
    estaticamente
    Tipagem
    estática
    Multi
    Plataformas
    Retrocompa-
    tibilidade

    View full-size slide

  29. @jeffotoni
    https://golang.org
    https://golang.org/doc/effective_go.html
    https://golang.org/ref/spec
    https://golang.org/doc
    https://tour.golang.org/welcome/1

    View full-size slide

  30. Thanks := &Obrigado{...}
    Obrigado...
    github.com/jeffotoni
    instagram.com/jeffotoni
    https://t.me/devopsbh
    https://t.me/go_br
    https://t.me/awsbrasil
    linkedin.com/in/jeffotoni/

    View full-size slide