Skip to content

Does rqlite do any local caching for read-only nodes? #1183

Answered by otoolep
acuozzo asked this question in Q&A
Discussion options

You must be logged in to vote

Have you read the docs on read-only nodes? And on read-consistency?

I presume by "caching" what you really want to do is to serve reads from the read-only node, without that node going all the way back to the leader. If so, just select "none" for consistency, and read-only node will serve the data from the local copy of the SQLite database (which is in-memory) by default.

https://rqlite.io/docs/api/read-consistency/#none

So if you send your query to a local read-only node, using the following form:

curl -G 'localhost:4001/db/query?level=none&freshness=1s' --data-urlencode 'q=SELECT * FROM foo'

The read-only node will serve the data by reading the local SQLite database, also ensuring that …

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@acuozzo
Comment options

Answer selected by acuozzo
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants