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 Slide

  2. View Slide

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

    View Slide

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

    View Slide

  5. nossa arquitetura
    gokafka.poc
    @jeffotoni

    View Slide

  6. @jeffotoni

    View Slide

  7. @jeffotoni

    View Slide

  8. modelo 1
    @jeffotoni

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  13. @jeffotoni
    consumer

    View Slide

  14. @jeffotoni
    Cloud function

    View Slide

  15. @jeffotoni
    Cloud function

    View Slide

  16. novo Cenário
    @jeffotoni

    View Slide

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

    View Slide

  18. Solução 2
    @jeffotoni

    View Slide

  19. @jeffotoni

    View Slide

  20. @jeffotoni
    service service service
    service service service
    service service service
    apache kafka

    View Slide

  21. @jeffotoni
    possível solução

    View Slide

  22. @jeffotoni
    Kafka producer

    View Slide

  23. @jeffotoni
    Kafka consumer

    View Slide

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

    View Slide

  25. Por quê usar Go?
    @jeffotoni

    View Slide

  26. @jeffotoni
    @jeffotoni
    Ritchie

    View Slide

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

  28. @jeffotoni
    Goroutines

    View Slide

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

    View Slide

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

    View Slide

  31. @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 Slide

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

    View Slide

  33. @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 Slide

  34. 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 Slide