TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Postgres is eating the database world

281 点作者 Vonng大约 1 年前

20 条评论

egnehots大约 1 年前
Postgres is far from perfect:<p>- The codebase is old and huge, accruing some heavy technical debt, making it a less than ideal foundation for iterating quickly on a new paradigm like AI and vector databases.<p>- Some ancient design decisions have aged poorly, such as its one connection per process model, which is not as efficient as distributing async tasks over thread pools. If not mitigated through an external connection pooler you can easily have real production issues.<p>- Certain common use cases suffer from poor performance; for example, write amplification is a known issue. Many junior developers mistakenly believe they can simply update a timestamp or increment a field on a main table with numerous columns.<p>So, yes, PG is one of the best compromises available on the database market today. It&#x27;s robust, offers good enough performance, and is feature-rich. However, I don&#x27;t believe it can become the ONE database for all purposes.<p>Using a dedicated tool best suited for a specific use case still has its place; SQLite and DuckDB, for instance, are very different solutions with interesting trade-offs.
评论 #39712965 未加载
评论 #39714371 未加载
评论 #39713714 未加载
评论 #39720159 未加载
jillesvangurp大约 1 年前
&gt; not to mention its ElasticSearch grade full-text search capabilities.<p>I played with postgresql a while ago to implement search. It&#x27;s not horrible. But it&#x27;s nowhere near Elasticsearch in terms of its capabilities. It&#x27;s adequate for implementing very narrow use cases where search ranking really doesn&#x27;t matter much (i.e. your revenue is not really impacted by poor precision and recall metrics). If your revenue does depend on that (e.g. because people buy stuff that they find on your website), you should be a bit more careful about monitoring your search performance and using the right tools to improve performance.<p>But for everything else you only have a handful of tools to work with to tune things. And what little there is is hard to use and kind of clunky. Great if that really is all you need and you know what you are doing but if you&#x27;ve used Elasticsearch and know how to use it properly you&#x27;ll find your self missing quite a few things. Maybe some of those things will get added over time but for now it simply does not give you a lot to work with.<p>That being said, if you go down that path the trigram support in postgres is actually quite useful for implementing simple search. I went for that after trying the very clunky tsvector support and finding it very underwhelming for even the simplest of use cases. Trigrams are easier to deal with in postgres and you can implement some half decent ranking with it. Great for searching across product ids, names, and other short strings.
评论 #39713025 未加载
评论 #39714360 未加载
zachmu大约 1 年前
We&#x27;re writing a postgres-compatible database that doesn&#x27;t use any postgres code:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;dolthub&#x2F;doltgresql&#x2F;">https:&#x2F;&#x2F;github.com&#x2F;dolthub&#x2F;doltgresql&#x2F;</a><p>We&#x27;re doing this because our main product (Dolt) is MySQL-compatible, but a lot of people prefer postgres. Like, they really strongly prefer postgres. When figuring out how to support them, we basically had three options:<p>1) Foreign data wrapper. This doesn&#x27;t work well because you can&#x27;t use non-native stored procedure calls, which are used heavily throughout our product (e.g. CALL DOLT_COMMIT(&#x27;-m&#x27;, &#x27;changes&#x27;), CALL DOLT_BRANCH(&#x27;newBranch&#x27;)). We would have had to invent a new UX surface area for the product just to support Postgres.<p>2) Fork postgres, write our own storage layer and parser extensions, etc. Definitely doable, but it would mean porting our existing Go codebase to C, and not being able to share code with Dolt as development continues. Or else rewriting Dolt in C, throwing out the last 5 years of work. Or doing something very complicated and difficult to use a golang library from C code.<p>3) Emulation. Keep Dolt&#x27;s Go codebase and query engine and build a Postgres layer on top of it to support the syntax, wire protocol, types, functions, etc.<p>Ultimately we went with the emulation approach as the least bad option, but it&#x27;s an uphill climb to get to enough postgres support to be worth using. Our main effort right now is getting all of postgres&#x27;s types working.
评论 #39721438 未加载
monero-xmr大约 1 年前
Postgres is simply the best. One thing I would like however is the ability to have control over the query planner for specific tasks. There is a dark art to influencing the query planner, but essentially it is unpredictable, and postgres can get it consistently wrong in certain scenarios. If you could just enable a special query mode that gives you absolute control over the QP for that query, it would solve a major pain point.<p>I&#x27;m not a database developer, and last time I researched this (a few years ago) I found many good reasons for not enabling this from postgres contributors. But it would still be very useful.
评论 #39712127 未加载
评论 #39712389 未加载
评论 #39712091 未加载
评论 #39712096 未加载
评论 #39714847 未加载
评论 #39712163 未加载
fulafel大约 1 年前
Someone who picked their tools with good tech judgement 25 years ago can be using the same today (eg PG, Python, Linux) without corporate control of them, it&#x27;s pretty great.
评论 #39714025 未加载
评论 #39714194 未加载
评论 #39738207 未加载
评论 #39717968 未加载
TOMDM大约 1 年前
Postgres is such a great tool.<p>The feature I&#x27;d love to see added that has been kicking around the mailing list for ages now would be incremental view maintenance.<p>Being able to keep moderately complex analysis workloads fresh in realtime would be such a boon.
评论 #39712475 未加载
评论 #39712562 未加载
评论 #39712591 未加载
评论 #39735314 未加载
评论 #39716642 未加载
评论 #39712586 未加载
paulmd大约 1 年前
In the same vein as “is your product a business, or is it just a feature”, Postgres has really raised the bar to “is your product a database or an index in postgres”. There’s a few databases that make compelling cases for their existence, like Cassandra or Elastic&#x2F;Solr, but surprisingly many databases really don’t offer anything that can’t be replicated with a GIN or GIST on Postgres. It is the amorphous blob swallowing up your product and turning it into a feature. JSON handling or json column types, are no longer a distinctive feature anymore, for example.<p>And a surprising amount of other stuff (similar to lisp inner platforms) converges on half-hearted, poorly-implemented replications of Postgres features… in this world you either evolve to Cassandra&#x2F;elastic or return to postgres.<p>(not saying one or the other is better, mind you… ;)
lmm大约 1 年前
Postgres is still single-node-first, and while Citus exists I&#x27;m skeptical that it can ever become as easy to administer as a true HA-first datastore. For me the reason to use something like Cassandra or Kafka was never &quot;big data&quot; per se, it was having true master-master fault tolerance out of the box in a way that worked with everything.
评论 #39717535 未加载
评论 #39714824 未加载
评论 #39712580 未加载
评论 #39712542 未加载
评论 #39712948 未加载
评论 #39720385 未加载
ksec大约 1 年前
&gt;In 2024, a single x86 machine can have 512 cores<p>I am not aware of such machine in a single Node unless it is talking about vCPU &#x2F; Thread. Intel Sierra Forest 288 Core doesn&#x27;t do dual socket option. So I have no idea where the 512 x86 core came from.
评论 #39713519 未加载
评论 #39713769 未加载
issung大约 1 年前
Alright I&#x27;m convinced, I&#x27;m using postgres for my next project. Anyone have any experiences with it and Entity Framework Core?
评论 #39712569 未加载
评论 #39716907 未加载
评论 #39712493 未加载
评论 #39712374 未加载
评论 #39712445 未加载
评论 #39712362 未加载
评论 #39720028 未加载
评论 #39712536 未加载
ksec大约 1 年前
&gt;As DuckDB’s manifesto “Big Data is Dead” suggests, the era of big data is over.<p>I have been stating this since at least 2020 if not earlier.<p>We are expecting DDR6 and PCI-E 7.0 Spec to be finalised by 2025. You could expect them to be on market by no later than 2027. Although I believe we have reach the SSD IOPS limits without some special SSD with Z-NAND. I assume ( I could be wrong ) this makes SSD bandwidth on Server less important. In terms of TSMC Roadmap that is about 1.4nm or 14A. Although in server sector they will likely be on 2nm. Hopefully we should have 800Gbps Ethernet by then with ConnectX Card support. ( I want to see the Netflix FreeBSD serving 1.6Tbps update )<p>We then have software and DB that is faster and simpler to scale. What used to be a huge cluster of computer that is mentally hard to comprehend, is now just a single computer or a few larger server doing its job.<p>There is 802.3dj 1.6Tbps Ethernet looking at competition on 2026. Although product coming through to market tends to take much longer compared to Memory and PCI-Express.<p>AMD Zen6C in ~2025 &#x2F; 2026 with 256 Core per Socket, on Dual Socket System that is 512 Core or 1024 vCPU &#x2F; Thread.<p>The future is exciting.
评论 #39720294 未加载
评论 #39716634 未加载
patrickdavey大约 1 年前
I have a handful of sites I run on a VPS with a basic setup, including MySQL.<p>One thing I&#x27;ve always liked about MySQL is that it pretty much looks after itself, whereas with Postgres I&#x27;ve had issues before doing upgrades (this was with brew though) and I&#x27;m not clear on whether it looks after itself for vacuuming etc.<p>Should I just give it a go the next time I&#x27;m upgrading? It does seem like a tool I need to get familiar with.
评论 #39712570 未加载
评论 #39712540 未加载
评论 #39714769 未加载
swcode大约 1 年前
Great article! We also tried lots of databases in the past at SWCode, but then ended up using Postgres for almost all our usecases. There really must be a good argument for using something else which can‘t be done with some Postgres extension.
artyom大约 1 年前
Yes, the title is click-baity. Yes, Postgres isn&#x27;t perfect and not the &quot;best&quot; choice for every possible use case in the universe.<p>But Postgres is a work of art, and compared to all the other relational database options, if it&#x27;s ultimately crowned the king of them all, it&#x27;d be well deserved.<p>I&#x27;d also say that the PG protocol and the extensions ecosystem are as important as the database engine.
jpalomaki大约 1 年前
I would like to keep my data in Postgres (OLTP purposes), but run analytical queries against the same datafiles in Snowflake&#x2F;DuckDB fashion.<p>The analytics part should scale independently. Often this is only needed occasionally, so scale-to-zero (like Snowflake) would be great.
评论 #39729476 未加载
thinkerswell大约 1 年前
Is there an extension that can make it compete with TigerBeetle for transaction processing speed?
评论 #39712785 未加载
评论 #39712515 未加载
NorwegianDude大约 1 年前
This post was very wrong and misleading on multiple points.<p>I have seen a lot of people praising Postgres over e.g. MariaDB. But more often than not it seems to be people how lack knowledge.<p>Take this linked post, where the author points out &quot;The untuned PostgreSQL performs poorly (x1050)&quot; later followed by &quot;This performance can’t be considered bad, especially compared to pure OLTP databases like MySQL and MariaDB (x3065, x19700)&quot;.<p>Frist of all, those are not pure OLTP databases. And if the author took a better look at the benchmark he would see that MariaDB using ColumnStore is at x98. That&#x27;s 10x the performance of Postgres out of the box, and 200x faster than the author stated.
评论 #39714312 未加载
givemeethekeys大约 1 年前
Having used Postgres for many projects, yet never having used any of the other tools in the ecosystem, I&#x27;m surprised by how many tools there are!<p>How does one go about finding paying customers when developing a new database tool? How does one figure out the size of the market, and pricing structure?
elliotwagner大约 1 年前
I truly like postgres
throwawaaarrgh大约 1 年前
It&#x27;s not a best practice, it&#x27;s a fad. 99% of people who recommend or use Postgres barely know how to use it. Another trendy database will come along and you&#x27;ll stop seeing all these posts about it. Happens every decade. I&#x27;ll link back to this post in a few years with &quot;I told you so&quot;.
评论 #39714868 未加载
评论 #39712825 未加载
评论 #39716156 未加载
评论 #39714818 未加载