PostgreSQL reconsiders its process-based model
11–20 of 377 posts
Re: PostgreSQL reconsiders its process-based model
#12That sounds like really hard programming. I’m glad I write react and get paid possibly much more.
Re: PostgreSQL reconsiders its process-based model
#13I'm honestly surprised it took them so long to reach this conclusion. > That idea quickly loses its appeal, though, when one considers trying to create and maintain a 2,000-member structure, so the project is unlikely to go this way. As repulsive as this might sound at first, I've seen structures of hundreds of fields work fine if the hierarchy inside them is well organized and they're not just flat. Still, I have no…
Re: PostgreSQL reconsiders its process-based model
#14I've had a similar situation with PHP, where we had written quite a large engine (https://github.com/Qbix/Platform) with many features (https://qbix.com/features.pdf) . It took advantage of the fact that PHP isolated each script and gave it its own global variables, etc. In fact, much of the request handling did stuff like this:
Q_Request::requireFields(['a', 'b', 'c']);
$uri = Q_Dispatcher::uri();
instead of stuff like this: $this->getContext()->request()->requireFields(['a', 'b', 'c']);
$this->getContext()->dispatcher()->uri();
Over the last few years, I have run across many compelling things: amp
reactPHP
Swoole (native extension)
Fibers (inside PHP itself)
It seemed so cool! PHP could behave like Node! It would have an event loop and everything. Fibers were basically PHP's version of Swoole's coroutines, etc. etc.Then I realized... we would have to go through the entire code and redo how it all works. We'd also no longer benefit from PHP's process isolation. If one process crapped out or had a memory leak, it could take down everything else.
There's a reason PHP still runs 80% of all web servers in the world (https://kinsta.com/blog/is-php-dead/) ... and one of the biggest is that commodity servers can host terrible PHP code and it's mostly isolated in little processes that finish "quickly" before they can wreak havoc on other processes or on long-running stuff.
So now back to postgres. It's been praised for its rock-solid reliability and security. It's got so many features and the MVCC is very flexible. It seems to use a lot of global variables. They can spend their time on many other things, like making it byzantine-fault-tolerant, or something.
The clincher for me was when I learned that php-fpm (which spins up processes which sleep when waiting for I/O) is only 50% slower than all those fancy things above. Sure, PHP with Swoole can outperform even Node.js, and can handle twice as many requests. But we'd rather focus on soo many other things we need to do :)
Re: PostgreSQL reconsiders its process-based model
#15Re: PostgreSQL reconsiders its process-based model
#16Re: PostgreSQL reconsiders its process-based model
#17This sounds like a problem that would border on the complexity of replacing the GIL in Ruby or Python. The performance benefits are obvious but it seems like the correctness problems would be myriad and a constant source of (unpleasant) surprises.