
Google Cloud SQL for Postgres - wwilson
https://cloud.google.com/sql/docs/postgres/
======
mastazi
Your turn, Azure

[https://feedback.azure.com/forums/217321-sql-
database/sugges...](https://feedback.azure.com/forums/217321-sql-
database/suggestions/8300487-mysql-and-postgresql-as-daas-from-ms-like-an-
azur)

[https://feedback.azure.com/forums/217321-sql-
database/sugges...](https://feedback.azure.com/forums/217321-sql-
database/suggestions/8403264-offer-postgresql-as-a-paas-daas-service-not-
via-a)

[https://feedback.azure.com/forums/170024-additional-
services...](https://feedback.azure.com/forums/170024-additional-
services/suggestions/6814490-drop-cleardb-and-develop-a-native-azure-mysql-
comp)

PS: managed MySQL is currently the most requested additional service on Azure:

[https://feedback.azure.com/forums/170024-additional-
services...](https://feedback.azure.com/forums/170024-additional-
services/filters/top)

.. and managed Postgres + MySQL are currently the third most requested feature
in relation to their managed DB offering

[https://feedback.azure.com/forums/217321-sql-
database/filter...](https://feedback.azure.com/forums/217321-sql-
database/filters/top)

~~~
sjellis
I really would not recommend Azure unless you are going for an all-Microsoft,
all-the-time strategy. Their hosted SQL Server offerings have actually been
really good, and IMO is one of the best parts of the platform.

~~~
jlian
Would love to hear more about your opinions on the first part.

~~~
sjellis
(We've used Azure for 3 years or so, AWS for longer).

Azure's USP is basically the deep integration into the MS ecosystem at all
points. Azure is relentlessly promoted to every MS technical professional
through all of the learning channels (and MS developer outreach is the best),
Azure is integrated into the excellent developer experience of .NET and Visual
Studio, hosted SQL Server on Azure is really nice (doubly so because it avoid
the licensing quagmire), Azure with PowerShell is a fantastic CLI experience,
etc. etc. Lots of reasons to love Azure if you are an MS specialist.

If you are outside the MS ecosystem, then you aren't getting much of that. For
you, Azure is a less mature AWS with less support by and for _your_ ecosystem.
The situation with hosted MySQL on Azure is one example, but it is a two-way
street: Microsoft loves it's own stack more, and folks outside the MS
ecosystem love Azure less, partly because AWS is already the established
default.

I could list papercuts and issues that I have had with Azure itself, but in
each case I'm pretty sure or certain that AWS has had equivalent issues
earlier in it's life, so it feels a bit unfair to do that.

------
dhd415
Very exciting, but high availability, instance cloning, and read replicas are
listed as "This functionality is not yet supported for PostgreSQL instances"
in the docs. Seems like those need to be available before it's a realistic
option for production workloads.

~~~
boulos
This was a tough call for the team: ship now for the folks that are okay with
that, or wait until it's fully baked. They chose the former, which certainly
means it's not a great idea for serious production load, but that's also true
of it simply being in Beta. You won't see it go GA before it's really ready
for production work (including replication, backups and so on) but I think it
was a reasonable choice to get people started.

Disclosure: I work on Google Cloud (but not Cloud SQL).

~~~
tracker1
Regarding being beta, the flexible environment instances for App Engine
are/were beta (I swear it was just a couple days ago, it was labelled beta,
but not seeing it now). All the same, a _lot_ of people are building towards
that (ie Docker).

~~~
myelin
App Engine Flex just came out of beta today :)

[https://twitter.com/googlecloud/status/839901710948589568](https://twitter.com/googlecloud/status/839901710948589568)

------
laixer
Cloud SQL for Postgres is launching today and will be available for all users
early next week.

Source: Work on Cloud SQL.

~~~
0x27081990
Is it wise to use Cloud SQL + GKE? Some say it is not wise to use Docker for
DB

~~~
theptip
Yes, it is wise to do that. If you don't want the overhead of running your own
SQL instance, you definitely don't want the overhead of running it on
kubernetes; it's quite tricky (but the addition of StatefulSets in 1.5 has
made it easier).

