High Performance PostgreSQL for Rails: Do you run clusters on your MacBook?

Title: High Performance PostgreSQL for Rails

@aapsql @andatki

A reader wrote this by email. Re-posting here:

Do you run clusters on your MacBook?

I use macOS, yes. In the book, readers will install local (updating to 16 now) PostgreSQL (I recommend PostgresApp if you’re on macOS), and then do everything from there.

I also added some new shell scripts to provision the databases, roles, with app-specific schema, and minimal grants/privileges following some PostgreSQL best practices, to the Rideshare repository. You can find those in the “db” directory. There’s also other postgres config files added to the “postgresql” directory like .pgpass and pg_hba.conf as sample files, and I’ll expand on their purpose as needed for the book. These aren’t what you’d take into production, but they can help practice with those config files.

In production where I work we run Postgres mainly via AWS. The configuration is all quite different from this local config, although this local config would be closer to running PostgreSQL in a self-hosted way. Since a lot of startups use cloud providers like AWS, GCP, Azure, not to mention Crunchy Data etc. and other newer players like Supabase, Tembo, etc., I focused on the local PostgreSQL experience and direct installations.

I’m looking to add more instructions for Linux and Windows from volunteers. I’m also interested in dev containers and other modern containers that don’t add a lot of complexity. In later chapters, readers use Docker to run multiple instances of PostgreSQL with replication and other use cases. I will be working on updating those examples so they all use PostgreSQL 16 as well.

Does that answer your question? Please keep the feedback coming. Thanks!

MacOS support will be ongoing. Some readers run Linux and report differences in their initial DB cluster roles and databases or things like that. GitHub source code examples for the book will be updated over time. Check there for the latest info.