When time is critical, exclude large files from your Postgres restore and save the world at the same time.
Do you want a secret that will make you 10x more productive?
Of course you do. As a programmer, you’re designed to look for better, faster, more efficient solutions to all life’s problems. It’s in your nature, and if you could be 10x faster, you would at least be curious.
Today we are going to look at software developers that have come before us, laying down important truths that we would do well to learn and heed. These old text are still as true today as when they were written, sometimes even more so.
Don’t be fooled into thinking that we have entered a period of software dev that is new and different than 30 years ago. This is simply not the case, a new language or technology doesn’t change the fundamental underpinnings of how we design and develop software. We still use functions, arrays, booleans, if/else, and all these require us to assemble them together using our minds. As long as humans are involved, these principles will be here to guide us.
That’s right. You want to take your skills from beginner, bypassing intermediate, and land on advanced. You may have just started coding a year or two ago, but you’re determined to be the best developer on your team. It’s going to take hard work, no getting around that, but we like hard work. You’re going to feel dumb at times, no problem, you’ve fully embraced that feeling dumb means you’re learning and that’s the name of the game. Say ‘good-bye’ to your comfort zone, and hello to boot camp life.
Paige Niedringhaus writes a nice blog post called Password Reset Emails In Your React App Made Easy with Nodemailer, where she outlines how to use Nodemailer + ReactJS + Node.js + MySQL + Sequelize to build a simple password reset flow. Everyone reading these words has doubtless gone through the familiar password reset song and dance. Enter your email into a form field, receive an email with a link, click the link, reset your password, voilà!
PostgreSQL is an amazing RDBMS. Not only is has it been ACID compliant since 2001, it supports many data types and functions, putting it on par with Document Store systems like MongoDB. Postgres supports a wide range of JSON formats and methods to store, search, and transform JSON object data. For instance, the
to_json and related function
json_agg allow you to collect a row into a JSON object. Handy for when you have nested data and want PG to return an object with nested values.
It’s 2018 and file upload is still an involved process
I’ll admit, this process is not straight forward, but once set up, it works like a charm. What’s the goal? We want the client (browser) to upload a file directly to S3 and then store the uploaded information in our server/database.
I’ve been using Knex for a long time, closing in on two years. Just to clarify, Knex is NOT an ORM (Object Relation Model). ORM’s try to model your database into neat and logic classes, but I agree with Laurie Voss, and ORM is an anti-pattern. I’ve used Sequelize, Doctrine ORM, and others. Every. Single. Time. ORM’s will let you down and keep you from leveraging your database to its fullest potential. Developers like them because you can encapsulate all the logic in the code and treat your database as just a dumb data store. This is a mistake.
I’m embarrassed this took me longer than expected, but here is a
.gitlab-ci.yml that will fire up Docker in Docker (so you can build and run containers) and run Postgres to use in your contract tests.