Discussion:
[PERDITION-USERS] patch for wildcard matching in mysql
Joe Pruett
2015-03-04 19:40:45 UTC
Permalink
is this something that people would use? i have made a local patch that
lets me do some sql wildcard matching if there isn't an exact match in
the db. this allows me to have a front end server for multiple domains
and unless something needs special per-user handling, i can just match
on the domain and route on that. it even allows for multiple wildcard
matches and chooses the longest pattern as the best one.

for example:

%@foo.com server1
%@bar.com server2
% server3

user ***@foo.com goes to server1, ***@bar.com to server2, and ***@baz.com to
server3.

if this is of interest i can send the patch. or if i've just missed an
obvious way to handle this, let me know that :-).
Simon Horman
2015-03-06 11:47:01 UTC
Permalink
I'm not opposed to this idea, but the same result can be achieved
using a regex popmap. So I wonder if there is a need for mysql maps
to support this feature.
Post by Joe Pruett
is this something that people would use? i have made a local patch that
lets me do some sql wildcard matching if there isn't an exact match in
the db. this allows me to have a front end server for multiple domains
and unless something needs special per-user handling, i can just match
on the domain and route on that. it even allows for multiple wildcard
matches and chooses the longest pattern as the best one.
% server3
server3.
if this is of interest i can send the patch. or if i've just missed an
obvious way to handle this, let me know that :-).
______________________________________________
Perdition-users mailing list
http://lists.vergenet.net/listinfo/perdition-users
Joe Pruett
2015-03-06 14:50:49 UTC
Permalink
my reason for this is that i plan to use perdition to migrate a large
number of users from one server to another (or perhaps multiple servers)
over a period of time. it feels like using a real db will be safer than
updating a text file, as well as better performance.

but, my instincts may be all wrong. i'll take a look at the regex code
to see if that might work well enough.
Post by Simon Horman
I'm not opposed to this idea, but the same result can be achieved
using a regex popmap. So I wonder if there is a need for mysql maps
to support this feature.
Post by Joe Pruett
is this something that people would use? i have made a local patch that
lets me do some sql wildcard matching if there isn't an exact match in
the db. this allows me to have a front end server for multiple domains
and unless something needs special per-user handling, i can just match
on the domain and route on that. it even allows for multiple wildcard
matches and chooses the longest pattern as the best one.
% server3
server3.
if this is of interest i can send the patch. or if i've just missed an
obvious way to handle this, let me know that :-).
______________________________________________
Perdition-users mailing list
http://lists.vergenet.net/listinfo/perdition-users
Simon Horman
2015-03-07 02:18:09 UTC
Permalink
Hi Joe,

I could be wrong but I suspect that if the regex file has only
a few entries then performance should not be an issue. And you
should be able to update the map on the fly, though I do take your
point about safety.

If you do decide this feature is useful please feel free to send a patch.
Post by Joe Pruett
my reason for this is that i plan to use perdition to migrate a large
number of users from one server to another (or perhaps multiple servers)
over a period of time. it feels like using a real db will be safer than
updating a text file, as well as better performance.
but, my instincts may be all wrong. i'll take a look at the regex code
to see if that might work well enough.
Post by Simon Horman
I'm not opposed to this idea, but the same result can be achieved
using a regex popmap. So I wonder if there is a need for mysql maps
to support this feature.
Post by Joe Pruett
is this something that people would use? i have made a local patch that
lets me do some sql wildcard matching if there isn't an exact match in
the db. this allows me to have a front end server for multiple domains
and unless something needs special per-user handling, i can just match
on the domain and route on that. it even allows for multiple wildcard
matches and chooses the longest pattern as the best one.
% server3
server3.
if this is of interest i can send the patch. or if i've just missed an
obvious way to handle this, let me know that :-).
______________________________________________
Perdition-users mailing list
http://lists.vergenet.net/listinfo/perdition-users
______________________________________________
Perdition-users mailing list
http://lists.vergenet.net/listinfo/perdition-users
Matthias Hunstock
2015-03-08 09:30:27 UTC
Permalink
Post by Joe Pruett
it feels like using a real db will be safer than
updating a text file, as well as better performance.
Using a bigger and more complex system is safer and has better
performance? ;)

The only advantage of using a database in this context is that you can
update the configuration from somewhere else, e.g. using some WebService
or similar. If you don't do somehting like that, you're way better off
with using just the text files - in my opinion.


Regards
Matthias

Loading...