-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MultiTenancy #36
Comments
We (at HouseTrip) have chosen to mot make multitenancy part of blurrily's C internals to keep it as simple as possible. The server does support multiple "databases" though, as provided by MapGroup, and you could have one client per "type" (database) without significant overhead. I'd suggest writing a wrapper class around the client, e.g. (pseudocode): class MultiClient
def initialize(types)
@clients = {}
types.each { |t| @client[type] = Blurrily::Client.new(db_name: type) }
end
def put(value, key, type)
@clients[type].put(value, key)
end
def find(key, type=nil)
if type
return @clients[type].find(key)
end
@clients.values.map { |c| c.find(key) }.magic_sort_method
end
end |
Fast response! Thanks. Sounds like a sensible approach. That makes a lot of sense and is in fact how we are doing some other tenancy type issues...more on a per client basis (as we are SaaS)... so we have
Type things going on, and in fact already have a Blurrily instance per Organisation Tenancy. I'll add the next level down too, which will be a per tenancy tenancy as you suggest...will send a screenshot. :) Incidentally we are using Angular.js + Bootstrap TypeAhead to get our list of results from Blurily, works really well! Thanks, chat soon! M. |
Julien..your suggestion worked very well, thanks! Ended up looking like this... We just sorted on the Blurrily Score and Weights that come back in the end, which seems to work well enough. I must say it is fast. Calling 9 clients and then sorting (and displaying the resulting .json) all happens in around 250ms. Solid!
We added a bit of FontAwesome, Angular and Bootstrap so it now looks a little like this: |
Nice! Pretty sure we could cut down those 250ms by half or better, by being a bit smarter with clients (using a single connection & pipelining requests). |
Hello, Matt here! :)
One thing that would be amazing in Blurrily is the ability to hold multiple types and to optionally search by type:
So you would have code like:
client.put('London', 1337, 'Location')
client.put('London Grammar', 1335, 'Band')
the optionally find like this:
map.find('lonndon')
finds both
map.find('lonndon', 'Band')
finds only 'London Grammar'
Not sure if that is possible the way the trigrams are stored in a single file though?
The text was updated successfully, but these errors were encountered: