The Ruby Unbundled Series: Add Microservices to your Rails App in Minutes

This page summarizes the projects mentioned and recommended in the original post on dev.to

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • ruby-quiz

    A sample quiz application written using Ruby-on-Rails

  • Ruby Quiz is a simple Rails application that asks the user five quiz questions. It provides feedback after each question and shows the user their total score at the end. Questions are stored in a database table of the same name, and the results are recorded in an attempts table. The web page is shown below.

  • Rack

    A modular Ruby web server interface.

  • However, we can take this a step farther. Controller action methods are essentially their own Rack applications that respond to HTTP requests. Rack is the middleware that sits between Rails and the web server. We can use the rackup file to start processes that wire the endpoint directly to a controller method we write. Using this approach allows the new microservices to leverage existing model classes as well as CI/CD pipelines.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • Puma

    A Ruby/Rack web server built for parallelism

  • Note that we don’t even add a route for this method. Why is that? Because we wire the domain and port binding directly to the controller action. The rackup file is where the magic happens. Unless specified, the Puma web server looks for the config.ru file. The line of significance in the default version of this file runs the entire Rails application.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts