• The REPL: Issue 49 - August 2018

    Cost of a Join

    Brian Davis writes a detailed post of how expensive it is to do join queries in postgres. The details are very interesting, as is the conclusion: Join operations are usually cheap.

    Elixir: a few things about GenStage I wish I knew some time ago

    I’ve recently started working on an Elixir project that seems perfectly suited to use GenStage. In this article Andrei Chernykh complements the GenStage documentation and explains how to use it in an approachable manner.

    What they don’t tell you about event sourcing

    Hugo Rocha writes about the pitfalls of using event sourcing. Like most engineering techniques, it is not a perfect fit for every situation. In fact, I believe event sourcing is a sufficiently different paradigm to traditional CRUD applications that it makes it difficult to approach in a iterative manner that other techniques can be incorporated into existing systems.

    Why JWTs Suck as Session Tokens

    Randall Degges writes a good primer on what JWT tokens are, what security guarantees they give, and what problem they are a good solution for. Namely, using them in distributed systems to reduce inter-service calls to verify authentication (or other claims). As the title not-so-subtly suggests, they are not great as session tokens. Most web frameworks already have this problem solved. There is no need to re-invent wheels that are rolling just fine.

    Read on →

  • On Taking Notes

    For over a year now, I’ve started taking methodical notes as I go about my daily work as a Software Engineer. I find the process worthwhile.

    Read on →

  • The REPL: Issue 48 - July 2018

    Web Architecture 101

    The world-wide web is built on top of many abstractions. That is what makes it powerful. As a user, we are typically just concerned with a browser and a “site”. When I first started programming for the web, I learned about HTTP, request and responses. Sometimes, one needs to dig deeper into common architecture patterns. In this article, Jonathan Fulton covers some of that architecture: DNS, load balancers, web and application servers, databases, caching. I found it to be a very useful reference. Note: As is always the case with computers, there are more levels of abstraction to learn: TCP, IP, UDP, TLS, etc.

    Scaling the GitLab database

    Yorick Peterse discusses some of the scaling issues that GitLab went through and how they resolved them. I find these type of articles very enlightening. Both for the solution they chose and for those that they discarded: Your particular scaling problem might look different, making one of those solutions more attractive.

    Queries on Rails - Showcasing Active Record and Arel

    Pedro Rolo discusses how to go beyond basic queries with ActiveRecord and Arel. I personally use techniques similar to the ones outlined in the article often. Caution: Arel is considered private API by Rails maintainers. If you decide to use it, there might be some work needed to ensure your code works when upgrading Rails. I’ve never had a significant problem with that, provided that I have good tests around complex queries. I much prefer Arel to using long and complicated sql fragments as strings. I believe those are even more brittle.

    Read on →

  • On Remote Work

    A few months ago I changed jobs. My previous job was at a large software company, with offices worldwide. My day-to-day activities routinely included conference calls with people in the Americas, Europe and Asia. For the most part, these were coordinations meetings. My most meaningful collaborations were with the people sitting around me: The members of my team.

    Read on →

  • The REPL: Issue 47 - June 2018

    How to GraphQL

    GraphQL is an alternative to REST that aims to be more efficient than traditional APIs and allow fast development, both for the server and its clients. This is a fantastic tutorial introduction and hands-on tutorial, with just enough code samples to get a sense of what it is like to write back-end or front-end code in GraphQL. The content is presented in both written and video form. Nice touch.

    Arel with Wharel

    ActiveRecord, the ORM that ships with Rails, is an implementation of the ActiveRecord pattern. It’s elegant API is one of the things that makes getting started with Rails very convenient. Expressions like user.posts.where(published: true) are readable and expressive. When trying to write more complex queries it falls short. In those cases, I usually fall back to Arel, the relational algebra library that Rails uses under the hood. While technically, it’s considered by the Rails core team to be private API, it’s usually very stable. Unfortunately, Arel has a more verbose API. Wharel attempts to fix that. Like Squeel before it, it adds a bit of syntactic-sugar to make interacting with Arel more expressive. It accomplishes this with a minimum amount of code, making it more attractive to use. The author, Chris Salzberg, explains in his blog post the motivation and code behind the library. I look forward to using it.

    The impact of the ‘open’ workspace on human collaboration

    The findings presented in this paper are that open-office workspaces actually reduce the number of face-to-face interactions and increase the number of electronic interactions. The belief that this is not the case has always baffled me. In crowded spaces, like a big-city subway, stadium lines, or elevators, people tend to avoid eye contact, protect the little personal space that they have, and generally keep to themselves. It’s a defense mechanism. It’s not that people are unfriendly – it’s just that when you clearly don’t have any personal space, you don’t want to give up your mental space! Clearly, this applies to workspaces as well. If I am sitting with people typing in their keyboard all around me in close proximity, you bet I am going to have headphones on and keep my eyes pointing at my keyboard.

    Read on →