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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Leaving MySQL

626 点作者 sammorrowdrums超过 3 年前

71 条评论

leetrout超过 3 年前
&gt; MySQL is a pretty poor database, and you should strongly consider using Postgres instead.<p>Wow, right on the chin with that one.<p>&gt; More jarring were the people who insisted everything was OK (it seems most MySQL users and developers don&#x27;t really use other databases)<p>I only have anecdata of my usages of MySQL and Postgres but I swear people that cut their teeth on MySQL and have never used Postgres just don&#x27;t know what they are missing.<p>Yes Postgres can be slower out of the box and yes Postgres has worse connection handling that usually requires a pooler but the actual engine and it&#x27;s performance makes it worth it in my opinion.
评论 #29456498 未加载
评论 #29456523 未加载
评论 #29457104 未加载
评论 #29456286 未加载
评论 #29461712 未加载
评论 #29464076 未加载
评论 #29456237 未加载
评论 #29456444 未加载
评论 #29461425 未加载
评论 #29456643 未加载
steve_adams_86超过 3 年前
It is incredibly hard to improve something that your user base doesn’t think needs improving. That part really stands out to me.<p>When I first moved to Postgres I was fairly reluctant - my impression was that it was some arbitrary flavour of sql, and since I was used to MySQL (the only sql database I’d ever used) it seemed incredibly unnecessary to bother with. I imagine there are tons of people out there like I was who would rather let things be.<p>Since the first few weeks I don’t think I’ve ever chosen to use MySQL again; Postgres totally changed my career for the better.
评论 #29461211 未加载
评论 #29456280 未加载
评论 #29467262 未加载
评论 #29466624 未加载
dvt超过 3 年前
Honestly, the post feels a bit bitter.<p>&gt; ...let me point out something that I&#x27;ve been saying both internally and externally for the last five years...<p>Life is short, don&#x27;t get stuck in a job&#x2F;relationship&#x2F;situation&#x2F;etc. you hate for half a decade. IMO the irony is that he&#x27;s moving to the Chrome team, which has been an absolute shitshow. Woohoo, now you&#x27;re going to work on fantastic ways of screwing up the web, inserting ads where we don&#x27;t want them, tracking users against their will, and banning extensions on the Chrome store. Interesting technical challenges, indeed.
评论 #29456476 未加载
lkrubner超过 3 年前
I got into programming in 2000 and right when I did Tim Perdue wrote a very important article comparing MySQL and Postgres. He concluded that Postgres was the better database.<p>[edit] Thanks to DocTomoe for finding this:<p><a href="https:&#x2F;&#x2F;phpbuilder.com&#x2F;mysql-and-postgresql-compared&#x2F;" rel="nofollow">https:&#x2F;&#x2F;phpbuilder.com&#x2F;mysql-and-postgresql-compared&#x2F;</a><p>Some of the discussion of the article survives:<p><a href="https:&#x2F;&#x2F;www.postgresql.org&#x2F;message-id&#x2F;39635C4A.1A4486D9%40alumni.caltech.edu" rel="nofollow">https:&#x2F;&#x2F;www.postgresql.org&#x2F;message-id&#x2F;39635C4A.1A4486D9%40al...</a><p>The article was a very big deal at the time, because it was so well researched and so devastating for MySQL.<p>I figured that article was the death knell for MySQL, but then MySQL surprised me by just going and going and going. It was helped along back then by having a very close relationship with the PHP language. Nowadays, you can use any database you want with PHP, but in 2000 PHP was very much biased in favor of MySQL, and every article written about PHP was written with the assumption you&#x27;d be using MySQL as the database. I suspect that MySQL would have died except for the massive life support it got from PHP during those years.<p>The moral I take from all of this is that sometimes you can have two technologies, and one is clearly better, yet the one that is clearly better can remain under-utilized for 21 straight years.<p>I know a bunch of HN people will now show up and defend MySQL, or defend a lazy style of programming that accepts defaults even when that means using a poor cousin of something good. But we should stop for a moment and really think about the implications of this. Because it really is remarkable that people have known of the superiority of Postgres for 21 years and yet people still use MySQL.
评论 #29458814 未加载
评论 #29458115 未加载
评论 #29465679 未加载
评论 #29469469 未加载
评论 #29466443 未加载
评论 #29457518 未加载
评论 #29457546 未加载
评论 #29457545 未加载
whoknowswhat11超过 3 年前
I used MySQL ages ago. It was pretty fast out of the box. I never needed to vacuum. You could get up and running with Upsert and connections without trouble. It did feel hacky, but don&#x27;t discount that it mostly worked for a lot of use cases. It always reminded me of software developed with use cases in mind (vs theory). That&#x27;s actually a complement (ie, full joins are rare, left joins more common - so MySQL was better at left joins).<p>Going to postgre - much pickier. I found it slower out of box. You couldn&#x27;t just throw tons of connections at it (ie, connection buildup &#x2F; teardown felt slower). I had issues initially with quoting and capitalization etc.<p>That was a long time ago. Now I enjoy postgres and haven&#x27;t touched MySQL, but there is a real history where MySQL was the database you could get going with pretty easily (I was pre-Oracle buyout).
评论 #29456285 未加载
zmmmmm超过 3 年前
I am curious how people feel about wisdom and ethics of acting in ways that are actively hostile to the interests of a previous employer immediately after quitting?<p>Regardless of the technical facts, unless there is a very strong ethical argument in favor (for example, say, the employer is outright lying in a highly fraudulent way and customers need to know) .... I find this sort of behavior to be slightly unprofessional. But I am curious if others feel the same ... and does it make a difference that it is Oracle?
评论 #29456814 未加载
评论 #29456481 未加载
评论 #29457076 未加载
评论 #29463117 未加载
评论 #29464822 未加载
评论 #29456497 未加载
评论 #29456504 未加载
doctor_eval超过 3 年前
I think they are right that many people who swear by MySQL have never used another SQL database.<p>When MySQL hit the scene at the start of the whole LAMP thing, PG was much slower in some use cases than MySQL, and proprietary databases were super expensive. There weren’t too many options. PG was still fairly rough around the edges.<p>Of course I also needed transactions, and they didn’t come with MySQL - that would hurt performance apparently - so when I was forced to leave Solid due to HP’s acquisition and subsequent pricing hike, PG was the only option for me.<p>But most developers didn’t need (or didn’t know they needed) transactions, and SQL was the tech de jour, so off they went.<p>I tried to like MySQL, but the weird not-quite-SQL syntax, lack of transactions and this _weird feeling I got_ put me off.
评论 #29456446 未加载
评论 #29456274 未加载
评论 #29460529 未加载
评论 #29457234 未加载
donatj超过 3 年前
In my very humble and naive opinion, MySQL has the whole &#x27;worse is better&#x27; thing going for it. Does less, does it maybe less than perfect, but it does it very quickly and reliably.<p>We&#x27;ve personally scaled MySQL to many tens of thousands of concurrent users without too much trouble and without a dedicated person watching the database.<p>That said, I&#x27;ve only really worked significantly with MSSQL and MySQL, so my points of comparison are based largely on what I&#x27;ve heard. The majority of my last 15 professional years have been spent with MySQL.
评论 #29463569 未加载
评论 #29464069 未加载
评论 #29463059 未加载
评论 #29462864 未加载
评论 #29465449 未加载
chrsig超过 3 年前
This strikes me as pretty childish.<p>If it had read more like &quot;I left because I was frustrated with code quality&quot;, and actually took ownership of the feeling, that&#x27;d have made a big difference. It reads more like &quot;i left because the code sucks, everyone around me is dumb, and our users are sheep&quot;<p>I don&#x27;t think anyone&#x27;s going to suddenly switch to postgres as a result of this blog post...so really, what&#x27;s the point?<p>Maybe it&#x27;ll get more attention on the systems he called out? Probably not. The post just reads as bitter, mostly about the mindset of other contributors, but doesn&#x27;t outline what they tried to do to change the hearts and mind of those contributors. Or put another way: what did this person do to lift up all of these people? Deriding doesn&#x27;t actually help anything.<p>If the goal is just to vent that&#x27;s fine, but there&#x27;s really not much else to see here.
评论 #29456464 未加载
评论 #29456668 未加载
评论 #29456542 未加载
评论 #29456333 未加载
评论 #29456747 未加载
评论 #29456351 未加载
评论 #29456548 未加载
评论 #29456305 未加载
评论 #29456461 未加载
willvarfar超过 3 年前
From having fought it as a savvy user, I completely agree with the article about the poor MySQL query planner. I don&#x27;t have the under-the-hood insights of the poster, obviously, but everything he says jives with how it felt as a user.<p>Of course the planner is just part of a database, and I have some kind words to say about the other technically-impressive bits of MySQL:<p>A lot of MySQL users are websites and things with pretty CRUD access patterns. That wasn&#x27;t me.<p>My history is using it for high-throughput real-time batching and fancy buzzword stuff at reasonably massive scale (big distributed teleco systems), which is where a lot of expensive choices were pitched.<p>Doing teleco systems with MySQL was staggeringly cheaper and actually quite cheerful and, for all the times I swore at it, I&#x27;m actually still a fan.<p>I went with MySQL for advanced features that, at the time, Postgres was way behind on. MySQL had lots of storage engine choices (including TokuDB, which changed everything for my use-cases) and upserts and compression and things that put it way ahead of Postgres.<p>Of course MySQL had lots of warts too. The query planner was completely poo, but 99% of uses are simple things that it can handle well, and the most critical times it gets things wrong you end up annotating the sql to force indices and do the planner&#x27;s job for it etc.<p>Of course, nowadays, Postgres is reaching parity on these things too (except, perhaps, compression. My understanding is that Postgres is way behind on decent in-engine page-based compression. It will presumably get something decent eventually.)
评论 #29457732 未加载
评论 #29457763 未加载
vanusa超过 3 年前
Rare, and utterly refreshing for its frankness. Let&#x27;s hope this person does well wherever he goes in his career.
INTPenis超过 3 年前
I only have the untrained DBA perspective coming from building and hosting MySQL, Maria DB and postgres clusters over the last 14 years and I feel that Galera clustering feels a lot better than anything I&#x27;ve seen in postgres.<p>Agreed that postgres has amazing performance. I was actually an early convert to postgres back in 2004 because my boss and coworker at the time saved entire businesses by migrating them to postgres when they had enough of trying to scale MySQL with more hardware vertically.<p>But in the later decade when I myself have used clustering to scale I&#x27;ve found that Galera feels less like a tacked on afterthought than anything I&#x27;ve seen in the postgres world.<p>It&#x27;s just a lot more integrated than pgoool and watchdog.<p>I know there are new solutions now that run the postgres clusters inside kubernetes that I haven&#x27;t tried yet. But that isn&#x27;t more integration, that&#x27;s just more 3rd party abstraction.<p>Edit: I realize after I wrote this how strange it must seem to a developer. Because galera&#x2F;wsrep is actually a 3rd party replication product &quot;tacked on&quot; to MariaDB. While postgres replication, afaik, is written into their mainline code. I guess my gripe wasn&#x27;t about the replication but rather the &quot;clustering&quot; around it, like maxscale&#x2F;haproxy&#x2F;pgpool and so forth. And in that sense they seem pretty equal, I just chose to use pgpool for my postgres clusters and that is definitely a hacky, scripty mess compared to HAproxy or Maxscale.
评论 #29463182 未加载
ksec超过 3 年前
Does any one know when is MySQL 9.0 coming? It has been a unusually long time between a major version or a dot version release. MySQL 8.0 was in April 2018.<p>Compared to Postgres which has been shipping features after features.
评论 #29496238 未加载
radu_floricica超过 3 年前
I have a moderately large table (hundreds of millions of records) with very simple structure but lots of columns and keys. This post is a huge &quot;aha!&quot; moment for me - I keep struggling with how the optimizer is choosing which index to use. It keeps making stupid mistakes and behaves differently from instance to instance - I still have a staging server where I just have to avoid an admin interface because it takes minutes to load, and I haven&#x27;t invested more than a few hours to debug because it&#x27;s not production.<p>I have pieces of half commented code where I do the optimizer&#x27;s job and try to guess which index is best and chose it manually. Lately I&#x27;ve been considering doing an &quot;explain&quot; first and based on that tweak the query.<p>So yeah - I love MySQL, and I don&#x27;t think I&#x27;ll be able to invest the time to switch, but at least now everybody can see the emperor is naked and it wasn&#x27;t just them. The optimizer sucks, including in MySQL 8.
评论 #29463045 未加载
评论 #29456590 未加载
fasteo超过 3 年前
&gt; MySQL is a pretty poor database, and you should strongly consider using Postgres instead.<p>This is an insider view, meaning that he is probably addressing things like code quality, compile&#x2F;run&#x2F;debug workflow, technical design decisions and so on.<p>As a 20 year MySQL user - starting with version 3.23 if my memory serves me well - and after billions upon billions of inserted&#x2F;updated&#x2F;deleted&#x2F;queried rows, MySQL is not a pretty poor database by any measure. It has served me well: Good performance, near zero maintenance, very few crashes, and a couple of data corruption that resulted in data loss after power outage.
评论 #29457919 未加载
marcodiego超过 3 年前
Complete outsider view:<p>&gt; internal company communications tried to spin that Oracle is filled with geniuses and WE ARE WINNING IN THE CLOUD.<p>From wikipedia about mariaDB:<p>&gt; A group of investment companies led by Intel has invested $20 million in SkySQL. The European Investment Bank funded MariaDB with €25 million in 2017. Alibaba led a $27M investment into MariaDB in 2017.<p>From wikipedia about MySQL:<p>&gt; MySQL is also used by many popular websites, including Facebook, Flickr, MediaWiki, Twitter, and YouTube.<p>They certainly have their place. I&#x27;m sure some of these companies have considered Postgres.
评论 #29466351 未加载
评论 #29457208 未加载
评论 #29490661 未加载
pm90超过 3 年前
&gt; In the end, there&#x27;s just not enough resources that I could see it turn into a competitive product, no matter how internal company communications tried to spin that Oracle is filled with geniuses and WE ARE WINNING IN THE CLOUD.<p>It’s refreshing to know that tier 2 cloud companies (Oracle, IBM etc) all have similar internal perspectives, ie leadership insisting that they’re making amazing progress in the cloud while their market share either stagnates or reduces.
danielrhodes超过 3 年前
What a burn - but not surprising given MySQL&#x27;s history and things like MariaDB or Percona which exist to fill the gaps. My impression is that many people will choose Postgres over MySQL when starting a new project as it progresses so quickly and has a far richer set of features.
评论 #29456448 未加载
scotty79超过 3 年前
&gt; But it doesn&#x27;t really explain why I did go looking for that somewhere else in the first place.<p>I don&#x27;t have understand why people think they need to provide a reason.<p>They are just part of economy and should constantly look for better opportunities for themselves because that&#x27;s what drives the economy towards more efficient state where resources are better utilized. Not to mention they themselves have just one life and have full moral right to live it the best way they can. They don&#x27;t owe anyone anything they didn&#x27;t promise and employment is not a promise of dedicating your whole life to a project or an employer.
RustyRussell超过 3 年前
Ok, I have to admit I LOL at the bottom of this critique of MySQL code quality to hear he was going to work on Google Chrome!
评论 #29456840 未加载
评论 #29456533 未加载
PeterZaitsev超过 3 年前
I was with MySQL AB in its early days, It&#x27;s codebase and behaviors was much worse than it is now. Yet we had a team of people who loved MySQL and was focused on making it better.<p>I think this is unfortunate culture change in Oracle land - they hire mercenaries rather missionaries to work on the code, so such &quot;I never loved it, but I worked on it for years&quot; is not a surprise.<p>MySQL, MariaDB, MongoDB, PostgreSQL all have skeletons in their closet. Yet if PostgreSQL developer would be leaving with similar attitude community would raise much more to defense
soheil超过 3 年前
If Steinar is responsible for removing <i>query_cache</i> in 8.0 I&#x27;m glad he&#x27;s leaving the MySQL team. Sure, MySQL is not the perfect database heck I&#x27;m willing to even say it&#x27;s not good or efficient, but it is extremely well supported across toolchains and programming languages. It just works and it works pretty darn well for most applications. I&#x27;ve built several startups on top of it some even exited.
评论 #29456591 未加载
评论 #29457869 未加载
midom超过 3 年前
¯\_(ツ)_&#x2F;¯ optimizer guy says he did not do good job, shits on optimizer?<p>There&#x27;re many reasons to pick MySQL over PG at large scale deployments (economics, replication strategies, etc) - and the fact that some queries will run better on PG may not outweight those benefits.<p>Don&#x27;t get me wrong, I know many areas where MySQL sucks, and that is mostly in lacking execution strategies and optimizer problems. Indeed, in many of these ways MySQL is stuck years behind, but in other areas (MyRocks, modern hardware use, etc) it is far ahead of PG.<p>The thing is, optimizing has costs, and bypassing those costs is useful, if you&#x27;re looking at economics of your system, and storage engines that pay attention to data patterns are ahead of just naive heaps of data.<p>It is very simple to diss MySQL when your business does not depend on managing petabytes of data.<p>P.S. We&#x27;ve migrated a major social network from PG onto our MySQL-based platform and our MySQL DBAs didn&#x27;t even notice. :-)
jmnicolas超过 3 年前
&gt; MySQL is a pretty poor database, and you should strongly consider using Postgres instead.<p>It&#x27;s not like it&#x27;s an industry secret either: when I started my CS training in 2007, the first course was about relational databases and one of the first things the teacher told us was that MySQL was pretty sucky.
mmaunder超过 3 年前
Plot twist: MySQL runs most of the web.
评论 #29457685 未加载
tflinton超过 3 年前
I&#x27;ve had too may anecdotal failures from replication, innodb consistency corner-case issues and finally being adjacently associated with Oracle killed it for me. Since moving to Postgres, I&#x27;ve been very happy.
patrickdavey超过 3 年前
I&#x27;m super tempted to move from MySQL to postgres, but, we are currently self hosting and MySQL is breeze to run. My only experience with postgres is running a brew update and it completely borking the database and having to track down some cryptic post in order to fix it. Also, as pointed out elsewhere, MySQL seems not to require vacuuming or anything else. It&#x27;s the unknowns of moving which make me nervous.
评论 #29458384 未加载
评论 #29457037 未加载
评论 #29456705 未加载
ttfkam超过 3 年前
I can&#x27;t help but think most folks you use MySQL or MariaDB have never seen feature comparison charts with other database engines.<p><a href="https:&#x2F;&#x2F;www.sql-workbench.eu&#x2F;dbms_comparison.html" rel="nofollow">https:&#x2F;&#x2F;www.sql-workbench.eu&#x2F;dbms_comparison.html</a><p>There is an awful lot of red in their ledger compared to the others. SQLite is surprising good considering its smaller concurrency scope for use.
fraktl超过 3 年前
- Works 5 years on something he hates - No proof (links, anything) that prove what he&#x27;s stating - Quits and supports the other vendor, knowing there&#x27;s internet quarrel between &lt;insert-db-name&gt; vs &lt;insert-other-db-name&gt;, nice going there. Real grown up. - Leaves to work for largest spyware company on the planet<p>This sounds like one of those people everyone on HN say to avoid in job environment.
评论 #29468159 未加载
Rafuino超过 3 年前
Way to burn bridges on the way out. I see no benefit to doing that when you&#x27;re just going over to work on Chrome malarkey and get more t-shirts
cryptica超过 3 年前
I think MySQL&#x27;s success comes down to developer-friendliness. I find Postgres a bit tricky to setup. For example, I don&#x27;t like how Postgres authentication is intertwined with Linux user accounts by default; it causes more problems than it solves; especially for open source projects.<p>But anyway, it&#x27;s nice to read an honest piece like this once in a while. Many software projects these days are terrible (to be quite frank) and it&#x27;s not pleasant to work on such projects as a developer once you understand that it is sub-par and that it will probably remain sub-par because your company doesn&#x27;t have the talent or right incentives to attract or foster such talent.<p>If you work at Oracle, it&#x27;s better to do so as a lawyer, not a technologist. Oracle lawyers are world class cronies. Oracle doesn&#x27;t even need developers; the letters written by their lawyers can negate the shortcomings of any of their code.<p>Why even bother writing complex code to solve a technical problem when the lawyer can solve the same problem with a few paragraphs of English legalese?
评论 #29468221 未加载
throwaway47292超过 3 年前
whoa, horrible goodbye<p>i hate mysql as well, but it almost runs the world, and onboarded a whole generation of young coders.<p>postgres is not panacea (especially on RDS), i might even say we(my team) have more outages because of it than if we were using mysql (but thats just my gut feeling)<p>the comment about how the team was so oblivious to &quot;genuinely believe in mysql&quot; was in very poor taste.<p>I hope I misread the spirit of the message.
trwhite超过 3 年前
As someone who isn&#x27;t remotely interested in the database internals (but open to to being), why should I switch from MariaDB&#x2F;MySQL (which I&#x27;ve been using for 7 years and never had any major issues with, beyond ONLY_FULL_GROUP_BY being a slight pain) to something else?
评论 #29462971 未加载
aexl超过 3 年前
Somewhat offtopic, but sesse.net runs a Stockfish instance with the (probably) deepest analysis of live chess games: <a href="http:&#x2F;&#x2F;analysis.sesse.net&#x2F;" rel="nofollow">http:&#x2F;&#x2F;analysis.sesse.net&#x2F;</a> I visit it daily for the Chess World Championship match.
mmaunder超过 3 年前
Ah refactoring and rewrites. Always seem like such a great idea. And can destroy massive companies and projects. Was it Marc Andreessen who wrote that awesome post on how the rewrite of Netscape 6 seemed like a great idea but failed to consider all the little wisdoms built into the current version? It’s impossible to find now with all the noise around him.<p>Production software more than a few versions old is a living breathing thing that has had the hell beaten out of it by QA team and users and survived repeatedly by having passionate devs make it stronger. What it needs is love, not pedants.<p>Some of the most used and popular software in the world is fugly beyond belief but it works, is maintained and loved and continues to defy newcomers.
评论 #29456334 未加载
评论 #29456585 未加载
评论 #29456499 未加载
评论 #29456399 未加载
hardlianotion超过 3 年前
I used to be pretty scornful of badly put together software, for various definitions of badly put together. There are flavours of usability, but if a thing is around for a long time and manages to attract a community, and that community manages to build useful things around it, that is something to respect and admire as well.<p>MySQL works great for a range of use cases and is easier to use for many simpler use cases. Most folk won&#x27;t need any extra power offered by Postgres, and won&#x27;t be encumbered by having to tinker with its implementation.
headgasket超过 3 年前
Shameless plug: check out [Rosettable <a href="https:&#x2F;&#x2F;github.com&#x2F;francoisp&#x2F;rosettable" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;francoisp&#x2F;rosettable</a>]. Brings Postgres triggers and notifies to your MySQL schema, with it you can organize a smooth transition. Using MySQL_fdw you can use your current MySQL schema with the above you can know when a client interacted directly with MySQL; all the while you add some nice jsonb and Plpgsql and transition out of MySQL incrementally. Don’t rewrite, write onward
znpy超过 3 年前
We use mysql in prod at work and frankly the reason I didn&#x27;t bother bringing up the mysql vs postgresql debate is simply high availability.<p>We have a multi-master mysql database based on percona&#x27;s pxc.<p>And it works beautifully... sometimes a node crashes and it&#x27;s no big deal.<p>Meanwhile in pgland it&#x27;s quite a landmine of solutions, each of which seems to be studied accurately. And there is a constellation of other solutions (extensions or posygresql distributions) that maybe fit your use case, maube don&#x27;t.
评论 #29468282 未加载
bborud超过 3 年前
I&#x27;ve seen a lot of negative reactions to this mike drop. I wouldn&#x27;t judge him too harshly. He&#x27;s actually a very good developer worth the benefit of the doubt.
dikei超过 3 年前
In my opinion, both Postgres and MySQL have their places. While I chose Postgres for most of my projects, some 3rd party software just work better with MySQL because they are written for MySQL first, then ported to Postgres. For example, Hive Metastore still experiences some edge-case bugs when running with Postgres.<p>I would not choose MariaDB for any new projects though, since it&#x27;s no longer 100% compatible with MySQL, yet I don&#x27;t see it bringing any game-changing advantage.
jdthedisciple超过 3 年前
Whenever I come across these types of almost-rants, I never know: Is he talking about some specific use cases in which Postgres completely dominates MySQL? Or is it that for literally every CRUD call I do in my app I&#x27;m having my users wait a pointless 200 ms when Postgres would be doing the same in 20 ms ...<p>What&#x27;s the deal? Is the difference that drastic and relevant that I should really switch immediately even for ongoing projects, never to look back on MySQL again ?
didip超过 3 年前
It has been so long since I used MySQL (and that’s for the better).<p>Does MySQL still break when running ALTER TABLE on a huge table?<p>One thing I don’t like about MySQL is that it has too many foot gun.
评论 #29457337 未加载
评论 #29456589 未加载
评论 #29456720 未加载
XCabbage超过 3 年前
Having used both MySQL and PostgreSQL enough to have been annoyed by features of both of them and fall into a bunch of their traps, I feel inclined to point out a few ways in which MySQL is better, most of which relate to the initial learning curve.<p>1. MySQL has the better CLI tool. psql is full of minor annoyances, like its cryptic and unmemorable backslash commands like \d for schema inspection, or having a pager turned on by default for query results that are more than one screen length.<p>2. Postgres has a deeply unintuitive concept of &quot;USER&quot;s and &quot;ROLE&quot;s where actually those are the same thing, and commands like CREATE USER and CREATE ROLE are thus basically synonymous (albeit with slight differences in default values). Worse, lots of the docs pages relating to specific commands don&#x27;t highlight this fact at all. A majority of web devs I&#x27;ve talked to about Postgres have at some point complained about how they don&#x27;t understand the permissions system or how ROLEs work.<p>3. While MySQL enforces that a foreign key from column A -&gt; column B requires an index on both A and B, Postgres only requires a foreign key on column B. Maybe this freedom is nice if you know what you&#x27;re doing, but it&#x27;s a major footgun otherwise, since it means that deleting or updating rows in B has a time cost that scales linearly with the number of rows in the table A belongs to.<p>4. MySQL has a handy ON UPDATE current_timestamp shorthand for creating updated_at timestamp columns, which Postgres lacks, requiring you to use a trigger to implement such a column or move the logic to your application layer.<p>5. MySQL&#x27;s &quot;online DDL&quot; features allow making lots of kinds of schema changes without ever holding a lock on the table being updated. In Postgres, by contrast, <i>any</i> schema change, even adding an index with the CONCURRENTLY option, needs to at least momentarily hold a totally exclusive lock that blocks all writes <i>and reads</i> on the table. Worse, as soon as an ALTER TABLE statement starts <i>waiting</i> for that lock, it blocks all new reads and writes against the table. This makes all schema changes in Postgres much more dangerous to the naive; even one that&#x27;s theoretically able to happen concurrently with queries will hang your application if there&#x27;s already a long-running query going against the table to be modified. It also means that at scale you need to roll a bunch of your own tooling to apply schema migrations safely, where you run them from a connection with a very short lock_timeout and wrap them in some code that retries on failure to acquire the lock. I don&#x27;t remember any of this crap being necessary in MySQL.<p>Maybe Postgres is still better; in particular, maybe it&#x27;s more performant in a way that outweighs all these nuisances. I don&#x27;t really know because I&#x27;ve never done any head-to-head comparison to see how the performance of the two would differ in a given scenario, and so the performance differences aren&#x27;t something I&#x27;ve had a chance to witness as an ordinary dev using both databases. But I just want to make clear that there absolutely <i>is</i> another side to the story!
评论 #29463824 未加载
评论 #29478954 未加载
评论 #29461570 未加载
numlock86超过 3 年前
&gt; MySQL is a pretty poor database, and you should strongly consider using Postgres instead.<p>As someone who has been a long time MySQL and MariaDB &quot;fanboy&quot; I couldn&#x27;t agree more. A decade ago I switched to Postgres and I was hooked after the first 30 minutes already. There simply is no way back. I check back on MySQL&#x2F;MariaDB every now and then just out of curiosity and it still gives me the shivers.
TeeMassive超过 3 年前
I remember a huge Reddit thread about a guy who used to work at Oracle. I can&#x27;t find it anymore, it probably got deleted as people are leaving the Reddit ship but I digress.<p>I found this on HN making similar points and reflects what OP was saying: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=18442941" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=18442941</a>
ksec超过 3 年前
Generally speaking, HN is pretty much one sided with Postgres Vs MySQL. I can count with both hands amount of comments over the years who dare to post an alternative view. And Oracle ( MySQL ) is evil.<p>So I am surprised this thread had more comments on reason to choose MySQL than everywhere else on HN combined. It is still a minority. But at least not as one sided as usual.
评论 #29463044 未加载
chris_wot超过 3 年前
Does MySQL still have crazy Unicode collations?
评论 #29456248 未加载
deepstack超过 3 年前
This is pretty much the same debate in linux vs freebsd back in early 2000s. Better code quality doesn&#x27;t get the most recognition. Usually the devs just go with what&#x27;s hip. And MySQL just sounds better on the marketing end (just because of it&#x27;s name) than postgres (I mean who can pronounce the name).
pqyzwbq超过 3 年前
For us (we build business software distributed to customers), the License is the key factor. MySQL&#x2F;MariaDB is GPL, and even worse, the JDBC driver is also GPL (which makes any business software built on MySQL jdbc driver violate the GPL license). While postgres&#x27;s license is more permissive.
评论 #29457320 未加载
emodendroket超过 3 年前
One thing I really appreciate about psql is it has probably the best docs of any product I&#x27;ve used.
tkiolp4超过 3 年前
For a Saas maintained by one person, would you recommend MySQL or Postgres? I don’t know yet the volume of users or connections I will receive (perhaps zero?), but I do like to keep things simple (this pgbouncer thing one may need with postgres makes me feel uncomfortable).
评论 #29461049 未加载
评论 #29463239 未加载
gigatexal超过 3 年前
Wow: “ MySQL is a pretty poor database, and you should strongly consider using Postgres instead.1”
etaioinshrdlu超过 3 年前
When should I consider migrating a decent size application from MySQL to postgres, if the product is stable and I don&#x27;t urgently need to switch?<p>I&#x27;d much like to be able to use transactional DDL, and improved general performance (parallel query, etc).
pkrotich超过 3 年前
His site would be loading waaay much faster if he was using MySQL even with HN traffic!<p>Joking aside - I see MySQL as an entry level database. There’s time and place for it - just like PHP.<p>Using pq or whatever is better doesn’t automatically make your product a success.
elktea超过 3 年前
as we are all discussing the pros and cons of various DBs, my favourite MySQL feature has to be the pluggable storage engines. Being able to support both InnoDB and RocksDB backed tables in the same database is wonderful. Just today I made use of the MyRocks storage engine&#x27;s handy TTL [1] feature instead of a tedious delete &amp; optimise scheduled job<p>[1]<a href="https:&#x2F;&#x2F;github.com&#x2F;facebook&#x2F;mysql-5.6&#x2F;wiki&#x2F;Time-to-Live-%28TTL%29" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;facebook&#x2F;mysql-5.6&#x2F;wiki&#x2F;Time-to-Live-%28T...</a>
评论 #29463398 未加载
bayesian_horse超过 3 年前
Bad code rarely improves, for all sorts of reasons.<p>Refactoring is all well and good, but its hard to get someone to foot the bill for code that (maybe) works just as well and just looks a bit nicer.
ivoras超过 3 年前
It looks like WordPress is the only reason I&#x27;ve installed MySQL at all in the past decade. It&#x27;s like WP and MySQL are each other&#x27;s &quot;killer app&quot; :D
dgdosen超过 3 年前
Don&#x27;t sugar coat it kid, tell us straight.
leptoniscool超过 3 年前
Recently used MongoDB Atlas and it&#x27;s way better than MySQL in a lot of areas.
评论 #29457167 未加载
tabtab超过 3 年前
Basically it&#x27;s saying the MySql code base is a mess. Maybe PostgreSql&#x27;s codebase is also a mess. Without experience inside it, it&#x27;s hard to really say. Anybody here worked at both for a good while? Most code bases are messes in the real world, I hate to tell ya.
RonaldK9超过 3 年前
I once dig into MySQL source code (mysqlbinlog), but I could not understand how it can get compiled. Later, I found the answer, they added lots #include &quot;xxx.c&quot; at the end of the file, from then, I don&#x27;t regard the MySQL as a serious project.
abdel_nasser超过 3 年前
wait, does mariadb randomly lose data? if youre writing a message service, is it bad practice to store each message individually, one row per message? or clump them together?
maxpert超过 3 年前
&gt; MySQL is a pretty poor database, and you should strongly consider using Postgres instead.<p>Holy crap! I moved away from to Postgres way back in 2012 just for the features (at cost of connection complexity), but this is a plain blow to MySQL fan boys!
eyerollamazing超过 3 年前
Auto vacuum doesn&#x27;t work, vacuum will double your db size, upgrading requires reading the entire changelog and manual intervention, but yeah otherwise I&#x27;m sure postgres is just super amazing right?
DeathArrow超过 3 年前
&gt;MySQL is a pretty poor database, and you should strongly consider using Postgres instead.<p>Why is MySQL poor and why is SQL better? And for which scenarios? MySQL being poor also means MariaDB being poor.
评论 #29468022 未加载
dikaio超过 3 年前
I will now switch to Postgres.
评论 #29468250 未加载
justshowpost超过 3 年前
I&#x27;d like to grin at the another grimace of corporate world: <i>Oracle also sells MySQL.</i>
sorry_outta_gas超过 3 年前
Postgres is an odd choice now that blockchain services are now mature
AtNightWeCode超过 3 年前
I mostly come across MySQL for simple web applications that need to store some data. For that it works fine and is cheaper than MSSQL for instance. Not really the prime use case for Postgres.
评论 #29461851 未加载
评论 #29462055 未加载
anyfactor超过 3 年前
For the amateurs like me, remember this is a personal opinion. If you haven&#x27;t heard of this guy or familiar with his DB usecase (which I am not), you should be smart enough to know not get on the bandwagon.<p>People who are religious about stack either have been working with it for ages and testing it to its limits or are just writing SEO blogs. Flow my stupid plan if you want to really want to get preachy about DB. I started with CSV, then SQLite3 then I stopped. I am familiar with the syntax and basic workflow of MySQL and PostGreSQL just so I can get a job. I still use SQLite3 because it works for me period.
scrubs超过 3 年前
This like in the Seinfeld episode when George complains: what another gift? Just because he&#x27;s moving (into a new apartment) he gets a gift? Birthday, this, that, the other other it never ends.<p>Same: why do I care somebody quit&#x2F;fired&#x2F;whatever? Why do we gotta know about and it get involved?<p>My large employer has a certain low, background level of turnover. Work there long enough and this will add up. A dear friend helps run a company where restructuring is going on with mid-high level people get cleaned out. This stuff is all over the place.<p>Look, if you failed to have forethought to arrange for a new position ahead of time, failed to see this event coming, or don&#x27;t have the contacts for a new position without blabbering on about publicly ... just come out and say: I want a position. I&#x27;m shopping. My CSV is &lt;url-here&gt;. Linked-in is nice I hear for things like that.<p>There&#x27;s a weird signaling of virtuosity or humble-bragging I&#x27;m sick of. Absolutely Fabulous had a nice line on this: you get your dry-cleaning back and it&#x27;s a revolution. This was said sarcastically (because no it&#x27;s not) by Pats ... because doing&#x2F;improving things at work while important is not comparable to the rhetoric that currently passes for normal.