:wave: Working on a guide for SST + RDS. Can I get...
# general
f
👋 Working on a guide for SST + RDS. Can I get a vote on your production setup:
1️⃣ RDS + managing connections in Lambda
2️⃣ RDS + RDS Proxy
3️⃣ Serverless Aurora v1
4️⃣ Serverless Aurora v2
g
3 and 4 are with data-api ?
f
Hey @Gabriel Bleu, v1 supports data api, v2 doesnt i think
@Nicklas Nyegaard @Adrián Mouly are you guys using Serverless Aurora v2 in production? Are you using it with RDS Proxy?
n
Not in production, and without proxy
a
I’m using v1 I think… not sure.. but not using Proxy.
d
Is anyone using v1 at scale? Cuz their page legit says use cases is for dev or qa. We’re looking to migrate to their serverless offer though
f
@Dennis Dang +1. I’m curious about that too. And v2 doc says it’s not meant to be used for production.
g
Thanks @Frank we didn't test V2 yet since using postgres and region availability is quite elitist
r
We're currently migrating away from Serverless Aurora v1 to go all in on DynamoDB so we can remove the need for VPCs, NAT Gateways and all that cost and complexity. We did sign up for the V2 preview and recently got access but it took so long we'd made our decision to ditch it anyway. Nobody seems to know when it'll be GA. V1 start-up times are too long, Data API seemed like it might improve things a bit in terms of VPC requirements but we figured, for our app which doesn't have a lot of relational data, DynamoDB had more upsides
f
@Ross Coundon ahha.. yeah I was curious about start-up times too.. seems like a deal breaker for prod usage. Thanks for sharing!
Hey @Greg Coonrod are you using v1 in production?
@Ashishkumar Pandey are you using v2 in production?
a
Sorry for this stupid question… but why is Aurora needed? I can’t get difference with RDS. Yes, I didn’t research about this yet… I’m just using some legacy stuff from my job.
Is one the engine and other the driver? or what.
r
The idea of Aurora is meant to be that it's more cost effective because the compute element only costs money when the DB is being used, whereas RDS is always on.
a
But you need RDS to use Aurora, right?
Aurora is on top of RDS?
I’ve been checking the RDS CDK construct and it has settings for Aurora that’s why I don’t get it.
Copy code
new DatabaseCluster(this, 'MyDatabase', {
      engine: DatabaseClusterEngine.auroraMysql({
        version: AuroraMysqlEngineVersion.VER_2_07_2,
      }),
d
Aurora is a (or two) modified db engine that's compatible with both postgres or mysql. Or perhaps it's two separate db engines modified based on either roles. But that's opaque to us. The main point is that if you're using Aurora, it is a long lived server. Separate to this version is Aurora Serverless.
a
Ohhhh.
So you can use Aurora Engine on RDS…. but also there is Aurora Serverless.
a
@Frank yes, it’s just for aggregation purposes on a dynamodb change stream. I just hope that it gets the Data API support so that I can write a orm adaptor around it for typeorm.
p
We're using Aurora Serverless v1 with Postgres, since v2 (if I've remembered correctly) is still in beta and only supports MySQL. We were (and still are for some things) using dynamo but we're dealing with a lot more relational data now, hence the move.
We're only using the data API to access it.
We noticed startup times are pretty bad on Serverless Aurora but only if you turn on the scale down to 0 option on idle setting, which is off by default.
t
Lots of good info in this thread. I'm also waiting for a good library for data api
Maybe I write it 🤔
s
Pretty interested in this guide. One thing I'd like to know is how people do database schema migrations. At deploy time with a custom resource, or via a separate invoked function, or another way?
a
I was thinking of writing an adaptor for typeorm / prisma once Aurora Serverless V2 gets it.
d
@Simon Reilly We have a lambda that has the sql scripts copied along with it. After deploy, that lambda gets called and runs any new sql scripts.
s
Yeah, that's what we do too. Custom resource seems too coupled to deploy. Plus, it doesn't seem safe for rollbacks
c
@Phil Astle How are you guys handling the startup times issue? We're experiencing the same thing at the moment and are planning to move away from aurora because of it
a
V2s startup times are drastically better and since my usage of relational data is very limited, v2 works fine for my needs.
c
Ahh thats great to hear. Are you using v2 in production?
a
Yep, I’m using it for user analytics primarily. I’m dumping data into a dynamodb table with a ttl of 5 minutes and then via the change stream processing the changeset and adding it to aurora serverless v2.
f
@Simon Reilly just putting together some examples of using different DB options. Probabaly DynamoDB, RDS and MongoDB to start with, and adding more options over time.
p
@Chad (cysense) We don't let the cluster pause (i.e. set itself down to 0 ACUs) and keep it at the minimum setting instead.
s
Very cool @Frank, interested to see the direction. Would be cool to see the same application, build with different data layer technology. Some simple API microservice with RDS, DynamoDB, and Mongo
s
Serverless Aurora v2 is out?!
t
No he's just playing with fire 😄
s
six people said they’re using it 😳 it must still be in preview. I wonder if they made the spin-up time faster than the first version (takes about 20 seconds to spin up)
r
No, it's still in preview, have to apply to get access. Spin up times are supposed to be much better, I got an invite but never got a chance to use it
I assume, by how long it's been in preview, they must be doing something quite radically different compared with v1
s
yeah, it’s supposed to be faster (startup) and more granular billing I think
p
@thdxr we're using data-api-client to talk to the database, if that helps. Seems to work pretty well for everything I've tried to do with it so far.
k
4) Aurora v2 + Data API
Hoping for SST + TypeORM + Data API > Aurora v2, Like TypeORM Repository Patterns and migrations
4️⃣
f
Thanks @Kevin Baker. Aurora v2 doesn’t support Data API yet. I can see it being very appealing when it does.
k
First step, I ported the Aurora Serverless PostgreSQL API example to MySQL 5.7 https://github.com/kevbaker/sst-rest-api-mysql