:wave: Hey folks, I’m still in the process of inv...
# general
e
👋 Hey folks, I’m still in the process of investigation for a new course. I would like to know what the expected pattern is when developing with something like a postgres database? In a microservice world, I’d tend to run migrations on app startup, which can take as long as it needs to really, the traffic wont start getting routed to the pod doing the migration until it’s alive and healthy. However, with serverless this becomes a little trickier
t
Our sst.RDS construct executes migrations as part of the deploy - this happens before functions are flipped over
d
Building off of Dax, I’d recommend just moving whatever else that constitutes “startup” code to a separate function that runs on deploy. You can read about these in
sst.Script
or
cdk.CustomResource
t
under the hood this uses CloudFormation's custom resource concept, think of it like creating a fake piece of infra in AWS if this infra fails to update (in this case migrations fail) it's the same as any other infra failure like a queue not being able to be created because there's already another one with the same name, it halts the deployment and rolls back
d
Its like we have the same brain, @thdxr!
t
it means we're close to the Fundamental Truths of AWS
d
If only that actually existed.
t
@elliotforbes curious what your new course is
e
Ahh excellent, thanks for the detailed responses! I’ll chew through these and get some content sorted in the coming weeks/months
I made a start on the course here but I wasn’t happy with the course code repository at the time and how I would handle things like versioning, migrations, acceptance tests and CI/CD pipelines
I use SST for the backend of my site and I’m basically solving all these production-level problems now in a serverless context and then when I’m happy with things I’ll start fleshing out the course a little more
t
ah cool
we have some patterns we'll be introducing over the next month particularly with testing
e
I have hijacked the test directory and ended up deploying a ‘pre-prod’ stage which I then hit with loads of acceptance tests written in Go
If they pass in my CI i then deploy to prod
I have just realised I have 2 accounts for this slack, one on my laptop and one on my phone 🙈
t
haha I was like "oh look another person in the thread....wait"
j
lol no wonder our Slack has been growing so fast!
e
This raises another question - Do you have a marketing pack at all that I can reference? like how many new users in the past 6 months etc?
j
The metrics we share publicly are stars, npm downloads (https://www.npmtrends.com/@serverless-stack/core), newsletter subscribers, and slack members. Feel free to DM me if you need more details.
e
Sure thing, I’ll add this to my confluence docs and take you up on that offer at the point of recording so I have the most up-to-date info!
j
Yup!