4 ms·
> Where is the data actually being stored in this setup? A copy on each machine running the application? Yes, each node has a full copy of the database locally
by benbjohnson 4y ago
> Where is the data actually being stored in this setup? A copy on each machine running the application?
Yes, each node has a full copy of the database locally.
> If so, is there another copy somewhere else (e.g. S3) in case all nodes go down?
S3 replication support is coming[1]. Probably in the next month or so. Until then, it's recommended that you run a persistent volume with your nodes.
> What happens if the Consul instance goes down?
If Consul goes down then you'll lose write availability but your nodes will still be able to perform read queries.
> If my application nodes can't be ephemeral then this seems like it would be harder to operate than Postgres or MySQL in practice.
Support for pure ephemeral nodes is coming. If you're comparing LiteFS to a single node Postgres/MySQL then you're right, it's harder to operate. However, distributing out Postgres/MySQL to regions around the world and handling automatic failovers is likely more difficult to operate than LiteFS.
- omnimus 4y agoWill this replicate the filesystem/volume between instances? Can for example use text files or different kind of filebased database? Or it requires me to use sqlite?
- simonw 4y agoThis is only for SQLite. But you can put text files (or even binary files - see https://simonwillison.net/2020/Jul/30/fun-binary-data-and-sqlite/ https://simonwillison.net/2020/Jul/30/fun-binary-data-and-sq...) in a SQLite database and you may find you get better performance than reading files from disk: https://www.sqlite.org/fasterthanfs.html https://www.sqlite.org/fasterthanfs.html
- hinkley 4y ago> If Consul goes down then you'll lose write availability but your nodes will still be able to perform read queries. That's a tricky choice of words, since it looks like you lose Consistency, while retaining Availability and Partition Tolerance. If Consul is down everyone reads stale data, but no writes. Right? Of course, it's harder for Consul to go down than it is for your database to go down, so the Venn Diagram of "Consul unhappy, Database Happy" is fairly heavily populated with "user error". Which is why 'when in doubt, use Consul' is not terrible advice.