If you're running a CloudSQL instance, you can use a sidecar container to
manage proxying the connection to the database:
[https://github.com/GoogleCloudPlatform/cloudsql-
proxy](https://github.com/GoogleCloudPlatform/cloudsql-proxy)

"The Cloud SQL Proxy allows a user with the appropriate permissions to connect
to a Second Generation Cloud SQL database without having to deal with IP
whitelisting or SSL certificates manually."

~~~
nstj
I've been having rather significant latency going through the proxy (MySQL
Cloud SQL) - has anyone else experienced similar?

------
cridenour
Has anyone seen documentation that it supports PostGIS?

Edit: Nevermind, it does!
[https://cloud.google.com/sql/docs/postgres/extensions](https://cloud.google.com/sql/docs/postgres/extensions)

~~~
clhodapp
I wish uuid-ossp was in there... Being able to generate type 4 and 5 UUIDs on
the database side is extremely convenient, especially during migrations.

~~~
koolba
It includes pgcrypto so you can use the new gen_random_uuid() from there to
generate UUIDs.

For the record, uuid-ossp is a steaming pile and there's no reason to use it
for anything on a modern Postgres install.

~~~
shawn-butler
What exactly do you mean by this? Your comment is uninformative without some
substance.

~~~
koolba
The code is pretty much unmaintained at this point, it's a pain in the ass to
build, besides the v4 UUID generation function everything else in there is
useless, and the v4 UUID generation function is 6x slower than the one in
pgcrypto[1].

There's no reason to use it and incorporating it into projects just creates
headaches down the road.

[1]: [https://www.postgresql.org/message-
id/flat/52CF07C2.3080101%...](https://www.postgresql.org/message-
id/flat/52CF07C2.3080101%40ohmu.fi#52CF07C2.3080101@ohmu.fi)

~~~
clhodapp
I believe that type 5 (and I guess type 3) UUIDs both have legitimate use
cases, especially when data migrations are involved. Both of these types are
supported by uuid-ossp but not by pgcrypto.

------
jarym
This is excellent news - am currently evaluating options for cloud Postgres.
Only wish they'd support a few more extensions -
[https://cloud.google.com/sql/docs/postgres/extensions](https://cloud.google.com/sql/docs/postgres/extensions)
\- e.g. plv8 would be great
[https://github.com/plv8/plv8](https://github.com/plv8/plv8)

~~~
oskari
If you need plv8, high availability or replication features today in Google
Cloud, our Aiven PostgreSQL service may fit your needs, have a look at
[https://aiven.io/postgresql](https://aiven.io/postgresql)

~~~
gkop
Do you sign HIPAA BAAs?

~~~
oskari
Yes, please send an email to our sales or support address and we'll work out
the details.

~~~
gkop
Thanks, sent! :)

------
dvnguyen
One thing is really strange in this thread is that almost every opinion
against Google's customer support are down voted heavily. Google advocates
always say that GCP support is better. Of course they have to be better
because they are the underdog in the cloud war. I can't buy the logic that GCP
is Google but not that Google. What would happen if they could dominate?

Don't get me wrong. GCP as a product is really awesome. I've been using GCE
and Datastore for a project and they just work. I just can't trust Google
enough to bring all my works to their cloud.

~~~
lobster_johnson
Probably because it's something that comes up in every discussion about GCP,
just like Go and generics.

And some of these comments are pretty useless. Like this [1] one. What's even
the point? If you can't offer anything interesting, not even an anecdotal data
point about reliability, why even contribute?

There's every sign that Google is serious about their IaaS. For example,
Google is already dogfooding GCP heavily. According to googlers, a bunch of
public Google products run on GCP.

Also, it's worth mentioning that GCP support _is_ very good these days.

Sure, Google is no longer non-evil, and they are deservedly notorious for
killing products, but GCP is a different category altogether. They deserve
being given the benefit of the doubt in this case, especially as IaaS world
really benefits from competition.

[1]
[https://news.ycombinator.com/item?id=13831966](https://news.ycombinator.com/item?id=13831966)

~~~
lern_too_spel
What Google products run on GCP? That's news to me. I would think they would
have announced that in the keynote.

~~~
CydeWeys
Google Registry does. Site here:
[https://registry.google](https://registry.google) And you can even see our
code: [https://nomulus.foo](https://nomulus.foo)

(I work on this project.)

~~~
lern_too_spel
That's great, but nobody is going to care all that much if Google Registry or
Memegen is down for a few hours. The concern is that Google is asking
customers to put mission critical applications on a system that Google itself
doesn't put mission critical applications on.

~~~
CydeWeys
We have a 24/7/365 5-minute-to-ACK pager rotation. ICANN and our customers
certainly care if random parts of the Internet start dropping off. Our annual
total downtime is measured in minutes.

I can tell you from personal experience that GCP is suitable for these
purposes.

~~~
lern_too_spel
Which random parts of the Internet start dropping off if Google Registry is
down? I'm under the impression that there wouldn't be any news articles (or
even tweets) if Google Registry is down for a few hours and that hardly
anybody would notice at all. Please explain what I'm missing.

~~~
CydeWeys
If the registry goes down, WHOIS, domain checks, and DNS/nameserver updates
all start failing instantly. Anyone looking to buy a domain, or update an
existing one, will get error messages. If someone happens to be caught in the
middle of, say, migrating hosting providers as this happens (which is
statistically likely when there are a large number of domain names under
management), then they'll be unable to update DNS to point to where the domain
name should now go. As the outage grows in length, you'll gradually accumulate
more and more stale nameserver entries that cannot be updated, resulting in an
increasing number of domain names failing to resolve properly, and thus
dropping off the Internet. Additionally, ICANN has stability and uptime
requirements, to the point where your gTLDs can be taken away from you if
you're doing a poor job of running your registry.

Now, granted, we aren't currently running any hugely important TLDs at the
moment, but that won't necessarily continue to be the case going forward, plus
we aren't the only ones to be using our codebase ...
[http://www.donuts.domains/donuts-media/press-
releases/donuts...](http://www.donuts.domains/donuts-media/press-
releases/donuts-collaborates-on-google-s-next-generation-domain-name-registry-
back-end-service)

~~~
lern_too_spel
> Now, granted, we aren't currently running any hugely important TLDs at the
> moment,

That's exactly the point. Google doesn't put anything mission critical on GCP,
which is a huge red flag for anybody putting mission critical applications in
a cloud.

~~~
CydeWeys
That's only because we don't have any yet, not because we're afraid of GCP.
When they launch they will be on our platform, same as all our other TLDs.

------
leesalminen
I'm really excited about the future of GCP and that there is now a serious AWS
competitor.

~~~
_wmd
The company's irrevocably ingrained customer support culture will ensure
they'll never be a serious AWS competitor, not with all the engineering and
money in the world

~~~
bqe
This might be true, but AWS's support is not good. To get good AWS support for
when their ELBs aren't working, or when half of your EBS volumes have multi-
second IO latency, you need to pay for premium support, which is 10% of your
bill.

[https://aws.amazon.com/premiumsupport/pricing/](https://aws.amazon.com/premiumsupport/pricing/)

~~~
poooogles
This is the same for GCP. Unless you pay for gold support it's essentially
useless.

~~~
manigandham
GCP will be replacing the percentage support cost model with a different
system:

[https://cloudplatform.googleblog.com/2017/03/reimagining-
sup...](https://cloudplatform.googleblog.com/2017/03/reimagining-support-for-
Google-Cloud-Platform-new-pricing-model-and-partnerships.html)

------
scardine
The killer for me is PITR (point in time recover). A few years ago a colleague
triggered and UPDATE without WHERE and PITR saved our sorry asses (on MS
SQLServer, a fair product despite my antipathy MS).

Postgres has it, but it is kind of a pain to setup correctly and I love RDS
because I don't have to deal with the setup anymore.

~~~
d_burfoot
One of the most annoying things for me about Postgres when I switched from
MySQL is that in the former you can't put LIMIT clauses on UPDATE/DELETE
statements.

When I'm doing surgical work on a DB, I always, always want to do something
like :

\- SELECT statement showing me the relevant rows (and rowcount=N)

\- UPDATE/DELETE statement with a corresponding limit equal to N+1

It gives nice, easy peace of mind that you aren't accidentally wiping out your
whole table because you messed up the logic on your WHERE clause. Of course if
you made a mistake, you probably still killed N records, but often that is
much much better than killing the whole table (and maybe also downstream
tables that are linked with FKEY cascade delete!)

~~~
saurik
If you are that concerned, put "begin;" before your command, check that the
updated/inserted number is reasonable, and then either do a commit or a
rollback. That way you also didn't screw up N+1 totally random rows. You can
even put a returning clause on the update to see which rows you were
affecting.

~~~
piaste
Or if you can't afford to lock the table in the process, before you run UPDATE
{foo} WHERE {bar} you back up the relevant rows into a temporary table with
SELECT * INTO foo_backup WHERE {bar}.

~~~
scardine
Postgres uses MVCC (Multiversion concurrency control), it solves concurrency
without locking everything you touch.

------
laughfactory
Excited to see this, but holy shit is it unclear what expected costs could be.
It seems like it might be on the cheap/affordable side of things, but it's not
obvious. I almost prefer to just use Compose.io because at least the pricing
is clear.

~~~
ankushio
The pricing is listed here:
[https://cloud.google.com/sql/docs/postgres/pricing#pg-
pricin...](https://cloud.google.com/sql/docs/postgres/pricing#pg-pricing)

Sample monthly pricing:

db-f1-micro instance : $7.56 for compute;

10GB HDD : $0.9 for storage;

No network cost if the database instance is talking to a GCE VM in the same
region;

Disclaimer: I work on Google Cloud SQL

~~~
FLUX-YOU
>db-f1-micro

>db-g1-small

>db-n1-highmem-2

>db-n1-standard-8

>D _32_ Database Instance ( _16_ GB RAM)

>Tier D0, D1, D2, D4, D8, D16, D32

What's up with cloud instance naming schemes? I get this is kind of similar to
Amazon, but man, I bet these are really unwieldy in conversations esp. if
someone is new to a platform.

~~~
rvs-ie
We know. That's why PostgreSQL pilots hopefully clearer pricing structure
where you choose how much CPU and RAM is needed and pay per CPU and GiB of
ram. No more `db-nX-<something>-X`.

You'll still see instance size names for a while though. I think D0-D32 are
for first generation of CloudSQL (which is MySQL only). db-* are for second
generation and match GCE instance names.

------
JohnnyConatus
Is there a reason Google is so slow to compete with AWS? This seems like
another example of where they're playing catch-up. Meanwhile, I'm blown away
that Node is still just in Beta (with no SLA / deprecation guarantees) when
Heroku and AWS have supported it for years.

~~~
lobster_johnson
They're playing catch-up in some areas, but in others (networking, containers,
pub/sub, BigQuery, authentication, CLI tools), they're ahead (and AWS is far
behind).

Whereas AWS aggressively targets the more traditional enterprise stacks (like
running a big single-node RDBMS in the cloud), Google seems to give priority
to more modern, decentralized tech.

~~~
meddlepal
It seems Google is very interested in making GCP a platform for companies that
really need to build cloud-based distributed systems first and foremost. It's
a cloud-native IaaS platform. AWS, which I also use extensively FWIW, has
always felt more like a platform for porting existing on-premise applications
onto. You can build atop of AWS at any stage of the game, but it never quite
feels like it's anymore than a bunch of very integrated parts with various
degrees of quality.

~~~
lobster_johnson
Yes, exactly.

------
saosebastiao
The last piece of the puzzle for me to have a full stack alternative to AWS.
Thanks Google!

Edit: not a complete end of the world, but it would be really nice (and
completely easy/safe) to have the uuid-ossp extension available.

~~~
daenney
pgcrypto is available which has UUID v4 support.

------
hvo
Yep.I now believe Google is serious about cloud.It is beyond me why it takes
Google too long to do this.

~~~
nodesocket
First to market does not always win (see Apple). Google can take all the
lessons learned from AWS RDS and other players and build better solutions.

~~~
meddlepal
I don't think it's an all or nothing game either. I think there is a lot of
room for the big three IaaS platforms to coexist comfortably.

------
mvitorino
Yes! We have been asking for this for a while now when asked for feedback
about what we would value. Managed ElasticSearch is next on our wishlist.

------
caleblloyd
Will it be available in the same private network as the rest of our GCE VMs?
Last I checked, Google Cloud MySQL runs over the public network, which is a
big pain in the ass for access control.

~~~
rvs-ie
No, it's currently public IP only.

------
meddlepal
Huge news! This + GKE + the new improved GCE billing setup is killer for most
shops.

~~~
chetanahuja
Could you elaborate why that combination is killer? Is the new billing setup
more efficient cost wise? What _is_ the new billing setup?

------
crudbug
Promising.

Is Google contributing anything back into Postgres codebase ?

They could have named something different for the product - Cloud SQL ?
seriously.

~~~
lobster_johnson
Cloud SQL is Google's counterpart to RDS. They support both Postgres and
MySQL.

From what I've heard, Google is running a vanilla version of Postgres. They
don't offer any features beyond what mainline Postgres provides (unlike AWS
Aurora, which runs modified versions versions of MySQL and Postgres).

------
hizanberg
Awesome, was the main service needed before being able to consider moving from
AWS - let the cloud wars begin!

------
sandGorgon
this is huge! I take my words back - RDS finally has a competitor.

------
brightball
Well, I guess I can try out Google Cloud finally

------
cvburgess
Does anyone have a good comparison between this, RDS, Aurora, Citus, Heroku PG
and some of the other Postgres (and "Postgres-compatible") services?

With so many DBaaS tools available, I'd like to know the best options for
things like pricing, availability, features, tooling, monitoring, etc...

~~~
pykello
I think use-case for Google Cloud SQL, RDS, Heroku, etc is a bit different
from Citus and other distributed databases. It seems that Cloud SQL has very
limited scalibility (32 processors, 200GB of RAM), so it might not be very
good at usecases that your working dataset is in order of terabytes or more.
Citus on the other hand has horizontal scalability and you can add more CPU
power and RAM by adding another machine to your machines.

If my data were at order of 10GBs, I would choose Cloud SQL, RDS, etc. At
order of 100GBs, I would try both Cloud SQL, RDS, etc. and Citus, etc. to see
which one fits my usecase. At order of terabytes, I would choose Citus or some
other distributed database.

(I'm a former Citus employee and Current Googler in a non-Cloud SQL team)

------
NatW
What is the maximum disk space for this offering? Amazon's RDS peaks out at
just 6TB currently.

~~~
laixer
10TB.

------
nodesocket
Wait did this leak before the keynote announcement? :-) (I'm at Google Cloud
NEXT right now).

~~~
chillydawg
Well, about 10 different googlers have hinted at it on HN threads and
elsewhere over the last fortnight.

~~~
jacques_chester
They've been hinting for months.

------
knz
Does anyone know if it supports PostGIS? I'm not seeing much on the page (on
mobile).

~~~
oomkiller
Yes

Disclosure: Not a Google Employee, and I don't work on Cloud SQL

~~~
knz
Thanks. It's such a popular extension that I'd be surprised if it wasn't
supported.

~~~
tracker1
I was surprised to not see plv8...

[https://cloud.google.com/sql/docs/postgres/extensions](https://cloud.google.com/sql/docs/postgres/extensions)

------
clhodapp
This is definitely going to be very useful when it's fully fleshed out but be
warned that this initial beta doesn't support Google-managed replication or HA
(to say nothing of an SLA, of course).

------
tarr11
This makes me seriously consider switching from heroku for my rails postgres
app. Probably could cut my costs significantly.

Anyone have any comments or experiences with the Google app engine flex
environment for ruby?

~~~
thagomizer
I'm the Ruby Developer Advocate for GCP. I've used App Engine Flex with Rails
5 on a couple projects recently. Nothing huge but one is in production (it is
for a local non-profit). I've found it to be a great way to get things out the
door quickly and I love the auto-scaling.

It doesn't have all the magic of App Engine Standard and deploy times are
slower than I'd like (~5 minutes). But I'm okay with that if I can use my own
database, any library I want, and I have full portability.

I did a blog post with some of the stuff that I learned:
[http://www.thagomizer.com/blog/2017/03/09/rails-on-app-
engin...](http://www.thagomizer.com/blog/2017/03/09/rails-on-app-engine.html)

------
rattray
Because my first question was "What are the deviations from standard
Postgres?":

[https://cloud.google.com/sql/docs/features#differences-
pg](https://cloud.google.com/sql/docs/features#differences-pg)

It looks like there aren't many – you can't use SUPERUSER, and they enable
extensions, options, and parameters one by one at request.

------
Fiahil
Awesome. Now, can you do the same for Elasticsearch ?

------
no1youknowz
Any chance of seeing pipelinedb being supported?

------
nhumrich
I've been looking forward to this forever

------
JoshGlazebrook
Hopefully this pushes Microsoft to expand their offering. I'd love managed
Postgres in Azure.

~~~
tda
I heard a closed beta for managed postgres on Azure is currently running

~~~
GordonS
Interesting! Is there any info online about this, or is it all just 'secret
squirrel' rumours for now?

------
executive
The day before I was about to migrate to RDS. Change of plans!

~~~
a012
Why change? Because GCloud hype or because cost? I'd stick to AWS RDS because
GCloud Postgres is still in beta as they highlighted.

------
chacham15
Does this use Vitess? Are those two competing products?

~~~
daenney
> Vitess is a database clustering system for horizontal scaling of MySQL.

So probably not, since this is about supporting Postgres on Cloud SQL.

~~~
sougou
Right. Vitess was built by YouTube to solve its own scalability problems. It
provides sharding and cluster-management functionality. In a way, it's
orthogonal. We've talked about the possibility of making Vitess work on top of
CloudSQL. Maybe it will happen some day.

~~~
elvinyung
Sounds like that might take a bite out of the market for Spanner :P

------
fortytw2
Extremely exciting, been waiting for this for a while

------
andrewdryga
It would be awesome to see pglogical in the list of supported extensions,
which can help to deal with replication for now.

------
tomaskafka
5 GB database with 2 GB RAM for $132/month (tier D4)?

Seriously, who is this for? I have no idea - SSD VPS like this is about $10/mo
...

~~~
bbatsell
That is pricing for 1st Generation, which is a whole different product that
does not support Postgres. The pricing for Postgres is here:
[https://cloud.google.com/sql/docs/postgres/pricing#pg-
pricin...](https://cloud.google.com/sql/docs/postgres/pricing#pg-pricing)

    
    
        (1*0.0413+2*0.0070)*730 + 5*0.17 = $41.22/month
          1 vCPU   2GB RAM        5GB SSD

~~~
tomaskafka
Thanks for the computation - looks a bit more sane, but still - seems pretty
expensive compared to a cheap VPS for the one-man-show scale, and quite
expensive for 'we need 100s of those' compared with standalone server.

------
rebelidealist
Does this support hstore and Json store?

~~~
manigandham
Yes. hstore is an available extension, json is a built-in datatype.

[https://cloud.google.com/sql/docs/postgres/extensions](https://cloud.google.com/sql/docs/postgres/extensions)

------
ww520
Good news. More competition the better.

------
softinio
This is great news! Finally!

------
timc3
Fantastic news.

------
qaq
is there IOPS info somewhere?

~~~
jsolson
IOPS for GCE Persistent Disk volumes (which back Cloud SQL) scale with volume
size:
[https://cloud.google.com/compute/docs/disks/performance#type...](https://cloud.google.com/compute/docs/disks/performance#type_comparison)

(For "Local SSD" the IOPS are a function of the number of devices you attach)

------
DonkeyChan
I'm not building anything on top of google unless they give EOL time lines and
stop pulling the rug out from under services.

~~~
menacingly
Strongly agree. My perception is that they've got no grit, which stinks
because Amazon has it in spades

~~~
emodendroket
Can we all stop going on about "grit" yet?

