Live data from Hacker News

Amazon RDS for PostgreSQL

aws.amazon.com

21–30 of 246 posts

Re: Amazon RDS for PostgreSQL

#21
post #8

I've heard about PostgreSQL and know that HN community raves about it, but am currently using RDS with MySQL. Does it make sense to migrate to PostgreSQL, I don't have a lot of data as I'm in the early stage? What are the primary advantages that PostgreSQL provides over MySQL? Any advise/pointers is appreciated.

> Does it make sense to migrate to PostgreSQL, I don't have a lot of data as I'm in the early stage? What are the primary advantages that PostgreSQL provides over MySQL? Any advise/pointers is appreciated.

If MySQL works for you, there is no reason to change. Some people have quite a dependency on Postgres (hstore, JSON, transactional DDL, pubsub, PLPGSQL etc.)

Re: Amazon RDS for PostgreSQL

#22

Will anyone please explain the tactical reasons why PostgreSQL won? It's pretty obvious it has. I've basically ignored the database wars for a few years, so it's kind of interesting to see that everyone's using PostgreSQL now.

I wish I lived in your world. Where I am, 90%+ of web developers believe there are two options for making web sites: "LAMP" and .net/sql server. I am constantly dealing with web developers who genuinely don't even know postgresql exists.

Re: Amazon RDS for PostgreSQL

#23
post #8

I've heard about PostgreSQL and know that HN community raves about it, but am currently using RDS with MySQL. Does it make sense to migrate to PostgreSQL, I don't have a lot of data as I'm in the early stage? What are the primary advantages that PostgreSQL provides over MySQL? Any advise/pointers is appreciated.

Postgres actually cares about your data.

Perhaps you mistakenly insert "2013-10-32" into a date column. MySQL will silently convert this to "0000-00-00" (!!). Postgres will raise an error.

Perhaps you make an error in a transaction. MySQL lets you keep doing subsequent things in the transaction. Postgres treats the transaction as invalid and forces you to start over.

Perhaps you want to add a column to a table that has millions of rows. With MySQL, you'll be waiting a looooong time (see http://stackoverflow.com/questions/463677/alter-table-withou...). With Postgres, it takes about a second.

Of course, there are things you can do to make MySQL less horrible, and this is a generalization. But Postgres is just more respectful and more solid.

Oh, and PostGIS (Postgres' geo add-on) is by far the best open-source geospatial database. If you're doing anything with geographic queries, you need to be using it. MySQL's stuff is laughable in comparison.

Context: I've dealt extensively with both databases, both from the perspective of a framework author (Django) and a developer making products. I've used both databases on and off since 2001.

Re: Amazon RDS for PostgreSQL

#25

Will anyone please explain the tactical reasons why PostgreSQL won? It's pretty obvious it has. I've basically ignored the database wars for a few years, so it's kind of interesting to see that everyone's using PostgreSQL now.

I wouldn't say PostgresSQL has won. MySQL is still very relevant. I would say that if you are just starting out and you already know MySQL and you are proving out your MVP, MySQL is still relevant. Once you have a stable product and you need a better database, PostgresSQL is a good move up.

Given the number of companies who'll provide you with a fully managed Postgres installation there's no reason not start out on it for the MVP - as a user its no harder than MySQL. Even as a sysadmin its not significantly harder, just different to work with to MySQL.

Re: Amazon RDS for PostgreSQL

#28

Somehow it seems pretty costly...Wouldn't it be cheaper for me to just run it on my virtual instance that's hosting the app and probably just back it up with S3.

If you place no value on you're time then yes, it would be cheaper to just run it on your own EC2 instance. There's a lot to be said for not having to worry about the day to day of maintaining a database server though.

Re: Amazon RDS for PostgreSQL

#29
post #8

I've heard about PostgreSQL and know that HN community raves about it, but am currently using RDS with MySQL. Does it make sense to migrate to PostgreSQL, I don't have a lot of data as I'm in the early stage? What are the primary advantages that PostgreSQL provides over MySQL? Any advise/pointers is appreciated.

Great question!

The basic answer is (from what I can tell) that postgres ships with sane defaults. Lots of little gotchas exist in mysql that experienced mysql dbas know to deal with and avoid. On the more sophisticated side, pgSQL seems to have a focus on being "Really Awesome For Experts" where MySQL seems to be focusing on "Being Easy to Get Started".

I've been using pgSQL for my side project and for my "personal tooling" at work, and I can honestly say that it's just as easy for me as MySQL was for the same sort of things.

Re: Amazon RDS for PostgreSQL

#30
post #8

I've heard about PostgreSQL and know that HN community raves about it, but am currently using RDS with MySQL. Does it make sense to migrate to PostgreSQL, I don't have a lot of data as I'm in the early stage? What are the primary advantages that PostgreSQL provides over MySQL? Any advise/pointers is appreciated.

edited to add: - timestamp with time zone

- More robust, fewer crashes, less corruption of data

- More features (JSON data type, partial indexes, function/expression indexes, window functions, CTEs, hstore, ranges/sequences/sets, too many to list)

- More disciplined (doesn't do things like auto-truncate input to get it to fit into a column)

- Not owned by Oracle, it's actively developed, regular major release schedule, etc.

- Better Python driver (don't know about other languages)

- Choice of languages for database functions/procedures (Python, JS, etc.)

- Better partitioning support

- Better explain output, explain analyze, buffers

- Multiple indexes allowed per table in a query

Post reply on HN