bonesmoses

Joined 11 years ago

Karma
229
Submissions
59
Member since
Apr 6
I've been a DBA since 2001, working exclusively with PostgreSQL since 2005. I just like to tinker.
View on Hacker News

Recent submissions

Comment · 4 months ago
Postgres 19 is looking to be a solid release. I don't think I've seen this much "new" stuff in a single version since v10 came out.
Comment · 4 months ago
Awesome! I'll look forward to that. :)
Comment · 1 year ago
Version 3.6 is definitely after we introduced that functionality. It was, alas, rarely deployed though. Usually clients needed a consultant to put together a configuration for them, and most didn't bother.
Comment · 1 year ago
There's an option in the Postgres configuration named "track_commit_timestamp" that does this automatically. It's required to be enabled when using LWW as the conflict resolution model. If there's a tie, the node with the highest node number wins.
Comment · 1 year ago
I don't recall which customer you may have been, but the standard solution to that specific DDL issue with BDR is to use Stream Triggers to enable row versioning. One of the 2ndQuadrant customers used it extensively for multi-region cross-version app schema migrations that could last for months.

Essentially what that boils down to is you create stream triggers that intercept the logical stream and modify it to fit the column orientation by version. So during the transition, the triggers would be deployed to specific nodes while modifications are rolled out. Once everything was on the new version, triggers were all dropped until the next migration.

Spock doesn't have anything like that _yet_, but as you observed, being unable to use DDL replication significantly increases complexity, and tmux is a poor substitute.

Comment · 1 year ago
You can't even run pgbench unaltered on CockroachDB, as simple table structures and indexes are fundamentally different there. It is in no way a compatible product, and never has been.
Comment · 1 year ago
Comment · 2 years ago
I'm not against using UUIDs, but it has to be done in a balanced manner. Normal numeric IDs for all surrogates, and then a UUID as an external lookup attribute. You push that externally for API calls, tokens, etc. so you don't have to worry about leaking sequential values, so it should be indexed. Otherwise, it's purely a lookup to key you into the JOIN chain for everything else.

That said, Now that UUIDv7 is available, switching to that should be a priority.

Comment · 4 years ago
Comment · 6 years ago
Right tool for the right job. Users in Tokyo won't be editing accounts for users in Austrailia. There's often a natural partition there where you can leverage the data locality with an eventual consistency basis safely.

Conflict-free Replicated Data Types (CRDTs) and column-level conflict resolution also largely address the issue with data merges and coarse counter systems. I'll just ignore the general design flaw there, considering these should be an insert-only ledger system rather than counters, because bad or naive implementations abound. I get that the application layer shouldn't necessarily have to coddle the database, given absolute ACID would resist non-ideal usage patterns.

I haven't played with the others, but I set up an 8-node CockroachDB and managed to get pgbench to run on it. I was clearly doing something wrong, because I wasn't impressed at the throughput even with very high client counts. From what I could see there, I was clearly being throttled by some mix of RTT and locking contention between the 3-node default consensus group. Supposing this is not problematic in non-overlapping shard locality, you still hit a hard performance ceiling when multiple clients interact with the same pool fragment.

I'll have to look at the others now.

Comment · 6 years ago
LWW / LUW systems are a fine first approximation, but generally do not fulfill the strictest guarantees and desirable outcomes for a database without accounting for a lot of edge cases.

A good conflict management system will have that only as a default. Better ones will also provide mechanisms for overriding LWW in specific scenarios on a per table or even row basis depending on the in/out values from both nodes. The trick is building these conflict management rules so they're independently deterministic, or you'll end up with node divergence.

Normally we just do what you said, and strongly recommend interacting with sticky sessions, geographically disparate segments, etc., to prevent the problem before it happens. It's far easier to avoid a conflict than to correct it after the fact.

While a consensus model "fixes" this, it drastically cuts your throughput to a function of the latency of the most remote node in the quorum, essentially defeating the purpose of having a local Master node. Ideally you would reserve this for specific transactions that are sensitive in that they require absolute consistency regardless of incurred latency (See PACELC). And even this requires a distributed deadlock detector unless more than just the transactions are managed through the consensus layer.

BDR for example provides both of these models for the above reasons. Multi-Master is not an easy problem to solve, and requires a multi-faceted approach to even come close to something usable in a generalized scenario.

Comment · 7 years ago
I had a very protracted DPDR experience start around when I was 12, and slowly dissipated over the course of a decade. I woke up one morning, and it was like I was slapped out of my body. It's like I was piloting a Me(ch) suit.

I wasn't seeing through my eyes. They were transmitting, with perceivable lag and some kind of acknowledged overlay, their sensory data. It's like being embedded in _extremely advanced_ and nearly seamless VR, but also hyper aware of the "nearly" part. It's like the Uncanny Valley effect, but directing it toward your own sensory system.

It doesn't feel quite real anymore, and you don't know why. So that's probably how I'd convey it. "You know the Uncanny Valley? Imagine everything you experienced felt that way."

It's uniquely awful.

Comment · 8 years ago
Just the annoyance of having to itemize a receipt _to that granularity_ would annoy me enough to quit working at a company like that.
Comment · 9 years ago
That's an excellent point. By opening up this can of worms, MySQL fans essentially get free reign to take shots at Postgres for flaws it still has for one reason or another. Perceived or genuine.

On the other hand, sometimes a good flamewar really gets the juices flowing and sheds valuable light on painful truths. Even Postgres can learn from being the butt of a few jokes.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton