• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

LICENSEH A D22-Dec-20161 KiB2217

README.mdH A D22-Dec-20162 KiB5637

lava.shH A D22-Dec-2016948 3117

README.md

1# Lava
2
3> Nothing keeps your couch warm and molten like Lava. Keep your views flowing.
4
5Lava is a "view heater" for Apache CouchDB.
6
7CouchDB views are updated on read, so if a db has been written to many times
8without any reads in between, the next read of the view may be unexpectedly
9long, while the updated index is computed. This can be avoided by reading the
10view at reasonable internals, triggering an update. This is done using the
11`stale=update_after` view parameter.
12
13If you have large couch databases with views that are infrequently accessed, it
14can take an unacceptably long time to build that view when it is queried by your
15application.
16
17Lava is a simple MIT-licensed shell script with 2 dependencies that ensures all
18DBs that are readable by a given user have the views of their corresponding
19design documents rebuilt. It takes a single parameter, a CouchDB instance url,
20with optional credentials, and bails at the first sign of an error.
21
22It is expected to be run from cron or similar scheduler every half an hour or
23so.
24
25## Usage
26
27Just pass in your base CouchDB URL:
28
29    /usr/local/bin/lava.sh https://user:passwd@localhost:5984
30
31Note the lack of trailing slash / and a username and password. The user does
32not need to have admin privileges on the DB nor on the couch instance, a read
33only user suffices -- only the ddocs are actually read.
34
35## Dependencies
36
37- [/bin/sh](https://www.freebsd.org/cgi/man.cgi?query=sh) the one true shell
38- [jq](https://stedolan.github.io/jq/) an incredible JSON processor
39- [curl](https://curl.haxx.se/) the internet was broken before cURL
40- [couchdb](https://couchdb.apache.org/) go forth and replicate
41
42## Bugs
43
44It would be nice if it could take a second optional parameter, consisting of
45regexes for paths (db or ddocs) to skip. PRs are welcome.
46
47## Thanks
48
49Lava was painstakingly created by the self-proclaimed geniuses at
50[iwantmyname], a fairly awesome domain registrar in Wellington, New Zealand. If
51you like (dare I say, love?) Lava, be sure to think of us when you're getting
52your next domain.
53
54[iwantmyname]: https://iwantmyname.com/
55
56