Wednesday, 12 April 2017

NodeJs or Asp.NET in combination with Redis

I am trying to set up architecture of a solution which consists of three components 1.a web frontend, 2.a Redis Cache and 3. an API (used to retrieve data from backend).

Redis cache is used to save the status of a request based on the client's IP-address. It is used to know how often the client asks the web application to prevent same client to send too many requests. Data is not cached inside the Redis, but a key value pair containing ip-address and status.

When the request comes to the frontend, it first asks the Redis Cache to know the status of the client's IP. following is the rules briefly:

If same IP sends more than 3 requests per second, it will display a Captcha, otherwise it sends the request to the API and doesn't show the captcha.

If the client answers the Captcha correctly, it will send the request to API, and mark the IP-status inside the Redis as "allowed", otherwise it changes the IP status inside the cache to "Blocked" and it block the IP to send requests for a while.

This application is used by many users to search the information they need from the backend. So sometimes maybe it must handle 100 000 or more requests per second. which one NodeJs or Asp.NET is better to use in the frontend in combination with Redis to be as fast as possible?



via user217648

No comments:

Post a Comment