Ruby, JavaScript
Hi, we're Arkency and it's our blog with meaty content.
How to write a good incident postmortem Sometimes, not everything goes smooth when introducing changes in your application. When it happens, you introduce hotfix as soon as possible, usually followed by the coldfix. Such situations are great to take a learning from.
Tracking down not resolving constants in Ruby with parser Lately, we have been working on upgrading an obsolete stack of one Ruby app. This application was running on Ruby 2.4. After dropping 50 unused gems, performing security updates, and eliminating deprecation warnings, we decided it was time for a Ruby upgrade. This is where the story REALLY begins, and I encourage you to keep reading even if you are not interested in the old Ruby version’s internals. In the end, I will give you a powerful tool to help you track down not resolving constants in your codebase.
Offloading write side with a read model Imagine the following business requirement: All the products should be reserved for a customer on order submission. Simply adding items to the cart does not guarantee product availability. However, the customer should not be able to add a product that is already unavailable.
First class json(b) handling in Rails Event Store Recently, in Rails Event Store v2.8.0 PreserveTypes transformation has been introduced. v2.9.0 release brought RailsEventStore::JSONClient. It’s a set of great improvements for RES users who plan to or already use PostgreSQL with jsonb data type for keeping events’ data and metadata.
Speed up aggregate roots loading with snapshot events Rails Event Store 2.7 is coming in a few days with a new experimental feature: AggregateRoot::SnapshotRepository.
Sometimes it’s worth to test your framework features Rails 6 introduced upsert_all which was a great alternative to raw SQL for inserting or updating multiple records at once. There were gems providing this feature for earlier versions of Rails like activerecord-import, it did a great job in Rails Event Store.
Handling third-party webhooks with Rails Event Store Lately, one of our clients asked us to review his Rails Event Store-based application. We helped him, as RES mentoring is one of the key fields of our professional activity. What caught our attention was the way of handling incoming webhooks from third-party services.
Take advantage of Turbo Streams in event handlers It’s been a time since Rails 7 came with Turbo and its Turbo Streams. At first, I was skeptical because the idea of broadcasting view updates as a sort of Active Record callbacks. Sorry, I’m simply not buying the idea of mixing WebSockets calls into a data model. However, rejecting the concept of Turbo::Broadcastable concern, I see Turbo Stream as a great tool, and I’m sure there is a proper place for it in the Rails app architecture.
Hi, we're Arkency and it's our blog with meaty content.
The final trick when moving from Rails CRUD to Event SourcingFrom CRUD to EventSourcing Did you ever wonder how to actually switch the model from the CRUD one to EventSourcing? There’s one thing you should consider. The initial event that has to be published for existing data. Also called the migration event.
Hi, we're Arkency and it's our blog with meaty content.
Hi, we're Arkency and it's our blog with meaty content.
Hi, we're Arkency and it's our blog with meaty content.
Hi, we're Arkency and it's our blog with meaty content.