Tiago
Tiago
  • 25
  • 192 893
How I RATE LIMIT my Production API in Golang
👉 Join the private community to level up as software engineer: selfmadeengineer.com
📢 Checkout the FREE Discord channel
discord.com/invite/3JhkwjQHjc
In this video I share with you how I am rate limiting my API in Go. Rate limiters are a must if you want to protect your back-end from layer 7 DDoS attacks and keep your API secure.
📌Resources
- Very good article on rate limiting algorithms: konghq.com/blog/engineering/how-to-design-a-scalable-rate-limiting-algorithm
- Go Fixed Window: github.com/mennanov/limiters
- Go "official" rate limit package: pkg.go.dev/golang.org/x/time/rate
- Uber rate limiter: github.com/uber-go/ratelimit
Thanks for watching!
00:00:00 Why to Rate Limit?
00:02:36 How it works
00:07:40 Distributed Systems
00:08:14 Different types of rate limiters
00:13:37 Code Overview
#go #golang
zhlédnutí: 3 076

Video

How I Would Deploy My Golang SaaS App (CI/CD & Tests)
zhlédnutí 4,4KPřed měsícem
How I Would Deploy My Golang SaaS App (CI/CD & Tests)
The Complete Microservices Course in Go
zhlédnutí 30KPřed měsícem
► Join & Access the full course: selfmadeengineer.com In this course instead of flipping burgers you'll build an Order Management System with microservices in Go. This journey will start from a simple service from which we'll build & scale out up to 5 different microservices communicating & working together to finalise the users order ...and we're going to build all of this from scratch... 🎉 Th...
Working with RabbitMQ in Golang for an Event-Driven Architecture
zhlédnutí 3,4KPřed měsícem
► Join & Access the full Microservices course: selfmadeengineer.com In this video we'll explore from a high overview what are message brokers and how they work. We're also exploring how a message broker like RabbitMQ makes your microservices more reliable. Resources: Docs: www.rabbitmq.com/tutorials/tutorial-three-go Installation: www.rabbitmq.com/docs/download 📢 We're building a Discord commun...
How to Properly Integrate with External Services in Golang
zhlédnutí 3,1KPřed měsícem
Every software system integrates with other 3rd party systems in a way or another. And the way that you integrate with them is really important for the health of your system. So in this video I share some examples on how to do it using the Adaptor Pattern and dependency injection in Golang. 👉 Join the private community to level up as software engineer: selfmadeengineer.com 📢 We're building a Di...
All You Need to Know to Structure your Golang Projects
zhlédnutí 6KPřed 2 měsíci
Either you are new to SWE or just starting to build your first projects in Go and you don’t know which project architecture or structure to use. You’ve heard about these terms: Clean Architecture, Hexagonal Architecture and DDD. And all sounds confusing. If that sounds like you, then this video is for you I’ll help you clarify everything. 👉 Join the private community to level up as software eng...
Complete Golang and gRPC Microservices (Project Course)
zhlédnutí 10KPřed 2 měsíci
Learn how to build scalable micro-services in Golang with gRPC by building a practical real-world production project (order management system). By the end you should be able to develop your micro-service projects by your own. 👉 Join the private community to level up as software engineer: selfmadeengineer.com 📢 We're building a Discord community, come and join discord.com/invite/3JhkwjQHjc ✅ Che...
How the Golang Context Package Works
zhlédnutí 3,6KPřed 2 měsíci
When it comes to building resilient production software in Go you should be familiar with the context package. You don’t need to know everything tho…so I’m going to teach you what you should know to get started and be then be able to read and build more complex applications. Because you probably seen that most advanced frameworks use context. 👉 Join the private community to level up as software...
How to EFFICIENTLY Handle Errors in Golang APIs
zhlédnutí 4,2KPřed 2 měsíci
► Join the private community to level up as software engineer: selfmadeengineer.com In this video will show how you can handle errors in your Golang APIs while being pragmatic and as practical as possible, so you can focus in what really matters: building stuff. 👉 Join the private community to level up as software engineer: selfmadeengineer.com 📢 We're building a Discord community, come and joi...
How to ACTUALLY land that Software Engineer Job
zhlédnutí 1,3KPřed 2 měsíci
We live at a time where being good at coding is just not enough. So I hope that this video, where I share some tips on how to actually land a software engineer job, helps you in your journey. 👉 Join the private community to level up as software engineer: selfmadeengineer.com 📢 We're building a Discord community, come and join discord.com/invite/3JhkwjQHjc 📚 Resources Book 1: "How to make friend...
Practical Explanation of Golang INTERFACES
zhlédnutí 3,9KPřed 2 měsíci
In this video I'll give you a practical explanation with real-world examples of how to use interfaces in Go, so you can become a better engineer and make your code more modular and testable. ✅ Check the "Complete Backend API in Golang" Course: czcams.com/video/7VLmLOiQ3ck/video.html 👉 Join the private community to level up as software engineer: selfmadeengineer.com 📢 We're building a Discord co...
How to create your Golang APIs from now on with v1.22
zhlédnutí 15KPřed 2 měsíci
Since Go 1.22 released you can now build your API services with just the net/http package, without the need for any external packages likes gorilla/mux, fiber or chi. So in this video I’ll show you how I’m going to be building my APIs from now on with go 1.22. 💻 Check the "Complete Backend API in Golang" Course: czcams.com/video/7VLmLOiQ3ck/video.html 👉 Join the private community to level up as...
A trick for safely using Golang Maps more efficiently
zhlédnutí 3,5KPřed 2 měsíci
In this video I’ll show you how you can make your concurrent applications actually more concurrent safe by using sync mutexes and vertical sharding. 🌱 Check the "Golang Essentials" Playlist here: czcams.com/play/PLYEESps429vo2vvoUuAA6-fEDVgeqx3HW.html 👉 Join the private community to level up as software engineer: selfmadeengineer.com 📢 We're building a Discord community, come and join discord.c...
Complete Backend API in Golang (JWT, MySQL & Tests)
zhlédnutí 37KPřed 2 měsíci
► Join the private community to level up as software engineer: selfmadeengineer.com In this course we're going to be building a production-ready E-commerce REST API in Go using JWT authentication, we'll be testing our services and connecting our server to a MySQL. We'll build everything from scratch so that I teach you just enough for you to be able to go on your own and not having to watch ano...
The Best Tool for LEARNING Golang
zhlédnutí 4,2KPřed 3 měsíci
In this video we'll build our own Git system from scratch from the app.codecrafters.io/join?via=sikozonpc platform. I really had fun building and learning from this kind of platform where we're encouraged to research and built ourselves so I really think that if you want to build projects in Golang to learn and don't know what to build, give CodeCrafters a try. 👉 Join the private community to l...
Advanced Golang: Pointers
zhlédnutí 1,4KPřed 3 měsíci
Advanced Golang: Pointers
Authenticating your APIs in Golang (HTMX project)
zhlédnutí 5KPřed 3 měsíci
Authenticating your APIs in Golang (HTMX project)
Building Full Stack Golang + HTMX + Templ APP
zhlédnutí 11KPřed 3 měsíci
Building Full Stack Golang HTMX Templ APP
How To Build a Complete API In Golang (Docker, JWT, MySQL)
zhlédnutí 25KPřed 3 měsíci
How To Build a Complete API In Golang (Docker, JWT, MySQL)
Advanced Golang: Goroutines & Channels
zhlédnutí 3,3KPřed 4 měsíci
Advanced Golang: Goroutines & Channels
Building a Chat with WebSockets and HTMX in Golang
zhlédnutí 7KPřed 4 měsíci
Building a Chat with WebSockets and HTMX in Golang
How to Send Emails in Golang (SendGrid)
zhlédnutí 1,4KPřed 4 měsíci
How to Send Emails in Golang (SendGrid)
How I Built Readwise in Golang
zhlédnutí 4,9KPřed 4 měsíci
How I Built Readwise in Golang
Deploying a NodeJS App to Google Cloud (with CI/CD)
zhlédnutí 605Před 10 měsíci
Deploying a NodeJS App to Google Cloud (with CI/CD)
Build and Deploy a Full Stack Newsletter App: Complete Node.js and React Tutorial
zhlédnutí 1,3KPřed 10 měsíci
Build and Deploy a Full Stack Newsletter App: Complete Node.js and React Tutorial

Komentáře

  • @ruthcodina874
    @ruthcodina874 Před 5 hodinami

    I have this problem [mysql] 2024/06/16 21:18:52 connection.go:49: unknown auth plugin:auth_gssapi_client. I've intented with the MySQL workbench updating the user, creating a new user, and the problem persist. AND I don't know how to change the my.cnf

  • @hectorcast943
    @hectorcast943 Před 5 hodinami

    How would you deal with transaction between multiple store in repository pattern?

  • @keshavakumar9828
    @keshavakumar9828 Před 10 hodinami

    I have a question Whats the total duration of this course and is it completed ?

  • @sebastianletelier7947

    Would love it using net/http 1.22 handlers😅

  • @mrfli24
    @mrfli24 Před dnem

    Thank God. He used standard database/sql interface, not ORM. Which vsc theme he used in the video ?

  • @prashlovessamosa
    @prashlovessamosa Před dnem

    Tiago can you release this course on udemy in my country I don't know why I am not able to purchase it I have a Rupay card that won't work. I tried a lot but was still unable to join.

    • @TiagoTaquelim
      @TiagoTaquelim Před 9 hodinami

      Hey! I've had someone with the same problem. I'm still waiting to see if the platform fixes that. In the meanwhile if you have any other means of payment that the platform accepts try those.

  • @kiratornator
    @kiratornator Před 2 dny

    this is more of a do this then this then this then an actual instuctional video. I have doubt even he knows what he is doing. Any information he does give is super surface level.

  • @iamhexdd
    @iamhexdd Před 2 dny

    How can i automate documentation for my apis Tiago when using this approach instead of using other web frameworks?

  • @sval4020
    @sval4020 Před 2 dny

    Hi, Tiago, great video! Keep up rocking man! Love your content! A question I have, what is the best way to secure Go + HTMX + Echo + templ application? Are JWTs preferable or is there a different approach we should take?

    • @TiagoTaquelim
      @TiagoTaquelim Před 2 dny

      Thanks! JWTs are a good way to store the users session in the browsers independently of your tech stack, so yes.

  • @shavvart
    @shavvart Před 3 dny

    i cant make gen in common fodler

  • @WildLifeBackyardCamera

    been through so many tutorials that were not giving correct folder structure and finally, finally someone that do it right, thanks a lot

  • @Tay74514
    @Tay74514 Před 6 dny

    Don’t use Gorm please 😬

  • @acronproject
    @acronproject Před 7 dny

    Thanks so much Mr.Tiago

  • @haroonalbar2725
    @haroonalbar2725 Před 9 dny

    Hey! can I make a small suggestion, Could you invest on a better mic. The audio is a bit muffled and it's distracting.

  • @salfiyah.gemstore
    @salfiyah.gemstore Před 12 dny

    Just curious,Why don't you use gorm

    • @BlakeSekelsky99
      @BlakeSekelsky99 Před 12 dny

      Once you go beyond simple CRUD queries, the generated SQL can get pretty messy/inefficient, search up n+1 problem. ORMs are getting better at generating SQL, but for me I like to use sqlc and just write it myself then generate the go code + interface. Ends up saving you 95% of the work on writing the repository

  • @samuelopeyemi8377
    @samuelopeyemi8377 Před 13 dny

    Thank you for this, any plan to add authentication service and role-based access?

    • @TiagoTaquelim
      @TiagoTaquelim Před 13 dny

      In the future I'll add it yes, as of now it's not in

  • @weiSane
    @weiSane Před 14 dny

    Tiago this is good stuff. Thanks for this in-depth tutorial man. However, those are way too many dependencies wtf. Why not have fewer files it’s easier to maintain and easier to follow and read the code.

    • @TiagoTaquelim
      @TiagoTaquelim Před 14 dny

      Thanks! I've make a previous full length video like this before where I did not even create a folder to solely focus on teaching. However folk wanted a better starting point for bigger applications and that is why I've divided into folders here. so it can grow. Also, the project has 5 external dependencies, some of which are for security and loading the env vars, none of them is extraneous.

    • @weiSane
      @weiSane Před 14 dny

      @@TiagoTaquelimI understand given the context you have provided.

  • @dipaash3068
    @dipaash3068 Před 15 dny

    Greate Video! I have a question, if we want to save the data in DB, at which point we have to store it in DB? Do we have do it in client readPump or else where ? I am bit confused, can you give your insite on it.

  • @kusumo1920
    @kusumo1920 Před 16 dny

    @TiagoTaquelim What software do u use for creating those diagram?

  • @xosnrdev
    @xosnrdev Před 16 dny

    I use traefik works good for me

  • @yeboahnanaosei
    @yeboahnanaosei Před 16 dny

    Hi Tiago, which font are you using in your text editor in this video?

  • @chewzixuan429
    @chewzixuan429 Před 16 dny

    Hi bro, is rate limiting covered in this course? I am planning on purchasing the course.

    • @TiagoTaquelim
      @TiagoTaquelim Před 16 dny

      Hey! On this course I haven’t. However it’s pretty simple to add there. In the course I’m currently working there will be.

    • @chewzixuan429
      @chewzixuan429 Před 16 dny

      @@TiagoTaquelim Is it easy to apply whatever you have taught in the latest video into that course? Also, what will the next course be on and what’s the estimated release date? Thanks anyways for all these content!

    • @TiagoTaquelim
      @TiagoTaquelim Před 16 dny

      @@chewzixuan429 Yes it is. It will be a in depth back-end web dev course. Probably will be released end of next month/start of next.

  • @agb2557
    @agb2557 Před 16 dny

    thanks for your videos! just one question: since your server still needs to process the request to verify whether it needs to be rate limited or not, won't this cost you if you get spammed anyway?

    • @TiagoTaquelim
      @TiagoTaquelim Před 16 dny

      So there is no way around that but if I had to compute an expensive operation if I got spammed it’s way expensive than a rate limit check. That is why it’s important to have a fast rate limiter (in a fast access database like redis for example). I could also ban an IP after to many blocks as well

    • @SiebeBaree
      @SiebeBaree Před 16 dny

      ​@@TiagoTaquelim Can you not have a service before your API for example in cloudflare? If the ratelimit gets triggered your API won't get a single request. BTW, thanks for the video, your channel is really great.

    • @jamestk656
      @jamestk656 Před 16 dny

      I haven't checked Cloudflare lately since they deprecated page rules but I think you could probably set a cookie for a misbehaving client then direct Cloudflare to block all clients with that cookie. I know you could manually block IPs on CF but I'm not sure if you could actually just send it to them from your app. If you have to let the request through, I've actually set up a CSV file right on the server that is updated by the app whenever there's an egregious IP address. The file is checked before every request before anything even hits my Redis cache or DB. I've had it happen where I've had so many requests from so many bad IPs at once that even my Redis instance maxed it's connection limit so the file on each app server just keeps any really bad requester from even making a connection.

    • @TiagoTaquelim
      @TiagoTaquelim Před 16 dny

      @@SiebeBaree Yes that exists as well!

    • @Tay74514
      @Tay74514 Před 6 dny

      You have to think of security in layers.

  • @iamfrancisco
    @iamfrancisco Před 16 dny

    This is such an underrated channel! Obrigado Tiago for creating these videos with such care and high quality

  • @dixztube
    @dixztube Před 18 dny

    im failing to see how any of these interface videos are really that different. it mostly consist of a dev who knows how to use them, flying through code (at least this is a realistic example with some testing) and i dont know ---- feels like these things are just popped out. probably best to just code yourself and get a feel for it

  • @NightHawk-mw4en
    @NightHawk-mw4en Před 21 dnem

    bro which theme are you using, looks cool?

  • @Breno9629
    @Breno9629 Před 21 dnem

    Great content. Congratz, Tiago. Please, keep doing this good work

  • @QriousKoder
    @QriousKoder Před 21 dnem

    Looking forward to the production app you talked about

  • @nickshilov9929
    @nickshilov9929 Před 21 dnem

    Hey Tiago, thanks for the video! I wonder why you've decided to put all env vars to configs and not to call'em through os package? Thanks in advance for your reply!

    • @TiagoTaquelim
      @TiagoTaquelim Před 21 dnem

      Hey thanks! I did consume the env vars through the os package but I've organize them into a configuration file for ease of use.

  • @codedusting
    @codedusting Před 22 dny

    What to do if I want to replace the mux router with the new 1.22 http router? How to create subrouter and other stuffs?

  • @danarghulamsyah4476
    @danarghulamsyah4476 Před 23 dny

    what color schema do you use brother?

  • @abdullahzahid749
    @abdullahzahid749 Před 23 dny

    finally i find some good resources in go lang

  • @kirakira160
    @kirakira160 Před 24 dny

    Good job man but question why you don't use grpc gateway package to expose http and grpc in same main

  • @roshanpaudel6352
    @roshanpaudel6352 Před 24 dny

    Hi boss, I love your go content. I usually watch you and you use vim/nvim in your vscode with ease. I am a fulltime nvim user and I struggle to navigate around vscode even though using nvim extension. I love the way you navigate around. I looked at the description I couldn't find your github. Would you be able to share your vscode configs. I would love to implement it. Thank you for your awesome content.

    • @TiagoTaquelim
      @TiagoTaquelim Před 24 dny

      Thank you! I actually don't use vim. It looks like it because I made it so, but I'm just using the VSCode keybinds, I havent got the need to use VIM because I'm gotten pretty efficient with them. Here are the dotfiles: github.com/sikozonpc/dotfiles Not sure if they're 100% updated tho.

    • @roshanpaudel6352
      @roshanpaudel6352 Před 23 dny

      @@TiagoTaquelim Thank you so much 😃

  • @OnceUponKid
    @OnceUponKid Před 26 dny

    i still don't know how to apply JWT for every routes as a middleware?

  • @oscar5915
    @oscar5915 Před 26 dny

    Sorry to disturb tiago, i'm your fans, can i ask how to do the spm on jaeger ui? i tried to do it but unable to produce it on the monitor tab in jaeger ui, would really appreciated if could help with configuration

    • @TiagoTaquelim
      @TiagoTaquelim Před 26 dny

      Hey! I'm not sure as well I haven't tried do it on Jeager UI. Maybe take a look at the official docs here: www.jaegertracing.io/docs/1.57/spm/

  • @franciscoferreira1800

    Tiago u are the goat fr, really appreciate this :) !

  • @TheIsraelMendoza
    @TheIsraelMendoza Před 28 dny

    New to Golang here. Not even sure if I’ll go deeper into it tbh. Question: Why do I have the impression Go devs overuse single-character variable names? It’s just awful!!!

  • @kevinmathew8372
    @kevinmathew8372 Před 28 dny

    04:10 Would it better not to include ' db' in the APIServer struct?

  • @0runny
    @0runny Před 29 dny

    It would be great if you could please do a follow up video demonstrating the actual performance improvements of this solution using benchmarks.

  • @viniciusrodrigues2180
    @viniciusrodrigues2180 Před měsícem

    Good vídeo, it helped me get started with grpc in golang but i have some considerations about the project, i found the naming scheme kinda messy (several grpc.go files in different places), I saw some code that prepped the package in this case. I think that maybe something like handler.grpc.go for example would be more descriptive. What do you think about it?

  •  Před měsícem

    *If someone is getting the following errors on Ubuntu: ### Error when running _make test_ # runtime/cgo _cgo_export.c:3:10: fatal error: stdlib.h: No such file or directory #include <stdlib.h> compilation terminated. SOLUTION: Just run _apt-get update && apt-get install build-essential_ ### Error when running _make migration add-user-table_ Below is the correct script to write on Makefile (remember to install the MySQL CLI on your machine) SOLUTION: @migrate create -ext sql -dir cmd/migrate/migrations $(filter-out $@,$(MAKECMDGOALS))

  • @af2b
    @af2b Před měsícem

    Ola Tiago! tudo bem contigo? espero que sim. Poderia compartilhar conosco sua configuracao do vscode? Um forte abraco, voce e fera. =)

    • @TiagoTaquelim
      @TiagoTaquelim Před měsícem

      Obrigado e abraço! Tenho aqui nos meus dotfiles, penso que esteja actualizado: github.com/sikozonpc/dotfiles

  • @AnuragMishra-ws4zc
    @AnuragMishra-ws4zc Před měsícem

    hey I am not able to enroll in your microservice course I am from india skool is not accepting my payment card so is there any alternate way by which I can access your course Like through UPI

    • @TiagoTaquelim
      @TiagoTaquelim Před měsícem

      Hmmm... odd I'll investigate.

    • @AnuragMishra-ws4zc
      @AnuragMishra-ws4zc Před měsícem

      @@TiagoTaquelim Have you figured it out why this is happening is there any alternate way.

    • @TiagoTaquelim
      @TiagoTaquelim Před měsícem

      @@AnuragMishra-ws4zc I double checked with Skool and they support payments from India.

  • @kashnigahbaruda
    @kashnigahbaruda Před měsícem

    Does this wait for GitHub actions to succeed before deploying to GCP or is it trigger for every push?

  • @UserMainAdmin
    @UserMainAdmin Před měsícem

    Nice, keep going