AppSignal Blog
blog.appsignal.com · Company blog · on HN since 2013
AppSignal's company blog publishes tutorials on Elixir, Ruby on Rails, and JavaScript, with a focus on monitoring and performance.
What HN saysHN links it for Elixir, Ruby, and Rails articles, such as using Gleam from Elixir and upcoming Rails 7.2 database features.
84HN people shared it
24linked it in comments
480stories submitted
3.8Kstory points
3 months agolast shared
2013people per year2026
Most-shared posts
- 1Enhancing Your Elixir Codebase with Gleam4 people · 70 points · first shared 2024 · 19 comments on HN
- 2Ride down into JavaScript dependency hell3 people · 136 points · first shared 2020 · 143 comments on HN
- 3An Introduction to Deno: Is It Better Than Node.js?3 people · 89 points · first shared 2022 · 54 comments on HN
- 4Using Supervisors to Organize Your Elixir Application3 people · 7 points · first shared 2021 · discussion on HN
- 5Mastering Concurrency in Ruby3 people · 6 points · first shared 2016 · discussion on HN
- 6Introduction to Ruby on Rails Patterns and Anti-Patterns3 people · 5 points · first shared 2020 · discussion on HN
- 7How to Track Down Memory Leaks in Ruby3 people · 5 points · first shared 2022 · discussion on HN
- 8Building a Multi-Tenant Ruby on Rails App with Subdomains3 people · 4 points · first shared 2020 · discussion on HN
- 9Livebook for Elixir: Just What the Docs Ordered3 people · 4 points · first shared 2022 · discussion on HN
- 10Russian doll caching in Rails (2018)3 people · 1 points · first shared 2023 · discussion on HN
- 11Ruby magic closures in ruby blocks procs and lambdas3 people · first shared 2020
- 12Elixir alchemy hot code reloading in elixir3 people · first shared 2020
- 13Three Ways to Debug Code in Elixir2 people · 140 points · first shared 2021 · 27 comments on HN
- 14An Introduction to Ractors in Ruby2 people · 96 points · first shared 2022 · 16 comments on HN
- 15Rails Concerns: To Concern or Not to Concern2 people · 76 points · first shared 2020 · 49 comments on HN
What HN people wrote when they linked it
krstf13 · 2023-08-07
Not to be rude.
The live playground probably can’t run elixir/erlang code. And it most certainly cannot connect to a remote running node instance.
It’s unfortunate, that the angle here is documentation since, while Livebooks are great for testing and documentation ( https://blog.appsignal.com/2022/05/24/livebook-for-elixir-just-what-th… ), they also provide a great environment for experimenting with elixir code.
I’m sure docausorus is great, I’m not sure why you would think Livebooks would be a competitor in the same space.
As to you asking for in production links, I’d encourage you to install it and test it for yourself.
fearthetelomere · 2022-12-14
Regarding #1, I've found that Phoenix + LiveView has been helpful for these cases. They have great form validation tools using Changesets and the `phx-change` attribute [1]. You can redact certain fields [2], and even treat certain fields like virtual fields (like password not being stored vs the password hash being stored) [3].
Of course, the (potential) drawback is in using Elixir for both front-end and back-end which may be a tough sell to a client or employer.
-----
[1]: https://blog.appsignal.com/2021/09/28/real-time-form-validations-with-…
[2]: https://hexdocs.pm/ecto/Ecto.Schema.html#module-redacting-fields
[3]: https://elixircasts.io/ecto-virtual-attributes
andatki · 2024-11-09
Nice post covering many of the main ways to improve efficiency.
Here’s a related post I wrote for AppSignal:
What's Coming in Ruby on Rails 7.2: Database Features in Active Record https://blog.appsignal.com/2024/07/24/whats-coming-in-ruby-on-rails-7-…
For folks interested in additional depth on optimizing Postgres for use with Active Record/Rails, please check out my book:
High Performance PostgreSQL for Rails https://andyatkinson.com/pgrailsbook
Thanks!
dqv · 2024-08-31
You can use Gleam from Elixir. I wanted to use lpil's jot library and it was pretty seamless.
https://blog.appsignal.com/2024/07/23/enhancing-your-elixir-codebase-w…
e12e · 2023-12-26
As I said, claiming that ruby doesn't have first-class functions isn't "meaningfully true". Ruby does not have functions, only methods. But that's mostly irrelevant.
https://en.m.wikipedia.org/wiki/First-class_function#Language_support
> The identifier of a regular "function" in Ruby (which is really a method) cannot be used as a value or passed. It must first be retrieved into a Method or Proc object to be used as first-class data. The syntax for calling such a function object differs from calling regular methods.
https://blog.appsignal.com/2018/09/04/ruby-magic-closures-in-ruby-bloc…
> Ruby doesn’t have first-class functions, but it does have closures in the form of blocks, procs and lambdas. Blocks are used for passing blocks of code to methods, and procs and lambda’s allow storing blocks of code in variables.
nelsonic · 2023-09-13
Erlang/OTP (and therefore all BEAM Languages such as Elixir) have a supervision tree which means that each module in a monolithic application can be run independently in as many processors/machines as required. Essentially you get Kubernetes + Docker for free (virtually zero overhead) inside the Erlang VM. See: https://blog.appsignal.com/2021/08/23/using-supervisors-to-organize-yo…
loloquwowndueo · 2023-06-06
https://htmx.org/ Says otherwise, so does https://blog.appsignal.com/2022/07/06/get-started-with-hotwire-in-your…
freedomben · 2023-06-06
This is part 2. If you're not familiar with graphql yet, part 1 is an introduction to absinthe/graphql: https://blog.appsignal.com/2023/05/16/an-introduction-to-absinthe-for-…
berkes · 2023-05-14
I've read that and tried it. I hate it.
This recent article has some alternatives https://blog.appsignal.com/2023/05/10/organize-business-logic-in-your-…
Their main argument against the first piece is:
> One problem with fat models is that unless you are really disciplined in your code hygiene, they can tend towards an assortment of code smells
And I wholeheartedly agree. With the addition that "code hygiene" if not enforced or encouraged, is always one of the first victims under stress. And every (successful) project will see such stress.
With Rails you have to spend extra effort to keep doing "the right thing", whereas is should cost cost less effort to do that, and extra effort to "do the bad thing".
RedShift1 · 2023-03-09
They are using the cluster module right? https://blog.appsignal.com/2021/02/03/improving-node-application-perfo…
jaredcwhite · 2023-02-08
That sounds like the Citadel pattern…not microservices in the truest sense of the word.
https://blog.appsignal.com/2020/04/08/the-citadel-architecture-at-apps…
empthought · 2023-01-05
Ruby does not have first-class functions. Why do you insist on sounding so sure about something you are so wrong about?
https://blog.appsignal.com/2018/09/04/ruby-magic-closures-in-ruby-bloc…
kawsper · 2023-01-02
It's out of fashion today, but N+1 queries are also useful (and preferred) if you're doing russian doll caching which were popular at Basecamp.
It lets you only query and cache the resources that have changed, not the whole dataset: https://blog.appsignal.com/2018/04/03/russian-doll-caching-in-rails.ht…
rubyfan · 2022-12-09
It goes without saying that there are a lot of things one would do prior to some of these steps. Because of the complexity these sort of configuration bring into your app one should weigh carefully whether they need these approaches. Database tuning and caching are preferable first steps in an app faced with performance challenges before fancy database routing. As with caching the app awareness of these approaches leaks into your code and can introduce testing challenges and misses in your process.
Maybe I missed it but I’m surprised they didn’t mention Multi-Tenancy with Multi-Database since they have otherwise written about it*. For many apps this is not only a way to keep data isolated but is also a way to mitigate performance challenges that might come with a single large DB.
https://blog.appsignal.com/2020/12/02/building-a-multi-tenant-ruby-on-…
labarilem · 2022-10-24
Off the top of my head:
- Understand the event loop to avoid blocking
- Understand the JIT compiler to write compiler optimization-friendly code
- With Typescript: speed up build and dev times using the SWC compiler, understand which types take more compilation time
- Minimize heap allocations to avoid memory leaks: https://blog.appsignal.com/2022/09/28/minimize-heap-allocations-in-nod…
- Write native modules when you need CPU intensive operations (the official doc is quite good: https://nodejs.org/api/addons.html)
- Take care of node_modules (e.g. https://mainmatter.com/blog/2022/09/29/pnpm/)
- With Docker: optimize docker image to only include what you need. E.g. use Alpine if you don't have any particular external dependencies
metadat · 2022-07-29
Does is also play nice with Python, Go, or Rust? Never heard of import maps until now, not immediately clear what they obviate.
https://blog.appsignal.com/2022/03/02/import-maps-under-the-hood-in-ra…
brigandish · 2022-03-30
My problem with Sorbet is how ugly it looks. It's probably not possible to do with Ruby (now) but Crystal does it better[1] while (mostly) retaining the syntax of Ruby. I suppose it's trying for Elixir's @spec, which I like less than Crystal's sigs but still prefer over this.
Still, if it helps it helps.
[1] https://crystal-lang.org/reference/1.3/tutorials/basics/60_methods.htm…
Edit: Perhaps I spoke too soon https://blog.appsignal.com/2021/01/27/rbs-the-new-ruby-3-typing-langua…
mstipetic · 2021-02-19
I'm gonna assume you're talking about versions of application code. Obviously it's not a trivial problem and you have to keep it in mind while architecting your application, but Hot Code reloading is a well supported thing [1]
https://blog.appsignal.com/2018/10/16/elixir-alchemy-hot-code-reloadin…
albatross13 · 2020-09-17
I believe so.
I think this is what he was referring to: https://blog.appsignal.com/2018/10/16/elixir-alchemy-hot-code-reloadin…
nicoburns · 2020-07-06
The Rust closure syntax come from Ruby:
https://blog.appsignal.com/2018/09/04/ruby-magic-closures-in-ruby-bloc…
ronjouch · 2020-05-14
Interesting but not surprising; I'm being regularly pleasantly surprised by the Erlang/Elixir ecosystem :) . Can you precise what you're talking about when you say "Erlang/Elixir have built-in caches" ?
What's the name of the concept and where in the typical stack does it fit? Is this https://blog.appsignal.com/2019/11/12/caching-with-elixir-and-ets.html or something else? Care to share a few link to docs/articles? Thanks.
thomasfortes · 2020-04-23
Not touching on the reasons why the type system and hot code reloading are complex in the BEAM, but the hot code reloading dev workflows in other languages and the BEAM one are two completely different beasts.
Erlang/OTP was designed for systems where the amount of acceptable downtime is 0, you don't want phone calls failing because you have to fix a bug, the solution is a system where you can replace parts of it running live, if you replace a module all processes currently running it will still work normally but any new call to the module will use the updated version of it.
https://blog.appsignal.com/2018/10/16/elixir-alchemy-hot-code-reloadin…
unscaled · 2025-05-08
Inheritance is not the only way to share behavior across different implementations — it'a just the only way available in the traditional 1990s crop of static OOP languages like C++, Java and C#.
There are many other ways to share an implementation of a common feature:
1. Another comment already mentioned default method implementations in an interface (or a trait, since the example was in Rust). This technique is even available in Java (since Java 8), so it's as mainstream as it gets.
The main disadvantage is that you can have just one default implementation for the stop() method. With inheritance you could use hierarchies to create multiple shared implementations and choose which one your object should adopt by inheriting from it. You also cannot associate any member fields with the implementation. On the bright side, this technique still avoids all the issues with hierarchies and single and multiple inheritance.
2. Another technique is implementation delegation. This is basically just like using composition and manually forwarding all methods to the embedded implementer object, but the language has syntax sugar that does that for you. Kotlin is probably the most well-known language that supports this feature[1]. Object Pascal (at least in Delphi and Free Pascal) supports this feature as well[2].
This method is slightly more verbose than inheritance (you need to define a member and initialize it). But unlike inheritance, it doesn't requires forwarding the class's…
dustedcodes · 2023-02-23
> We spend our money wisely. The cost of cloud is grotesque in several key instances. Whether it's big-iron databases, large NVMe storage, or just the latest, fastest compute, we're paying as much to rent the donkey every few months as it would cost to buy it. When that's the case, you should own the donkey! We will spend our money on our own hardware and our own people. Everything else will get the squeeze.
Yet he continues to use Ruby for everything and finds the most asinine justifications and complicated workarounds like Russian doll caching (https://blog.appsignal.com/2018/04/03/russian-doll-caching-in-rails.ht… https://signalvnoise.com/posts/3690-the-performance-impact-of-russian-… to make a simple page/app performant.
At the end of the day DHH is a person who values his own opinion more than anything else and he will go to lengths to confirm his own bias and justify his ways by whatever argumentation he can scramble together to look less foolish.