No video

How I RATE LIMIT my Production API in Golang

  Рет қаралды 4,367

Tiago

Tiago

Күн бұрын

Пікірлер: 13
@sletelier_
@sletelier_ Ай бұрын
Hey Tiago, can you pls show your vsc extensions, I want to copy your folders image extension, and also the one who change the color of the file you are editing. thx
@agb2557
@agb2557 2 ай бұрын
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 2 ай бұрын
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 2 ай бұрын
​@@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 2 ай бұрын
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 2 ай бұрын
@@SiebeBaree Yes that exists as well!
@Tay74514
@Tay74514 2 ай бұрын
You have to think of security in layers.
@yeboahnanaosei
@yeboahnanaosei 2 ай бұрын
Hi Tiago, which font are you using in your text editor in this video?
@TiagoTaquelim
@TiagoTaquelim 2 ай бұрын
I think it's called Menlo
@salfiyah.gemstore
@salfiyah.gemstore 2 ай бұрын
Just curious,Why don't you use gorm
@BlakeSekelsky99
@BlakeSekelsky99 2 ай бұрын
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
@Tay74514
@Tay74514 2 ай бұрын
Don’t use Gorm please 😬
How to Prevent Concurrent Race Conditions in Go
14:17
Tiago
Рет қаралды 2,2 М.
The standard library now has all you need for advanced routing in Go.
13:52
Harley Quinn's plan for revenge!!!#Harley Quinn #joker
00:49
Harley Quinn with the Joker
Рет қаралды 32 МЛН
Zombie Boy Saved My Life 💚
00:29
Alan Chikin Chow
Рет қаралды 7 МЛН
Logo Matching Challenge with Alfredo Larin Family! 👍
00:36
BigSchool
Рет қаралды 20 МЛН
INTERNATIONAL BUSINESS (REASONS TO ENTER INTERNATIONAL BUSINESS)
9:09
CIMAGE Patna- Online Classes for BCA, BBA, BSc-IT
Рет қаралды 4
Пишем REST API сервис на Go - УЛЬТИМАТИВНЫЙ гайд
2:57:51
Николай Тузов — Golang
Рет қаралды 118 М.
How to EFFICIENTLY Handle Errors in Golang APIs
10:27
Tiago
Рет қаралды 5 М.
Rob Pike: What Golang Got Right & Wrong
29:23
ThePrimeTime
Рет қаралды 134 М.
HTML Templates Instead Of Reactivity | Prime Reacts
12:42
ThePrimeTime
Рет қаралды 111 М.
This Is The BEST Way To Structure Your GO Projects
11:08
Melkey
Рет қаралды 71 М.
HTMX & Go with ThePrimeagen | Preview
15:58
Frontend Masters
Рет қаралды 151 М.
WHY did this C++ code FAIL?
38:10
The Cherno
Рет қаралды 249 М.
Golang Channels Or Wait Groups? Let Me Explain.
18:32
Anthony GG
Рет қаралды 21 М.
Advanced Golang: Limiting Goroutines
7:31
Code With Ryan
Рет қаралды 28 М.
Harley Quinn's plan for revenge!!!#Harley Quinn #joker
00:49
Harley Quinn with the Joker
Рет қаралды 32 МЛН