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

Multiple Endpoints #1

Closed
ascrookes opened this issue Dec 4, 2015 · 6 comments
Closed

Multiple Endpoints #1

ascrookes opened this issue Dec 4, 2015 · 6 comments

Comments

@ascrookes
Copy link

First, I just want to say I'm glad you are tackling this! If you have a list of TODOs I would love to help out.

Second, is there a way to us multiple endpoints? Ideally I would be able to send read requests and write requests to different instances.

@florinpatrascu
Copy link
Owner

Thank you for your interest in this project and I appreciate your offer to help. I am too learning Elixir. In fact I started this project because of that :) I'll answer to the TODO topic on the other issue.

To your second question. This is a tough topic and from my experience using other frameworks and technologies, this was never a clear path. I won't ask you the reasons why would you need that, especially in a Neo4J universe, where you would like to have your model relationships in the same store/db, or in a cluster managed by Neo4J itself, if they are too many. Regardless, it can be done but I'd like to finish first the rest of the implementation and we'll get back to this, if you don't mind?! Thanks again and I welcome any pull requests if you spot places that can be improved, I am sure they are many. Tests would be a place to start with.

@ascrookes
Copy link
Author

Ok awesome!

Yeah makes sense. Should totally add it to the TODO list though :)
The reason is that I have a cluster that is load balanced to spread out the reads across all the instances. However the writes need to be sent to the master instance. The way I do this in my other project using Neo4j is that I have "two" graphs. One that points to the master instance. One the points to the load balanced read instances.

@florinpatrascu
Copy link
Owner

I see. Have you thought, since you have a clear separation between the Reads and the Writes, to use a simple HAProxy and create some very simple routing rules to send the GETs to the instance from where you read and the POSTs/PUTs/DELs/.. to the instance designated for writes/updates? That's how I'd do it, to be honest with you. Then provided you have a Neo4j cluster, the cluster will stay consistent w/o you doing it in programatic mode, from the Elixir app. My 0.2CAD

@ascrookes
Copy link
Author

I have that on the roadmap, just haven't gotten to it. The library I currently use sends everything to the Neo4j instance as a POST method since that is what it is expecting, making it a bit harder to put the proxy in there. Definitely doable though :)

@florinpatrascu
Copy link
Owner

Amadou - I added your request to the todo list, but I still need to convince myself that we need it, unless you insist it's a must have :) I'll look into it as soon as I fix the legacy tests related to the Model.

@ascrookes
Copy link
Author

Sorry about the delayed response, but sounds good!

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

No branches or pull requests

2 participants