Comments (8)
@Testinos can you provide an example of how that feature would look like? One thing I can think of is adding a prefix for every key based on pool information, so for example get key
sent to mcrouter would result in get user:key
sent to memcached - do you mean something like that?
Note that mcrouter already supports sending to different destinations depending on the key prefix, so for example you can send get a:key
to 'a' servers and get b:key
to 'b' servers - see https://github.com/facebook/mcrouter/wiki/Prefix-routing-setup
from mcrouter.
@alikhtarov mysql memcached present namespace, namespace it is dedicated tables in database for storage data.
Example:
mysql memcached database(database: memcached, tables "sessions", "default")
telnet 127.0.0.1 11211 (one connection for next 4 steps)
- get @@sessions (set namespace)
- set test (set key for "sessions" namespace)
- get @@default
- set test1 (set key for "default" namespace)
referer: http://dev.mysql.com/doc/refman/5.6/en/innodb-memcached-intro.html (ctrl + F "Namespaces")
from mcrouter.
@Testinos I see. Mcrouter will already pass through those commands ("get @@namespace") to the server, so you can just proxy those requests to a mysql memcached server directly and everything will work as expected. Do you have a use case in mind where mcrouter itself should handle namespace logic?
from mcrouter.
@alikhtarov thing is mcrouter uses connection pooling as stated in documentation and namespaces work per connection. So mcrouter should know which namespace to use on a destination connection based on source connection namespace.
from mcrouter.
@exception0x876, All right.
So possible improve this in mcrouter?
from mcrouter.
I see implementation this, example:
*I have 4 namespace
Announce this 4 namespaces in mcrouter config, without depending Route Handles.
For every announce namespace create dedicated connection pool to memcached servers, and so if client after connect to mcrouter send command ("get @@namespace") send all traffic from this source connection to specially connection pool with command ("get @@namespace".)
from mcrouter.
So you can already do requests like "get @@namespace.key" using prefix routing. But there's no way to maintain state per connection like you suggest. Adding support for this is not trivial, as currently there's no correspondence between client and server connections in mcrouter by design, so that clients can share the server connections. This means that every request/reply pair is independent. If a client sends "get @@namespace", and we forward it to the server, all other clients sharing the server connection will be affected.
from mcrouter.
Thanks for reply.
from mcrouter.
Related Issues (20)
- Simple replication model not working as expected HOT 1
- `mg` for WarmupRoute?
- CentOS 8 RPM/Build Support HOT 1
- Cannot build ubuntu20 docker file HOT 5
- Memcached server specification (TLS/SSL) documentation HOT 1
- Error to build docker image with docker file... HOT 1
- Last stable version
- Warmup related configuration incase we are running mcrouter and memcache on kubernetes
- Mcrouter adds MC_MSG_FLAG_BIG_VALUE flag but never removes it HOT 4
- AsyncSocketException: AsyncMcClient, type = Socket not open HOT 1
- unable to build new py3 thrift changes in upstream
- ubuntu 20.04 building issue HOT 1
- Failed to build on Ubuntu 22.04 HOT 1
- Addition of a pre-populated replica
- New Ubuntu package HOT 2
- Failed to build on ubuntu18.04
- How can I traverse a server in the pool? HOT 1
- Issues after memcached version upgrade
- does AllFastestRoute route consider miss as errors?
- folly build error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mcrouter.