Introducing Crunchy Data Warehouse: A next-generation Postgres-native data warehouse. Crunchy Data Warehouse Learn more

Posts about Ruby on Rails

  • 6 min read

    Using acts_as_tenant for Multi-tenant Postgres with Rails

    Christopher Winslett

    Since its launch, Ruby on Rails has been a preferred open source framework for small-team B2B SaaS companies. Ruby on Rails uses a conventions-over-configuration mantra. This approach reduces common technical choices, thus elevating decisions. With this approach, the developers get an ORM (ActiveRecord), templating engine (ERB), helper methods (like number_to_currency

    Read More
  • 6 min read

    Use Github Actions on Pull Requests to Automate Postgres on Crunchy Bridge

    Christopher Winslett

    Automating pull requests to deploy staging applications is a game changer for large teams performing shipping quality products. Using Crunchy Bridge’s CLI or API, you can easily automate the entire process for these staging deployments. The simplest workflow would look something like the following:

    Crunchy Bridge review apps diagram

    In this example, during the “Create Postgres Cluster”, we’ll create a hobby-0 cluster for Postgres. Then, when the PR is closed the cluster will be torn down. We keep it simple for this example, but depending on your use case you can expand the capabilities.

    For teams that like to have an anonymized dataset for staging, they use the Crunchy Bridge CLI to fork the production cluster

    Read More
  • 3 min read

    Ruby on Rails Neighbor Gem for AI Embeddings

    Christopher Winslett

    Over the past 12 months, AI has taken over budgets and initiatives. Postgres is a popular store for AI embedding data because it can store, calculate, optimize, and scale using the pgvector extension. A recently introduced gem to the Ruby on Rails ecosystem, the neighbor gem, makes working with pgvector and Rails even better.

    Background on AI in Postgres

    Read More
  • 6 min read

    Postgres Goodies in Ruby on Rails 7.1

    Christopher Winslett

    I just spent last week at Rails World in Amsterdam and had a blast digging back into the Rails and Active Record world. In conversations with developers over the week, I had some notable takeaways from the newest version of Ruby on Rails that I just had to get written up.

    A quick summary before we dig in:

    • async queries

    Read More
  • 6 min read

    Solving N+1 Postgres queries for Ruby on Rails apps

    Christopher Winslett

    Crunchy Data is getting ready to be at RailsConf 2023 in Atlanta next week and we’ve been thinking about our Rails and ActiveRecord users and customers. One of the easiest ways to improve query performance using an ORM is to lean on as much SQL as you can. I’m going to walk through some of the ActiveRecord basics and how to use some smart SQL to work around N+1 query problems.

    The easy CRUD Basics with ActiveRecord

    Read More