-
Notifications
You must be signed in to change notification settings - Fork 6
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
Implementing Bolt v2 (and logs) #22
Comments
Hey @dominique-vassard, first off thank you very much for the hard work and feedback you provided. It's great to have more people work on bolt for Elixir. I'd very much like to integrate the work that you've done with Boltex to avoid fragmentation. Let me address some suggestions:
I like that idea a lot. Not much more to say. :)
I had all the Bolt structures implemented at some point but decided together with @florinpatrascu to keep this driver low level as having nodes, paths, etc. in here would've incurred serious refactoring in BoltSips. Happy to revisit.
Totally agree that we should add logs, should be the simplest of all tasks here.
I'm sorry that I haven't replied to #21 yet, I agree that we should implement the new data types. When I was briefly looking at the issue I didn't yet find the new types in the Bolt documentation, probably because v2 isn't stable yet. That shouldn't stop us from implementing v2 already tho. We should only support v2 and release a new major version of Boltex. We can use v1 for the stable branch of Bolt v1 support and v2 for newly introduced Bolt v2 support. How should we go forward? Do you want to take a stab at porting your code to Boltex or should I start with adding logging? Please note that I'm currently not using Neo4J in production, so apologies if I can't dedicate as much time as I wanted to. Thanks, |
BTW here's the branch where I started to implement Bolt structs in this driver: https://github.com/mschae/boltex/tree/mschae/struct-datatypes |
Hi, Regarding Bolt v2 documentation, there isn't any. I got in touch with Nigel from Neo4j and he said he will eventually work on the documentation. All implementation I've made are pure reverse engineering of the Python and JS driver maintained by the No4j team. There's not that much new features, then it wasn't too hard, once I understand how Bolt works. An the good news is it's just addition, no updates of previous data encoding/decoding, just new structures in fact.
I guess it would be wise to implement V2 as V1, then no structures in boltex, and maybe in the future, after discussing this issue with @florinpatrascu, get them into boltex.
I agree with that. In fact, if someone uses V2 features over a non-compliant database version, database will send back an error (as it already does), so no big deal
I won't be able to work a lot on it before early september because of vacation (without computer), but you still can implement the logging system and I will merge my work and yours for mutual benefits :)
No problem, I don't actually use Neo4j in production but I hope it will be the case next year if I manage to get my project live. Thanks |
Hi, I'm talking about the first version of boltex working with Bolt protocol v2 but without the graph / spatial / temporal structs. We need to get in touch with florinpatrascu to know wether we implement this on boltex side or not. |
Ok, you've got a PR. |
That's been a bumpy road sometimes but v2 is finally here! |
Hi @mschae and @dominique-vassard You guys both did an awesome job taking Boltex this far, and the last refactoring round is awesome, thanks a lot for making this happen. I read through the the threads so far and thought I'd add my 0.02 CAD in here, trying to address @dominique-vassard's POV re. bolt_sips. Yesterday, I published a new version of bolt_sips, still using the old (published) boltex but refactored bolt_sips according to the newest DBConnection design. This is meant to pave the road for future development eventually and hopefully safer this time, since DBConnection's design appears to be finally settled. Of course there are a couple of breaking changes, such as the support for non-closure based transactions; these were removed relatively late from DBConnnection, triggering some late changes in bolt_sips too. Back to the topic. @dominique-vassard is questioning the decision about keeping the neo4j structures in bolt_sips. As @mschae mentioned, the decision was taken as a desire to keep boltex agile, lean and low-level, so it can react faster to the always-moving neo4j specs .. oh wait .. what specs?? j/k :) However, if you guys believe these structures should go into boltex instead, then I am willing to refactor bolt_sips and fallback on boltex. Note to self: in that scenario I am not sure about the value a different driver would have?! bolt_sips would become too light to justify forcing the users grabbing two dependencies instead of one?! I am not using neo4j as I used to, but I am still passionate about it, hence the time I can put in this development is mostly using my free time whenever I can find it; weekends, nights - as you very well know from your own experience, as OS developers. If you believe Boltex should be supercharged, then maybe we should put all the effort into creating only one driver, but this will not be an easy task, especially given the need for offering the bolt routing protocol too; requiring a fair amount of work, to be done properly. Also, in the scenario where there is only one driver, how would you guys see the license model? Honestly, my entire career as OS dev, I releases everything under Apache or MIT, but after some bitter experience with some users of bolt_sips, I am contemplating switching to a different license model i.e. GPLv3 maybe? What are your thoughts on this? Anyway, I am open for any proposals that will result in a better Elixir driver for Neo4j. |
For now, I don't think the bolt protocol foundation will change (messages, basic types) but just add new types via structure. If so, boltex won't need any changes. That's the good news and I hope I don't make a fool of myself on this. I understand your point of view regarding types in boltex. They are the thing in between bolt_sips and boltex and today, it's better to have them is bolt_sips to pattern match easily on them. I know that some person use them to provide some kind of Ecto-like experience and I don't want to discourage those effort (I will talk about it later). BUT Having bolt_sips and boltex merged is quite appealing:
I really like Neo4j and plan to use it for my future project, but to be honest, there's a lot of work if we want to provide Elixir's users a good Neo4j experience. I don't know how much is required for merging the 2 projects but I think it's be a great thing to do and will be happy to be part of it! |
For information: |
@dominique-vassard - than you for the heads-up! I am also curious where this driver aims to go. Last time I checked, it had no pool support, and a couple of other things missing. We'll see how it goes, and then we can decide to use it wrapped in db_connection, or in a similar fashion. |
Hey guys, I was the one raising the issue about temporal types in boltex/bolt_sips. I missed this discussion, as we had quite some issues at work which delayed the project using neo4j. But we are about to launch and I was checking if something happened in the meantime. As @dominique-vassard mentioned, there is a new connector based on C: seabolt. I am still learning a lot about elixir and neo4j, so I wont be too much of a help. Especially as neo4j's documentation on the protocol is far from good. I guess I have to walk the same road as @dominique-vassard and read the JS source code 😢 But if there is anything else I can help with, please count me in. We plan to use neo4j with elixir and therefore are happy to contribute back to the community - namely boltex and bolt_sips. |
Hi namxam, The pending question is about merging bolt_sips and boltex or not. What do you need to know about the protocol? And you're welcome to contribute to elixir-neo4j environment! |
I personally prefer a pure Elixir implementation, for all the reasons mentioned above.
I had at least two iterations, where boltex (was personalized) and included in the bolt_sips. While that was probably less confusing from the end-user perspective, @mschae and I decided to keep them apart so that we can focus on separate responsibilities, especially since none of us had the time fully allocated to this project, nor any other external support for development. These days, I am seeing most of the Neo4j drivers include everything, so probably we should do the same; include the boltex in bolt_sips, or creating a new project which will offer everything (including the bolt+routing?!) Tho' given the effort for materializing the latter, I'd question the driver current license (MIT) and personally would opt/suggest approaching a dual one: open source and commercial - but that's just me thinking out loud, saving this for another time ;) Thank you all for your interest and support! |
Te separation between low ad high level appears only in Go and Python drivers, the others I've seen (js, .net) includes everything as you said.
And implement I don't know if there's part of bolt_sips that needs to be change and justifies the creation of a completely new project instead of just making it evolve. But in all cases, I will contribute! And the sooner we start, the better it is because Neo4j's next iteration will be on june and there can be a lot change (again)! |
@mschae Could you publish the v0.5.1 please? |
@dominique-vassard & @mschae - maybe this is a good time to join the two projects? Having boltex back into bolt_sips, would probably help speeding up the time required for shipping improvements to the end users? |
I'm ok with this. If it's ok for you, I can:
At this point, bolt_sips will be neo4j 3.5 ready, which will be nice. But the code won't be so nice though especially regarding error systems and types which needs to be unified. Then what needs to be done:
At this point, code will be nice and bolt_sips will be entreprise ready! And then, I can work on the low level refactor in order to bring Bolt v3 new messages, and make thing more explicit (i.e having If you're ok with this, I've got time now to work on this. |
Or maybe an umbrella could be a good first step |
As far as I’m concerned all these sound perfect, thank you for all this work you put in! No umbrella, please :) |
Alright sorry for dropping the ball so bad here... I'm all for consolidating bolt sips and boltex and I don't have a strong preference as to how we do it. We could start a new organization for this project even though that might be overkill. I suggest however we move forward the three of us become maintainers so I am no longer the bottleneck. We should still use PRs but we could all approve each others PRs. I plan on dedicating more time for my open source projects again but I am not using Neo in production ATM so I am afraid this will be a free time project. |
Hi Michael - no worries about becoming a bottleneck, life happens :) @dominique-vassard and I decided to move the I have no problem being part of a different project, if you all think a new project is what we want, but until then I'll send you an invite to the |
Hi, |
I’m super happy that you merged the projects. Seems like a good way to bundle our efforts! I’m all for it |
Hello,
First I'd like to thank you for your work on Boltex, it's a great tool, and along Bolt sips, to be able to use Neo4j with elixir is really enjoyable.
Recently, someone adds an issue on your project regarding temporal types which are implemented in Neo4j 3.4 and there isn't answers from you yet.
As an exercise, and because I need Neo4j for a future project, I wanted to make Boltex evolve and implement temporal / spatial types, which are in fact the V2 of the Neo4j bolt protocol.
Because I'm new to binary manipulation, and not so much experienced with elixir, I didn't really understand your code and things work. Then I decided to read about bolt protocol, read Neo4j's driver code for Js and python and your code, and code my own driver.
I ended up with something working, you can see it here: https://github.com/dominique-vassard/bolt-neo4j.
Now that I have a fully working driver and that I understand how things work, I'd like to collaborate to boltex and make it evolve.
But before, I have to understand some of choice and discuss some of choices I've made.
Messages as first decode stage
As you can see here: https://github.com/dominique-vassard/bolt-neo4j/blob/master/lib/bolt_neo4j/packstream/message.ex
I've implemented messages as struct.
This what done in order to have encoding / decoding completely decoupled from communication.
Then if you look in bolt.ex, there's nothing regarding signature, marker except for the handshake (which should be treated as the other message though) and some
<<0x00, 0x00>>
I think it is a good idea to have things structured like: Communication -> Message encoding / decoding -> Data encoding / decoding.
It will be easier to work on specific.
What do you think?
Bolt structure
I saw that none of the specific structures (node, relationship, path) are implemented in boltex. they are implemented in bolt_sips. Is there a specific reason for this?
Because bolt_sips knows about some specific signatures which are bolt-related. Won't bolt_sips should be only aware about client-server communication and use only this part of boltex?
Logs
There's no logs at all in your driver, and I found it hard to follow the data flow when I need it. In my project, I log every message between server and client, and that was easier to spot my errors and understand the communication flow.
Logs are similar to those implemented in Neo4j's Python and JS driver and looks like follow:
I think it would be great to have those in Boltex too. What do you think?
Of course, there are only for debug purpose and something should be done for the auth struct, which should'nt appear in logs.
Bolt v2
I think this part should be discussed with @florinpatrascu too.
As you may know, temporal and spatial types are supported in this new Bolt version.
It seems that Bolt V2 specs are not completely frozen and that some parts could be updated.
But in all case, it may be interesting to provide the V2 feature to Neo4j & elixir users.
With assumptions discussed above (struct in bolt_neo4j, logs, etc.), I've implement it and it works fine.
We have 2 options here:
You can take a look at the decoder_v2.ex to see what's going here: first proposal and its retruns are in comments, and the implementation is with new types.
Again, I want this to be clear, even if I have a fully working Boltex ersatz, my goal is not to replace it but to collaborate with you on it and help you maintaining it. An I hope it will be the case.
Thank you,
Dominique
The text was updated successfully, but these errors were encountered: