This video was recorded at Code BEAM America 2022 - https://codebeamamerica.com/
Fast IP Address Matching in Elixir with Radix Trees & Persistent Term | Michael Lubas - Founder of Paraxial.io
ABSTRACT
When your web server receives a new login request, is it from a real user, or a rented cloud server? You have a list of thousands of IP prefixes, and need a way to compare each incoming conn’s remote_ip to that list.
This problem will be used to illustrate several features of Elixir/Erlang. The beginning of the talk will introduce the problem to the audience, and show why the default Elixir data structures are not suitable. Once the radix tree has been covered, we’ll move to the problem of thousands of processes needed to access the same data structure in a short period of time.
The talk will cover GenServers, ETS, and the constant pools optimization, and why these are the wrong choice for the problem. Finally, the complete solution will be shown, using persistent_term.
OBJECTIVES
Introduce the problem of IP address matching
Show why the radix tree is a good choice
Compare GenServers, ETS, and persistent_term for this probleml
• Follow us on social:
Twitter: https://twitter.com/CodeBEAMio
LinkedIn: https://www.linkedin.com/company/27159258
• Looking for a unique learning experience?
Attend the next Code Sync conference near you!
See what's coming up at: https://codesync.global/
• SUBSCRIBE TO OUR CHANNEL
https://www.youtube.com/channel/UC47eUBNO8KBH_V8AfowOWOw
See what's coming up at: https://codesync.global/
0 Comments