Brandon Rice

Software development with a focus on web technologies.

One Rails App With Many Databases

| Comments

A traditional Rails application uses a single database. Programmers interact with it by writing models that inherit from ActiveRecord::Base. As the application grows, it may be useful to connect to different databases for a variety of reasons. One database might be dedicated to reports. Another may be the result of an entirely different process, and now the Rails application wants to read from it. Using multiple databases helps a Rails application scale, and may be a more manageable first step toward an architecture based on microservices.

A Gentle Intro to WebGL

| Comments

WebGL is a JavaScript API for rendering hardware accelerated graphics in an HTML canvas element. In other words, it’s a key that unlocks the door between desktop application graphics and the web. This post discusses the WebGL rendering pipeline and shows an example of drawing basic shapes using a fairly minimal 50 lines of code.

A Middleware Stack Without Rack

| Comments

Rack is the underlying web server interface used by popular Ruby frameworks like Rails and Sinatra. I previously wrote about making a Rack server from scratch after finding a lack of how-to help while googling. Recently, I found myself digging back in after becoming inspired by Rack’s middleware stack. There are plenty of guides floating around on how to use and create middleware for Rack, but I wanted to take the stack concept itself and use it in a completely different context – something that wasn’t necessarily a web application.