News for hackers. Stuff that matters.
Re:Gcsfuse: A user-space file system for interacting with Go... by londons_explore on Wednesday September 06, 2023 @06:55AM (#37403440)
Append workloads are common in distributed systems. Turns out nearly every time you think you need random read/write to a datastructure (eg. a hard drive/block device for a Windows/Linux VM), you can instead emulate that with an append-only log of changes and a set of append-only indexes.

Doing so has huge benefits: Write performance is way higher, you can do rollbacks easily (just ignore the tail of the files), you can do snapshotting easily (just make a new file and include by reference a byte range of the parent), etc.

The downside is from time to time you need to make a new file and chuck out the dead data - but such an operation can be done 'online', and can be done during times of lower system load.

Re:Gcsfuse: A user-space file system for interacting with Go... by capableweb on Wednesday September 06, 2023 @07:31AM (#37403626)
> Append workloads are common in distributed systems.

Bringing back the topic to what the parent was saying; since S3 is a pretty common system, and a distributed system at that, are you saying that S3 does support appending data? AFAIK, S3 never supported any append operations.

Re:Gcsfuse: A user-space file system for interacting with Go... by ozfive on Wednesday September 06, 2023 @07:44AM (#37403716)
It does not. Consider using services like Amazon Kinesis Firehose, which can buffer and batch logs, then periodically write them to S3.
Re:Gcsfuse: A user-space file system for interacting with Go... by vlovich123 on Wednesday September 06, 2023 @12:55PM (#37407773)
I’ll add some nuance here. You can implement append yourself in a clunk way. Create a new multipart upload for the file, copy its existing contents, create a new part appending what you need, and then complete the upload.

Not as elegant / fast as GCS’s and there may be other subtleties, but it’s possible to simulate.

Re:Gcsfuse: A user-space file system for interacting with Go... by merb on Wednesday September 06, 2023 @07:04AM (#37403484)
you just described wal files of a database.
Re:Gcsfuse: A user-space file system for interacting with Go... by tough on Wednesday September 06, 2023 @11:29AM (#37406576)
ha I was just thinking how similar this was to postgres pg-audit way of reusing the logs to sum up the correct state
Re:Gcsfuse: A user-space file system for interacting with Go... by KRAKRISMOTT on Wednesday September 06, 2023 @11:57AM (#37406995)
The generalized architecture is called event sourcing
Re:Gcsfuse: A user-space file system for interacting with Go... by capableweb on Wednesday September 06, 2023 @12:15PM (#37407260)
Well, I'd argue that it's just two different names for similar concepts, but applied at different levels. WAL is a low-level implementation detail, usually for durability, while Event Source is a architecture applied to solve business problems.

A WAL would usually disappear or truncate it's length after a while, and you'd only rerun things from it if you absolutely have two. Changes in business requirements shouldn't require you to do anything with a WAL.

In contrast, Event sourcing log would be kept indefinitely, so when business requirements change, you could (if you want to, not required) re-run N previous events so you can apply new changes to old data in your data storage.

But, if you really want to, it's basically the same, but in the end, applied differently :)

Re:Gcsfuse: A user-space file system for interacting with Go... by slt2021 on Wednesday September 06, 2023 @05:15PM (#37411423)
WAL is just one moving piece of database, that could be using SSTable or LSM tree or some other append-only immutable data structure, and the Event Sourcing is enterprise architecture pattern applied to business applications that heavily relies on immutable append-only data structures as the backbone