Replies: 14 comments
-
LXD, which is the primary client for dqlite right now, proxies dqlite node-to-node connections from a local Unix-domain socket over an HTTPS transport, using WebSockets. You can see how that's set up here (and the rest of that source file): Would something like that work for the application you have in mind? I suspect that "deeper" I/O pluggability would run into the problem of integrating with dqlite's use of the libuv event loop. |
Beta Was this translation helpful? Give feedback.
-
At this point I don’t have a specific use case, but I’ve wanted something like this before, so I’m teasing out what it can & can’t do. (Also wrote a freestanding client library … have yet to publish, though.) It sounds like the expectation is that peer-to-peer and client-server interactions happen via abstract-domain local sockets, which in turn get proxied out? |
Beta Was this translation helpful? Give feedback.
-
I'll leave it to the other maintainers to speak on our expectations for dqlite consumers -- just wanted to share an example of how one existing consumer accomplishes those two goals (security and transport substitution) using the existing API. |
Beta Was this translation helpful? Give feedback.
-
It's not an expectation, since you can use plain TCP if that's good enough for you, but yes it's definitely the way to go if you need a custom transport (TLS, Websockets or whatever). Ideally there should be native C-level support for at least TLS, but that hasn't been done yet. In the go-dqlite client/bindings support for TLS is available and implemented using a proxy, you can look at the code there to understand the details, or ask us more if it's not clear. |
Beta Was this translation helpful? Give feedback.
-
Along this line—and I’m sorry if this isn’t the best forum to ask—what is the difference between the address given to Incidentally: https://metacpan.org/pod/Protocol::Dqlite |
Beta Was this translation helpful? Give feedback.
-
This is a fine place to ask. We have a Discourse forum at dqlite.io, but it's not really used. The address you pass to Hope that's clear. @cole-miller @MathieuBordere this might be a spot were documentation/docstrings need improvement, if it's not clear enough. |
Beta Was this translation helpful? Give feedback.
-
@freeekanayaka added to my checklist in canonical/dqlite-docs#4 |
Beta Was this translation helpful? Give feedback.
-
@freeekanayaka I found the Discourse forum, but as you say, it seems little-used. (Maybe Github Discussions would fare better?) If I’m understanding it correctly, it sounds like Thank you! |
Beta Was this translation helpful? Give feedback.
-
Note that we also have an IRC channel, #dqlite on Libera.Chat. It's mostly the developers chatting about CI/CD failures right now, but we do monitor it and you're welcome to post questions there. |
Beta Was this translation helpful? Give feedback.
-
Mentioning clients is correct. This is the externally visible address both for clients and other nodes.
The docstring here says:
probably we should say just "connections" instead of "client connections", because the purpose is really proxying connections, of any type. |
Beta Was this translation helpful? Give feedback.
-
OK, I think I’m getting it. Thank you! One last question: can a dqlite cluster (and clients) use only proxied connections? |
Beta Was this translation helpful? Give feedback.
-
Yes, that's exactly what happens in go-dqlite when you use TLS. The Go bindings for dqlite will start listening on the address passed to In that sense the dqlite cluster (and clients) use only proxied connections. I hope that's what you meant. |
Beta Was this translation helpful? Give feedback.
-
Ideally there should be native TLS support in dqlite, but that hasn't been implemented. That was the main motivation for the proxy support (TLS in Go is straightforward, while with |
Beta Was this translation helpful? Give feedback.
-
Also, regardless of TLS, some applications (like LXD) want to have a single endpoint for both their REST API and for dqlite traffic. Using a proxy makes that possible. I think it's a bit of a unique requirement though, in most cases having 2 separate endpoints (one for dqlite traffic and one for the application API) should be fine. |
Beta Was this translation helpful? Give feedback.
-
As I look at the interface to embed a server, I only see custom functionality to connect() to the peer; beyond that, Dqlite expects to do all I/O.
As best I can tell this presents at least two significant barriers to adoption:
It would be nice if Dqlite’s I/O were pluggable … has that been considered?
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions