News for hackers. Stuff that matters.
Re:Building a highly-available web service without a database by kitd on Saturday August 10, 2024 @01:58AM (#41207637)
Rqlite would be a better comparison. It is actually SQLite + raft

https://github.com/rqlite/rqlite

Re:Building a highly-available web service without a database by otoolep on Saturday August 10, 2024 @05:10AM (#41208270)
rqlite author here, happy to answer any questions.
Re:Building a highly-available web service without a database by lifeisstillgood on Saturday August 10, 2024 @06:30AM (#41208558)
So some dumb questions if you don’t mind

- In GitHub readme you mention etcd / consul. Is rqlite suitable for transaction processing as well ?

- I am imagining a dirt simple load balancer over two web servers. They are a crud app backed onto a database. What is the disadvantages of putting rqlite on each server compared to say having a third backend database.

Re:Building a highly-available web service without a database by otoolep on Saturday August 10, 2024 @06:51AM (#41208636)
As for your second question, I don't think you'd benefit much from than that, for two reasons: - rqlite is a Raft based system, with quorum requirements. Running 2-node systems don't make much sense. [1] - Secondly, all writes go to the Raft leader (rqlite makes sure this happens transparently if you don't initially contact the Leader node [2]). A load balancer, in this case, isn't going to allow you to "spread load". What is load balancer is useful for when it comes to rqlite is making life simpler for clients -- they just hit the load balancer, and it will find some rqlite node to handle the request (redirecting to the Leader if needed).

[1] https://rqlite.io/docs/clustering/general-guidelines/#cluste...

[2] https://rqlite.io/docs/faq/#can-any-node-execute-a-write-req...

Re:Building a highly-available web service without a database by otoolep on Saturday August 10, 2024 @06:45AM (#41208610)
It depends on what kind of transaction support you want. If your transactions need to span rqlite API requests then no, rqlite doesn't support that (due to the stateless nature of HTTP requests). That sort of thing could be developed, but it's substantial work. I have some design ideas, it may arrive in the future.

If you need to ensure that a given API request (which can contain multiple SQL statements) is atomically processed (all SQL statements succeed or none do) that is supported however [1]. That's why I think of rqlite as closer to the kind of use cases that etcd and Consul support, rather than something like Postgres -- though some people have replaced their use of Postgres with rqlite! [2]

[1] https://rqlite.io/docs/api/api/#transactions

[2] https://www.replicated.com/blog/app-manager-with-rqlite

Re:Building a highly-available web service without a database by lifeisstillgood on Saturday August 10, 2024 @07:32AM (#41208767)
Thank you - so my takeaway is that rqlite is well suited for distributed “publishing” of data ala etcd, but it is possible to use it as a Postgres replacement - thank you I will give it a go
Re:Building a highly-available web service without a database by Groxx on Saturday August 10, 2024 @01:21PM (#41210866)
I'll throw in a "ehh... sorta" though rqlite is quite neat and very much worth considering.

The main caveat here is that rqlite is an out-of-process database, which you communicate with over http. That puts it on similar grounds as e.g. postgres, just significantly lighter weight, and somewhat biased in favor of running it locally on every machine that needs the data.

So minimum read latency is likely much lower than postgres, but it's still noticeable when compared to in-process stuff, and you lose other benefits of in-process sqlite, like trivial extensibility.

Re:Building a highly-available web service without a database by kitd on Sunday August 11, 2024 @04:04AM (#41214682)
There's dqlite, which is a in-process sqlite with raft.

https://dqlite.io/