RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

Submit a post

You can use basic HTML markup (e.g. <a>) or Markdown.
Note that your post may be edited to suit the format of the site.

As you are not logged in, you will be
directed via GitHub to signup or sign in

Post Preview

Note: Only the first pargraph is shown on the front page and overly long paragraphs may be broken up.

Implementing an Inventory Module in Ruby on Rails: Handling Concurrency with Database

When implementing an inventory module in a Ruby on Rails application, ensuring consistency in stock levels is crucial. If multiple users try to purchase the same item simultaneously, concurrency issues can lead to overselling. In this post, we’ll explore two approaches to handling inventory management: using a simple counter with database locks to prevent race conditions & improving performance and reliability using SKIP LOCKED for efficient inventory allocation. [more inside]

🚀 Mastering Rails Migrations: The Power of change_table 🚀

Are you handling database migrations efficiently in your Ruby on Rails projects? Many developers use add_column, rename_column, and remove_column separately—but did you know that change_table can streamline multiple modifications in a single block? [more inside]

Want to make your GitHub profile stand out? 🚀

Your GitHub page is more than just a collection of repositories—it’s your developer portfolio. Whether you’re looking for new job opportunities or showcasing your open-source contributions, making your profile visually appealing can set you apart! [more inside]

How to configure Postgres as an Accessory with Kamal 2 and Rails 8 on a single server

This guide shows how to deploy a Rails 8 app with a Postgres database using Kamal 2 to a single VPS. It makes up for the lack of documentation around Postgres accessories in the official Kamal docs and helps you avoid common configuration errors connecting to the accessory DB from your Rails app. [more inside]

A Ruby implementation of the HyperLogLog algorithm for efficient cardinality

Hyll is a Ruby implementation of the HyperLogLog algorithm for the count-distinct problem, which efficiently approximates the number of distinct elements in a multiset with minimal memory usage. It supports both standard and Enhanced variants, offering a flexible approach for large-scale applications and providing convenient methods for merging, serialization, and maximum likelihood estimation. [more inside]

🚀 Handling File Transfers in a Heroku Environment with Net::SFTP 🌐

As developers, we often face unique challenges when working with cloud platforms. Recently, I had to deal with an interesting issue—downloading a file generated on the fly within a Heroku server. Since Heroku’s filesystem is ephemeral, retrieving the file wasn’t as straightforward as it seemed. [more inside]

Loading older posts