Why To Choose PostgreSQL Over MySQL, MariaDB (dice.com)
Nerval's Lobster writes: PostgreSQL, MySQL, and MariaDB are the three "main" open-source relational databases available today (there are four if you count FireBird, but for brevity we're excluding it). For years, MySQL had a reputation of being faster than PostgreSQL, but much of that was due to the MyISAM database engine, which didn't support transactions. On the flip side of things, PostgreSQL had a reputation for being slower but more reliable. But with the recent versions of both platforms, things have started to change; for example, speed has been less of a problem for PostgreSQL, while MySQL now defaults to the InnoDB engine, which does handle transactions. According to developer David Bolton, here's why PostgreSQL is worth a second look for your database-management needs (Dice link).
Try my product... I guarantee you will be satisfied with it or your money back... here's how to order...
My eyes reflect the stars and a smile lights up my face.
Postgres is an excavator, while the other two are bobcats. For heavy lifting, the choice is obvious.
I mean, really. That name looks like a random collection of letters. :)
At least for me, the killer feature of PostgreSQL is its procedure language PL/pgSQL. By a fortunate accident, I had the opportunity to write some complicated features (read "calculation heavy") for a web app using PL/pgSQL. Once coupled with triggers, you can just leave everything to the DB to the point, controller has to do nothing except query and return JSON objects to the front. It is so expressive, powerful, efficient and reliable.
I have worked with MySQL, Oracle, MSSQL and as of late MongoDB.
Given a choice, I will always settle for PostgreSQL... it is just so natural to work with.
News to me. Possibly true, but I doubt that's the main reason for MySQLs popularity.
MySQL is simply easier to use and administer. Postgres has a sharper learning curve. This made MySQL the go-to for shared web hosting (back before you could have a VPS for pocket change) and so it's what everyone ended up using for anything web related.
Personally I prefer postgres, but I get the appeal of MySQL. It has a much warmer and fuzzier user experience.
'nuff said
MySQL has JetProfiler, Postgresql does not.
PostgreSQL has it. Makes development faster by an order of magnitude with a big database schema.
And not because MySQL is a better product, but because everyone thinks of MySQL as the database that isn't a very good choice for large projects. You should be comparing Postgres to SQL Server, Oracle, etc. -- the big guys.
Was speed ever an actual problem with PostgreSQL? Or was it just that clueless folks wanted a better throughput number without caring about the implications?
DBA's are known for being rational and objective when discussing competing RDBMSs, I'm looking forward to this discussion. Maybe next we could discuss which is better Islam, Christianity, or atheism.
I came to the datacenter drunk with a fake ID, don't you want to be just like me?
SQL Server is free up to 10 GB. After that, I'll probably still pay for SQL Server. MySQL and MariaDB are toys, and there's nothing that PostGre offers that SQL Server doesn't.
I don't respond to AC's.
"According to developer David Bolton, here's why PostgreSQL is worth a second look for your database-management needs" - nope, it's only for some of your database needs.
Postgres has rowids. This allows for more generic programming. MySQL does not. You have to forcibly add an integer id to each table which can be suckful.
Seriously, Firebird destroys all these other databases in terms of performance, space, and quality.
Too bad "the system" (aka dumbass "momentum") is against it. :/ Wake up, morons, you are morons.
I applaud those modding me down with no actual experience. You are smart! Real smart! (?) Slashdot is not great when it comes to realizing true skill. Too bad for you, I guess. WTF
I started with postgres years ago but I had some bad updates (on Debian) that broke some installations so I dumped it for mysql and haven't had a problem since. Perhaps an unfair, n=1 criticism, but there it is.
Like I'm going to trust a Dice "insights" page to tell me what DBMS to use...
As a DBA; I would choose Postgres. Simply put Postgres has always strived to be a true RDBMS database where as MySQL was create aa a simple tool to solve a single problem. I don't consider MySQL a true RDBMS. Is MySQL ACID compliance? sure, now it is -- that is if configured correctly but the lack of it was historically promoted as a feature. Poor execution engine; given a complex queries MySQL falls apart where as Postgres handle the complex queries with ease. SQL compliance? MySQL is a disaster when it comes to compliance were as Postgres is more SQL complaint then even commercial databases like Oracle, SQL Server, etc.
I would compare Postgres to Oracle, MySQL, etc. The only reason to go with Oracle over Postgres is for Oracle features (or large company support) that are not currently available in Postgres yet. i.e OracleRAC, Exadata, Parrell Query (a planned feature for Postgres 9.6), etc.
My only gripe with PostgreSQL are the parts of the syntax that really differ from MySQL vs MSSQL. I mean, I can keep in mind the differences between the latter, but they both seem very similar compared with PostgreSQL.
Memsql.
That is all.
Even if MySQL is inferior RDBMS then it still might be (and probably is) a better choice for most applications for several reasons:
- better support, just compare number of questions of MySQL and PostgreSQL on StackOverflow. Most MySQL issues can be solved by using Google 'I'm feeling lucky'
- your friends know MySQL,
- if some software uses RDBMS, it's probably MySQL. You might be left with a choice to learn about one or two sql servers,
- most applications don't need advanced features provided by PostgreSQL,
- there are less freelancers who know PostgreSQL than freelancers who know MySQL. They might charge more too.
My software stores spacecraft testing data. Each test is good for a couple of gigabytes, and we run dozens each year. We use PostgreSQL because:
- Rock-solid stability. Zero data loss after a decade and a half of operations. Zero problems of _any kind_, over that same period.
- Great features and excellent standard conformance.
- Documentation is absolutely excellent, best of any open source project I know of.
- pgAdmin 3 allows trivial on-the-fly inspection of databases.
- No licensing issues. No payment "per core", "per connection", or whatever other bullshit they've come up with now. Install where we like, as much as we like.
We didn't choose MySQL because it lacked ACID compliance (data loss would be problematic), and because it has entirely too many weird gotchas. Sure, you can work around all of those... But why would you if you can also choose PostgreSQL?
As for Oracle, that's what we used before PostgreSQL. Back in the days, you couldn't store more than 2000 characters in a string, their C interface was the stuff of nightmares, support tools were non-existent, and installing it yourself, or on anything that wasn't the Blessed HPUX Cluster, was impossible. We had two (minor) data loss events in three years, but that might have been a hardware issue. But the killer reason is of course licensing - with Oracle, we had one server on which all work had to take place. Now we have dozens, and setting up an ad-hoc server for some quick testing is trivial - both technically, and in terms of licensing.
I can take a laptop to a customer site and do a demo or some work, without worrying about licensing. With Oracle you never know whether you are compliant or not, and being found to be non-compliant is extremely, extremely painful.
I'm currently working on a large CRUD application and we've selected postgres as the db of choice. The organization uses both oracle and mysql for other applications. I really don't like the fact that the only difference between users and roles is a --no-password flag. If you're deploying to aws you have to be very careful to setup your local master user with similar privs as the aws account. While automating builds, we've had some major hiccups scripting the schema creation/cleanup due to the fact that only a table 'owner' has the privs to delete a table unless explicitly granted. Put simply, just pay attention to the privs the aws master user has. Don't over engineer your roles and users. I prefer DBeaver over PGAdmin. Dropping a schema requires all users to be disconnected which means that you'll need to execute a snippet of sql to disconnect everyone. Over time one becomes accustomed to these nuances but they are a pain to deal with at the beginning.
The issue I quickly realized with mysql when I tried to replace an aging IBM DB2 data warehouse (with a total of 10 billion rows) was that Mysql only supported a small subset of the SQL standard. This quickly lead to almost all of our normal queries for BI not even being able to be ported. After trying to make it work anyway I eventually gave up. I had recently started using postgresql in my home server set up since I didn't know when direction Debian was going to take with the whole mysql/maridb debacle. So I convinced my boss to scrap the mysql idea and try again with Postgres. I was amazed at how well the SQL standard was supported by postgres. It also had a far superior query planner that mopped the floor compared to mysql performance for any query with more than a couple of joins. I also like how postgres isn't owned by any one entity like mysql. It is all I use now.
Speed is less of an issue because of hardware improvements. Every component, from the storage array, to the bus, to the CPU, is exponentially faster now than it was just a few short years ago. Postgres has benefited from improvements in processing and storage speed; not from design improvements.
Setting up user access can be a pain.
Does PostgreSQL have decent geologically diverse multi-master replication yet? This is honestly the #1 reason why my projects all use MariaDB right now with Galera Cluster. Having the database on multiple servers in each region, it has been a dream when something like hardware failure or a power outage has happened. There is no longer a need or worry about master-slave with fail over and new master election, because all nodes act as masters in the cluster, and nodes can join and drop freely at any time without disrupting the rest of the cluster.
You misspelled "systemd". "Relational Database" is slated to become one of its new features for next year's release.
It's been a 'feature' since the beginning: journald - the new syslog database management system. Moderate speed and nonzero scalability finally put syslog on the DBMS map.
The convenient binary file format ensures security by preventing the unwashed from viewing logs with only a cat, head, tail, or less.
So, you have a Development, and you use Javascript (React, Angular, etc) for FrontEnd, NodeJS as BackEnd and Postgres with functions en PLV8, basically, you have to learn one language mainly .. JAVASCRIPT
Easy and powerfull...
PD: Complex calculation must be stores on a function on Postgres but not in Javascript.
MariaDB and MySQL are basically the same thing. It comes down to licensing and vendor preference. But Postgresql vs MySQL vs Sqlite is just a question of what your use case is.
Sqlite is for the prototyping, small projects, and small foot print. Its an amazing piece of software and solution for its niche. It is probably the most widely used DB out there. Extremely easy to setup, program against, and test. And very forgiving.
MySQL is for the small to large size operations. Easiest to setup and manage for the feature set you obtain. It is fast and reliable and has a lot of 3rd party support. Most devs work in this area and I think this is why it is used so much. It is also many folks first "personal" testing DB and thus has a lot of momentum. You can use it at the enterprise level, but not really where it shines. Its like taking a Camry and putting a HEMI in it. It works, but that's all we can really say about it. Use when migrating an existing solution is too costly.
Postgresql is large to enterprise level projects. I place it between MSSQL and Oracle. Its a wonderful software minus the "Dedicated Vendor Support" toilet paper that PHBs love. Extremely feature rich. But it needs enterprise level care and maintenance processes just like the others. You can use it on small projects, but its really over kill.
This is the same discussion we been having since 2005. Each system has improved a lot, and their use cases overlap more, but the general logic on which is best to use is still the same.
I replaced mysql with postgresql on an owncloud project running on a banana pi and it was the best solution I could find. Things actually flowed with postgresql. I was very pleased and started to consider it for everything else.
Who cares which database is best.
Tell us the really important stuff - are there enough women using databases, and if not, what plans are in place to increase those numbers?
Depends on what kind of replication you need.
It does pretty decent asynchronous master->slave replication.
You can also have a mirror with synchronous writes.
Multi-master replication- there are some 3rd party tools to do that, still pretty young and immature AFAIK.
Clustering- there are some 3rd party projects to do that, some commercial.
More info here: https://wiki.postgresql.org/wi...
--Coder
PostgreSQL supports transaction DDL statements (e.g. ALTER TABLE, CREATE TABLE). MySQL doesn't. If you run a poorly-written upgrade script against a MySQL database and something goes sideways, your only recourse is to restore from backups. This means that any sane MySQL upgrade plan involves testing the upgrade on a replica of the database first. For large or mission-critical deployments that usually isn't an option.
If all you're looking for is a cheap DB to serve a Wordpress blog about your hamster, MySQL away. Otherwise, use PostgreSQL. You'll sleep better.
I recommend either PostgreSQL or SQLite. PostgreSQL is so easy to install and set up, though, that I would recommend SQLite only if you don't control the server.
It's pronounced Postgres Q L, if you want to say it all the way. But it's okay if you just want to say Postgres. Even the database's default superuser is still called postgres.
A former employer uses PostGIS extensively. It's more sophisticated than the support offered in MySQL (which only uses planar geometry) and is pretty much the standard in the GIS world. I'm writing an app which logs ADS-B position reports from planes, and it makes it trivial to detect when aircraft are landing or taking off from an airport - you can query if a point's within a polygon, and depending on speed, rate of ascent/descent and altitude, can come to some conclusions.
A nail and a hammer open a paint can faster than anything!
Always use the fast tool, not the right tool.
E
PostgreSQL is the first choice.
When I see MySQL i immediately figure it's a sloppy, crap design by someone who don't know shit about databases and didn't bother to research.
i have yet to be wrong.
You know a tool is not for you when its defaults are set so it'll still run on SunOS 4.
Seriously, if you want to screw yourself by choosing a database that has poor tooling and is opaque, choose PostgresSQL. Because when you do, you know that you have the big RDBMS balls and you can walk into any open-source conference with a feeling of superiority - because you just spent weeks figuring out why your specific workload performs like crap using nothing but your pubic hairs and some logging.
For everyone else, save yourself months of headache and use MySQL.
Comment removed based on user account deletion
Using MySQL as your DB is like using your smartphone as your camera. It's not that it's the best - in fact sometimes it might suck - but it's fairly easy to setup and use, is common, and it's there when you need in (available in most distributions and in VPS solutions etc).
The same Developers developed MariaDB that created MySQL. This history is well known. What is not as well known is that they were prevented from fixing problems with MySQL and one of the first things they did when they left Sun-Oracle was to fix all the things that they were not allowed to fix because Oracle, the company, wanted everyone to license Oracle the RDBMS.
Why this is not advertised, publicized, discussed more is beyond me. If you want to compare Apples to Apples, you have to consider all the items fixed in MariaDB that made it faster, more stable and better, else it's not a good comparison.
No experience with PostgreSQL. But with experience with both MariaDB and MySQL (as well as DB2, Oracle, and other SQLs) you would be crazy just to blindly pay the licensing fees for Oracle without considering MariaDB first.
If someone says it won't scale, don't believe them. And beware of made up excuses by those that want to stay with Oracle anyway. Just say no.