An unofficial, read-only Hacker News reader.

Show HN: Peat, a fork of Neon's serverless Postgres, on Postgres 18 and 19 (opens external site)

81 points by uptownhr 11 hours ago | github.com | 14 comments on HN

View full thread · View on Hacker News

Comment thread (2)

  1. > Code should always be written such that the block storage back-end (whether its local in the form of local hard disk space or whether its remote, in the form of Internet accessible block-based storage) is either #ifdef'd around (or the programming language's equivalent of #ifdef, i.e., "conditional compilation", "conditionally compiled", for example, in Rust it's '#[cfg(...)]', in Go it's '//go:build ...', in Zig it's 'if (@import("builtin")....)' or 'comptime', in Delphi/Pascal/FreePascal it's '{$IFDEF}..{$ENDIF}', etc., etc.

    I don’t think the main issue is the actual fread() calls. Virtualizing file access and having a pluggable interface for storage is nothing new.

    The real complexity is keeping that storage in sync when the server itself is distributed. In core PostgreSQL there’s a shared memory buffer pool. It’s accessed and serialized by all readers and writers. Offloading the physical writes is the easy part.

    Replies (1)
    1. >The real complexity is keeping that storage in sync when the server itself is distributed. In core PostgreSQL there’s a shared memory buffer pool. It’s accessed and serialized by all readers and writers. Offloading the physical writes is the easy part.

      An excellent point!

      Yes, there is the distributed aspect to things, and yes, keeping storage in sync if the server itself is distributed would be the greater complexity!

      (Random observation: There's a distinct difference here between databases with distributed servers here along the lines of "is a given distributed server going instance going to be used read only or must it also write? I.e., Read-Only distributed server instances, vs. Read-Write. If each instance has to be both, then yes, that's a lot of additional complexity! Another observation: If we permit write only instances, then write transactions are typically of two types: 1) Must lock all relevant records during update from all other writers (i.e. bank or financial transactions) and 2) Timestamped, locking unneeded, eventually consistent across all nodes (i.e., posts, status updates, likes, etc.)... if any instance has to do all of that (read and write) across the data shared by all nodes, then yes, that's quite complex! (Also, you haven't told me if instances are permitted to communicate to one another directly, or if all of their communication must be block-based, i.e., from the back-end, because then it needs to be determined how the communication for updates propagates! i.e., are multiple back-end blocks re-read at a specific interval?) etc., etc.)

      But yes, completely agreed!

      Related:

      CAP theorem:

      https://en.wikipedia.org/wiki/CAP_theorem

      Errors in Database Systems, Eventual Consistency, and the CAP Theorem (Michael Stonebraker):

      https://dsf.berkeley.edu/cs286/papers/errors-cacmblog2010.pd...

      Byzantine fault:

      https://en.wikipedia.org/wiki/Byzantine_fault

      GitHub: Awesome distributed databases:

      https://github.com/awelist/awesome-distributed-databases

      GitHub: Awesome distributed systems:

      https://github.com/FedericoPonzi/awesome-distributed-systems