Skip to content
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

Native client is a dynamic var, rather than managed by user #42

Closed
jonpither opened this issue Sep 27, 2013 · 1 comment
Closed

Native client is a dynamic var, rather than managed by user #42

jonpither opened this issue Sep 27, 2013 · 1 comment

Comments

@jonpither
Copy link
Contributor

Hi,

Wondering why there is a difference between the way the client var is handled for rest vs native.

For rest the developer using elastisch has to manage the client object. For native is stored inside the client dynamic var.

The latter has issues, for example if a service/app wants to talk to two different ES instances this is unmanageable right? As a user of elastisch I also want to lifecycle manage the connection myself.

A change would probably be breaking to existing lib users, so I can see a downside in switching. Interested to know why the dynamic var approach was originally taken...

thanks,

Jon.

@michaelklishin
Copy link
Member

The goal was to provide the same API as the HTTP client. With HTTP client you have another var (the endpoint) that has the same upsides and trade-offs as *client* in the native one. Having one less argument to pass is convenient and most people do not interact with more than one cluster/database/etc.

In Monger, this is mitigated by having another namespace (monger.multi) that has a set of key functions that have
the db (client) argument added. I'm afraid Elastisch API is much larger to do the same thing.

In the native client specifically you can connect to multiple ES nodes in the same cluster. Joining multiple clusters is not supported as far as I know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants