In some cases your application doesn’t need Redis, and internal in-memory 
map with locks and expiration will suffice.

For example you already know the size of the map and you don’t need to 
store a lot of data. Use cases could be IP rate limiting, or any other 
short-lived data.

Here is how you can implement this data structure in Go, let’s call it a 
TTLMap:

https://gist.github.com/plutov/69d22552c696d48496563529c624e0b7 

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/5ea4595a-7096-4bad-9474-9fa6ad76284en%40googlegroups.com.

Reply via email to