Home » Ruby (page 11)

Ruby

Architecting Rails Apps as Microservices

Rails apps come in many shapes and sizes. On the one hand, you have large monolithic applications where the entire application (admin, API, front-end, and all the work it needs to perform) is in a single place. On the other end of the spectrum, you have a series of microservices, all communicating with each other with the goal of breaking ...

Read More »

Heroku Style Application Deployments with Docker

In this article, we describe how you can use Kontena’s experimental features for deploying application with Kontena just like with Heroku! Developing and deploying applications to Heroku was revolutionary when it was introduced. A developer could just focus on developing a killer app instead of configuring servers and build scripts. Heroku, just like many other platform-as-a-service (PaaS) solutions, allows developers ...

Read More »

Deploying Your Docker Rails App

In a previous article by Marko Locher, we learned how to run a Rails development environment in Docker. Marko also wrote about how to test a Rails app with Docker. So assuming we have our dev environment set up, our app is tested (and the tests are passing), we’re ready to think about deploying our application to production. If you ...

Read More »

Alternative Service Communication Using Pub/Sub

The HTTP protocol was designed for synchronous communication between two entities — for instance, a browser requesting a stylesheet or a server charging with a payment processor. Those are synchronous operations where nothing can proceed without an immediate response. Often communication can be asynchronous, like when queueing up work to be performed in the background. It is possible to use ...

Read More »

How to Find Ruby Code Smells with Reek

Your Ruby code smells. And it’s okay — mine does, too! Maybe it has some long methods with too many parameters, a few classes that try to do too much, an uncommunicative name here or there. No codebase is perfect, but it’s worthwhile to be aware of its deficiencies and refactorings that could improve the state of things — so ...

Read More »

Debugging a Memory Leak on Heroku

This is one of the most frequent questions I’m asked by Heroku Ruby customers: “How do I debug a memory leak?” Memory is important. If you don’t have enough of it, you’ll end up using swap memory and really slowing down your site. So what do you do when you think you’ve got a memory leak? What you’re most likely ...

Read More »

Your Preproduction Checklist for Your Rails App

Before we dive in to this extended preproduction checklist for a Rails app, you might ask, “Aren’t Brakeman and ongoing pull request reviews enough?” Sure, SQL injection problems might be found with automatic tools, which is great. They’re getting better all the time. But they still may miss some problems. For example, they can’t find vulnerabilities in the application logic. ...

Read More »

Folding Postgres Window Functions into Rails

You’ve heard of window functions in PostgreSQL, but you aren’t quite sure what they are or how to use them. On the surface they seem esoteric, and their use cases are ambiguous. Something concrete would really help cement when window functions are the right tool for the job. We have our work cut out for us! Through this post we’ll ...

Read More »

Building a JSON API with Rails 5

Rails is great for making traditional server-rendered web applications. It has support for cookies, sessions, and other browser-specific functionality right out of the box. It’s also great for building JSON APIs, but why include a whole bunch of functionality that we aren’t going to use if what we want is to simply build a JSON API? That’s where using Rails ...

Read More »