Rate Limiter using Spring Cloud Gateway and Redis example | Tech Primers
Тәжірибелік нұсқаулар және стиль
This video covers how to configure Rate Limiter using Spring Cloud Gateway and Redis.
🔗 Github link: github.com/TechPrimers/rateli...
Join this channel by contributing to the community:
/ @techprimers
📌 Related Playlist
================
🔗 Terraform Playlist - • Terraform Primers
🔗Spring Boot Primer - • Spring Boot Primer
🔗Spring Cloud Primer - • Spring Cloud Primer
🔗Spring Microservices Primer - • Spring Microservices P...
🔗Spring JPA Primer - • Spring JPA Primer
🔗Java 8 Streams - • Java 8 Streams
🔗Spring Security Primer - • Spring Security Primer
💪 Join TechPrimers Slack Community: bit.ly/JoinTechPrimers
📟 Telegram: t.me/TechPrimers
🧮 TechPrimer HindSight (Blog): / techprimers
☁️ Website: techprimers.com
💪 Slack Community: techprimers.slack.com
🐦 Twitter: / techprimers
📱 Facebook: TechPrimers
💻 GitHub: github.com/TechPrimers or techprimers.github.io/
🎬 Video Editing: FCP
---------------------------------------------------------------
🔥 Disclaimer/Policy:
The content/views/opinions posted here are solely mine and the code samples created by me are open sourced.
You are free to use the code samples in Github after forking and you can modify it for your own use.
All the videos posted here are copyrighted. You cannot re-distribute videos on this channel in other channels or platforms.
#RateLimiter #SpringCloudGateway #TechPrimers
Пікірлер: 30
Please know that your work is greatly appreciated, and it's creators like you who make the learning journey so much more engaging and enjoyable. I'm looking forward to more of your content.
@TechPrimers
7 ай бұрын
Thank you Sefa. Glad its useful
As always your every video is unique and very informative. Every time you come with some use case approach which is very impressive.
@TechPrimers
Жыл бұрын
Glad you acknowledge that Anand. That's the vision of the channel right from the start. Glad i could still continue it. I put extra effort in choosing a topic
Very informative content.
nice demo. Very well explained in a short time. Can we do TLS termination at spring cloud gateway like nginx. If so can you please make a video on that.
Hey thank you for this amazing course, at 4:25 how did you configure YAML template? This can save a lot of time to write line by line
bro pls tell what algorithm that you using like token bucket or any other
Just to add, when say a lot of options are available. 5:05 Could you please point the reference material or show a screen shot from we can lookup to. By the way this is my first spring cloud material view and its awesome
👍💯💯
Hi Ajay, one question , why have you added redis here , rate limit configurations can work without redis as well for instance and we can scale too ?
@TechPrimers
Жыл бұрын
Hi dev, redis is for storing temporary expiring data. And redis provides TTL on data out of the box. Hence redis is beneficial here for storing the rating limiting data for every request, also being a cache it’s faster than DB upsert
Excellent, but create all fault tolerance concepts in spring cloud gateway, so no need to go resilience 4j concepts ryt???
@TechPrimers
Жыл бұрын
Not everything can be added into the cloud gateway. Fault tolerance comes when our app connects to other apps. API gateway handles only incoming requests. We can add circuit breaker in gateways but we cannot add exponential back off in the gateway as it's controlled in the app. So we will still have some bits in app
Hi Ajay, Had one question In case if wanted to pass header's and body will it be possible with this rate-limiter gate-way to Original request.
@TechPrimers
Жыл бұрын
Hey kunal, i dint quite get your qn. Do you want to send during 429 or from the gateway to the app
@kunalsharma-zc2ho
Жыл бұрын
from gateway to app exact same request ( Consisting Body and Header ) for such cases do we need to handle to gateway level.
Hey bro can you please make a video on centralised session management using redis spring boot. Also please mention how to handle if Redis server down
@TechPrimers
Жыл бұрын
Sure will try
Hi Ajay , I m a beginner, can u tell is it necessary to learn curl ? Why you have used curl and when to use it ? Thanks!
@TechPrimers
Жыл бұрын
Hi Vikash, Curl is a cli utility for calling http urls. Most of the time we just google and get the syntax. 😆
@vikashgaurav4126
Жыл бұрын
@@TechPrimers yes I checked that it is used to transfer or recieve data from a server. Then u could have used postman , right?😅
@vikashgaurav4126
Жыл бұрын
Does Postman can handle any type of protocols or just http ?
How to do it with caffeine?
How can we scale redis in this kind of rate limiting.Redis use only one thread.Spring can be loadbalancing but how do we scale the redis in both horizontal and vertical way. By defaults it can’t handle the load especially if we are working with microservces or http load balancing to single route.
@TechPrimers
Жыл бұрын
One option is to have cluster mode enabled on Redis for scaling redis. The other option is to have the fleet size of your Rate Limiter scale with your service. Meaning, if 1 node fleet supports 10RPS. When you increase the fleet to 2 nodes, by default you get 20RPS with 10RPS config. You can have it scaled across regions and geographies to scale it to planet scale
Hi Bro, how can we add global rate limit as well
@TechPrimers
Жыл бұрын
Global rate limiter should be integrated with API gateway. It will terminate requests before it reached your backend APIs
are you using a mac or you have just customized ur linux
@TechPrimers
7 ай бұрын
It’s a Mac