Gnarly Learnings from March
Tags: ruby, rails, database, leadership
Published: 2021-04-02 19:27:52

We love reading, watching, and listening to constantly update our skills and learn new perspectives. Here are some of the exciting pieces we learned from this month.

## [Hotwire, ViewComponents and TailwindCSS: The Ultimate Rails Stack](https://blog.cloud66.com/hotwire-viewcomponents-and-tailwindcss-the-ultimate-rails-stack/)

If you're concerned about ensuring consistency in Tailwind stylings across elements in your site, and you have some logic to encapsulate the rendering of those elements, ViewComponents may be the right solution for you. Sprinkle in some Stimulus and Hotwire for interactivity!

## [The documentation system](https://documentation.divio.com/)

Having supporting documentation can elevate the usability and understanding of any offering - but how do you know you've written **good** documentation? This site proposes that there are four distinct elements that go into sufficient documentation:

- Tutorials
- How-to guides
- Technical reference
- Explanation

Read through the source to learn about the differences and application of each artifact.

## [Redis rate limiter](https://blog.rebased.pl/2021/02/22/redis-rate-limiter.html)

Redis is sometimes only considered as the backing store for job queues - particularly in Ruby with [Sidekiq](https://github.com/mperham/sidekiq). However, Redis is a general-purpose in-memory store, and can be used for many things. This article explores one such additional use for Redis.

As a bonus, Rails developers should take a look at [kredis](https://github.com/rails/kredis), an abstraction for accessing Redis now available under the Rails organization.

## [PostgreSQL rocks, except when it blocks: Understanding locks](https://www.citusdata.com/blog/2018/02/15/when-postgresql-blocks/)

Row or table locking is not something that, thankfully, we need to consider often. However, it is important to be aware of what operations will lock sections of the database for use, what the impact will be - and how you can leverage that affect in your application.

## [Preemptive Pluralization is (Probably) Not Evil](https://www.swyx.io/preemptive-pluralization/)

Contributing code that meets the current needs is tables takes - and we don't want to over-engineer solutions. However, considering potential future states as well as identifying the possible difficulty in getting there that can be avoided by a choice today is an important part of the job to build maintainable, scalable systems.

## [Add encryption to Active Record](https://github.com/rails/rails/pull/41659)

HEY added encryption at rest to attributes in their database, and that is now being abstracted into Rails. While there are a number of gems or options to do this today, it'll be interesting to see this as part of the framework already. I particularly appreciated the [forethought](https://github.com/rails/rails/pull/41659#issuecomment-797054659) to consider rotation of encryption ciphers with the inclusion of a `previous` attribute.

## [Rails 6.1 adds nulls_first and nulls_last methods to Arel for PostgreSQL](https://bigbinary.com/blog/rails-6-1-adds-nulls-first-and-nulls-last-to-arel)

Before reading this, I didn't know that Postgres had the ability to control whether null attributes appear first or last in an [order by](https://www.postgresql.org/docs/current/queries-order.html) statement. Turns out, it's been around for a long time, and now it's in Arel too in Rails 6.1!

## [Helping engineering teams adapt to a new normal](https://leaddev.com/managing-distributed-teams/helping-engineering-teams-adapt-new-normal)

On this (unceremonious) year anniversary of when many US firms went fully-remote (not by choice), take stock in the initiatives you tried. Consider what you might try in the future to make things more comfortable and productive for yourself and your team in these unprecedented times.

## [curl is 23 years old today](https://daniel.haxx.se/blog/2021/03/20/curl-is-23-years-old-today/)

Happy Birthday curl! This documents the journey along the way.

## [What Stevie Ray Vaughan Can Teach Us About Security Design](https://www.techdirt.com/articles/20210209/09141046216/what-stevie-ray-vaughan-can-teach-us-about-security-design.shtml)

My favorite [quote](https://twitter.com/srvofficial/status/836589348489424896) from the late blues guitarist is:

> I use heavy strings, tune low, play hard, and floor it. Floor it. That's technical talk.

After reading this story, consider the impact on another kind of technical talk: shared access to the same resource, and shared keys to different resources.

## Contributors

- [Kevin Murphy](https://github.com/kevin-j-m)

_Learn more about how The Gnar [builds software](https://www.thegnar.com/software-development)._