J
J
jenya77712018-02-25 21:05:03
Node.js
jenya7771, 2018-02-25 21:05:03

How to implement the storage of blocked ip addresses?

Hello, how can I implement the storage of blocked ip addresses? In radish, data is stored until the server is rebooted; in the database, it’s also not a very good idea to climb into the database with each request. What's the best way to implement?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Antonio Solo, 2018-02-25
@jenya7771

store it in the database and cache it in radish. Write new ones right there and there.

S
SagePtr, 2018-02-25
@SagePtr

You can keep the Bloom filter in memory and first check the possible ownership of the address, and only in the case of a positive result, climb into the database and check its actual presence. This is the case if there are much more requests from non-blocked addresses than from blocked ones (otherwise, such optimization would make no sense).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question