-
-
Notifications
You must be signed in to change notification settings - Fork 596
Server selection ability while making any cloud function calls #1431
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
Comments
Thanks for opening this issue!
|
It seems to be an elegant convenience wrapper for a REST call. Any other benefits this could have? |
As of now that I can think of are
@mtrezza if this feature looks good. I can try implementing the pr. |
Sorry for hijacking the discussion, but I do not think this provides any benefit to general parse server use. Will need more convincing I think. Your case is probably very specific in that you may have multiple different projects, all of them based on parse-server, that want to talk to each other via REST, but you want to simplify that, and believe that cloud function call with explicit server name will make this easier (for you). But I do not think this is the case. It may work in your concrete case, but to make it really generic for all parse users, such wrapper function may become very complex. To explain: does this method target the load balancer before the parse server instances?, does it use SSL? Does it target just one concrete instance behind the load balancer? Where does the server name come from? My suggestion for you would be to write a simple javascript module with one exported function that will wrap axios http library to perform a http call against a named parse server, with specified master key, and then require that module in your cloud code where needed. This will achieve the same faster, without requiring changes in the parse-server itself. What do you think? More reasons why this should be a core function of the parse-server? |
I think that all would be determined by the server address. It seems to be more of an architectural decision than a Parse Server configuration. Parse Server is currently unaware of whether its a single instance or part of a multi-instance target group behind a load balancer. Same for TLS, that's part of the connection string. I think what's missing here is a server address in addition to the server alias in the config: otherServers: [
{ name: 'server1', masterKey: 'key1', url: 'https://one_instance' }, // TLS connection to a single instance
{ name: 'server2', masterKey: 'key2', url: 'http://load_balancer' }, // non-TLS connection to a group of server instances
], It may be a convenient wrapper in a micro-service environment where references to other servers are more common. For now it's just a simple http request trapper, but I would be curious to see what other server interactions and co-configurations people come up with. |
The limitation here is actually regarding Parse JS SDK, which does not support instantiate multiple clients: #203 I think that would be a good addition to the JS SDK and I'd re-open the mentioned issue in the case someone is willed to tackle it. Anyways, I believe that this current issue does not belong to Parse Server repo. |
Closing as duplicate of #203. |
New Feature / Enhancement Checklist
Current Limitation
Not able to make cloud function calls to another parse server via Parse.Cloud.run('anotherServerFunctionName').
Feature / Enhancement Description
Ability to pass server selection details with option while make cloud function calls.
Example Use Case
Alternatives / Workarounds
ServerA can make a rest-API call to serverB to access serverBCloudFunction. But it would be better if parse can support this functionality.
3rd Party References
The text was updated successfully, but these errors were encountered: