I have a list of domain name that contains wildcard ('*' character)
It contains nearly 1 million domains.
The data will be stored on a mongodb or redis database.
Given a domain name, such as "abc.domain.com", I need an algorithm that will check the data for a match.
For example, with list above:
"abc.domain.com" has a match to *.domain.com.
"xyz.domain.com" also matches against *.domain.com.
"abc.domain.com.xyz" does not match as the .xyz breaks the rule (if the rule was
*.domain.com.* the first two wouldn't match, but this one would)
Given the above, what algorithm will yield me the quickest results for this problem?