TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

SQLite vs MySQL vs PostgreSQL

95 pointsby reqresabout 11 years ago

21 comments

mnw21camabout 11 years ago
I would emphasise the point made about Postgres read performance. If all you are doing is reading single rows from a single table using an index, then yes Postgres is overkill and other solutions may perform better. However, the overhead that Postgres has is due to a remarkably effective query planner, which can be a godsend if you have a complex multi-table join. A few years ago I was working on a project with a large Postgres database that regularly did queries joining 20 tables together, which Postgres was quite happy to accommodate.<p>Also, that overhead can be suffered only once for many similar queries if you make use of prepared statements, which can bring the performance of simple read queries up.<p>Also, bulk writes can be sped up through the COPY IN BINARY interface - we were getting bulk load speeds basically limited by the write speed of our RAID array.<p>In short, I have been very impressed indeed with Postgres. They do it right.
评论 #7433525 未加载
评论 #7443046 未加载
评论 #7433816 未加载
mercurialabout 11 years ago
I&#x27;m not sure why this is being upvoted. It&#x27;s very light on technical content (how can you mention sqlite and not say that its type system is advisory only is beyond me), and provides no added value compared to what you can get out of a quick google search if you wanted to compare these three widely used RDBMS.<p>I&#x27;ll note that I usually disagree with these &quot;why is this on HN&quot; posts, but technical posts should have a higher bar than this.
评论 #7437238 未加载
评论 #7434624 未加载
评论 #7436574 未加载
elithrarabout 11 years ago
One of the biggest benefits of Postgres is WAL-E (<a href="https://github.com/wal-e/wal-e" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;wal-e&#x2F;wal-e</a>), which allows you to perform streaming backups (based on Postgres&#x27; WAL) to &lt;location&gt; (i.e. S3, an file server, etc) and also perform base-backups at regular intervals (so you can replay your WAL backups on top of it).
评论 #7434098 未加载
dkochabout 11 years ago
&quot;Again, depending on the choice of the database-engine, MySQL can lack certain features, such as the full-text search.&quot;<p>Both of the two biggest engines (MyISAM, InnoDB) support full-text search. It was added to InnoDB in MySQL 5.6&#x2F;Maria 10.
评论 #7433828 未加载
评论 #7433856 未加载
sdesolabout 11 years ago
MySQL Advantage: &quot;MySQL can be installed very easily&quot;<p>I&#x27;ve always heard MySQL&#x27;s popularity had a lot to do with how easy it was to install, but now a days, I really can&#x27;t see install ease being a factor. The date for the document says February 21, 2014, so they should know about EnterpriseDB and their installer or maybe my idea of easy is different.<p>In my opinion EnterpriseDB did a really good job with their Postgres installer. They certainly designed it to be easy to integrate with other products, which makes sense, since more Postgres installs means more potential customers.<p>I was actually taken back by how easy it was to integrate with my products Linux installer. And what makes the installer really nice is, it puts everything in a single directory, which makes all the difference for my product. My product has a Postgres 9 requirement, and I was really worried about losing potential customers who were running Postgres 8 and could not upgrade. But since the install is pretty much self contained, you can happily run Postgres 8 and 9 on the same machine.<p>If you know Perl and are curious, download my product (<a href="http://gitsense.com/download.html" rel="nofollow">http:&#x2F;&#x2F;gitsense.com&#x2F;download.html</a>) and take a look at the install.pl file. My only complaint with the db installer is, it doesn&#x27;t provide a way for you to track the install progress. To work around this, I just fork a process which does the db install and I&#x27;ll print a dot to STDOUT which lets the user know the install is jugging away.
评论 #7434367 未加载
评论 #7435167 未加载
workhere-ioabout 11 years ago
If you&#x27;re making a web app, IMO you shouldn&#x27;t use SQLite at all - not even for testing. In a live scenario SQLite has problems with multiple users. And in a test scenario SQLite is too forgiving when it comes to types - which means that once you switch to your live database, e.g. PostgreSQL, errors will occur that you hadn&#x27;t foreseen because PostgreSQL isn&#x27;t as forgiving as SQLite type-wise.<p>In short, use PostgreSQL both for testing and live. I recommend Postgres.app for Mac users: <a href="http://postgresapp.com/" rel="nofollow">http:&#x2F;&#x2F;postgresapp.com&#x2F;</a>
评论 #7434274 未加载
评论 #7434113 未加载
评论 #7434201 未加载
评论 #7434264 未加载
lauriswtfabout 11 years ago
It appears that Postgres is currently more popular among developers than MySQL <a href="http://www.databasefriends.co/2014/03/favorite-relational-database.html" rel="nofollow">http:&#x2F;&#x2F;www.databasefriends.co&#x2F;2014&#x2F;03&#x2F;favorite-relational-da...</a>
DigitalSeaabout 11 years ago
Not quite the in-depth article I expected sadly. Very disappointed.<p>As someone who has used all three extensively, I would say steer clear of SQLite for large-scale applications or a web app in production. I tend to use SQLite for prototyping because it means you don&#x27;t have to worry about setting up a database, I wouldn&#x27;t use it for much more than that.<p>I used to use MySQL quite a bit, and since version 5.5 MySQL has actually been really good in terms of performance and feature-set. Both MySQL and PostgreSQL have their advantages, and as long as you know when to scale and shard your database it&#x27;s all relative in the end regardless of which of the two you choose, both can be tuned to do the same things.
Udoabout 11 years ago
+1 for MariaDB. I particularly like the new Aria table type which is blazingly fast - if you enjoy ligh-weight feature sets.
danielstocksabout 11 years ago
Regarding Postgres vs MySQL performance in conjunction with programming languages, this is kind of interesting: <a href="http://www.techempower.com/benchmarks/#section=data-r8&amp;hw=i7&amp;test=db&amp;d=6" rel="nofollow">http:&#x2F;&#x2F;www.techempower.com&#x2F;benchmarks&#x2F;#section=data-r8&amp;hw=i7...</a>
agmartinabout 11 years ago
SQLite can&#x27;t be tuned for performance? That&#x27;s news to me. I was pretty sure that you can do that.
评论 #7434265 未加载
chacham15about 11 years ago
Maybe this is a stupid question, but why is it that MySql can write so much faster than SQLite?
评论 #7433358 未加载
评论 #7433397 未加载
nnqabout 11 years ago
why do people keep saying that mysql is easier to install and configure postgres? maybe you can find more results when googling for &quot;mysql install&quot; or something, but it&#x27;s just a bit different, not harder.<p>(...now, I don&#x27;t even understand why mysql was even created in the first place when even back then there were other open source projects already closer to achieving performance on par with the commercial rdbmss...)<p>EDIT - correction: sorry, swapped two words by mistake and ended up saing the opposite thing
nathellabout 11 years ago
Can the authors somehow back the statement of MySQL&#x27;s popularity vs. PostgreSQL? If anything, the latter seems more popular, judging from the frequency of its appearances on HN.
评论 #7433410 未加载
评论 #7433338 未加载
评论 #7433346 未加载
评论 #7433325 未加载
评论 #7434038 未加载
评论 #7433844 未加载
mwhiteabout 11 years ago
For a quite in-depth comparison of various RDBMS, check out <a href="http://troels.arvin.dk/db/rdbms/" rel="nofollow">http:&#x2F;&#x2F;troels.arvin.dk&#x2F;db&#x2F;rdbms&#x2F;</a>
评论 #7434085 未加载
rpedelaabout 11 years ago
Missing json, smallserial data types for Postgres.
mp3geekabout 11 years ago
Would&#x27;ve been nice to see a table comparison instead of a huge page dump.
tambourine_manabout 11 years ago
Lots of broken links in the article
评论 #7433711 未加载
copergiabout 11 years ago
This is just someone who doesn&#x27;t appear to have much experience with any of the three, repeating &quot;common knowledge&quot; opinions that are largely misguided and&#x2F;or outdated. If you want to say X is faster or Y has more &quot;security options&quot; (what?) then link to something to demonstrate that.
评论 #7433991 未加载
评论 #7435118 未加载
WildUtahabout 11 years ago
I love how easy it is to get started with MySQL and historically it&#x27;s had a great user manual for beginners.<p>For years, though, I&#x27;ve felt that the small problems where SQLite is useful now cover all the former MySQL ground. Once you exceed the power of SQLite, the features and performance and standards compliance and reliability and flexibility and correctness constraints and transaction execution and ongoing feature development of Postgres overwhelm the use case for MySQL.
评论 #7434370 未加载
评论 #7435073 未加载
Fasebookabout 11 years ago
Getting database consultation from a cloud service is probably not the best idea ever.