Ruby, JavaScript
Hi, we're Arkency and it's our blog with meaty content.
What surprised us in Postgres-schema multitenancy You can implement multitenancy in various ways. In one of our projects we went for schema-based multitenancy, where each tenant has its own PostgreSQL schema - i.e. its own namespaced set of tables. This approach has many pros and cons, but we found it viable in certain situations. Apartment is a popular gem assisting with that (currently not actively maintained though).
Hi, we're Arkency and it's our blog with meaty content.
Hi, we're Arkency and it's our blog with meaty content.
Sooner or later your Rails application will require an upgrade of the framework itself. There are many reasons behind that. Bugs, incompatibility with modern libraries, or the worst: the version you use will no longer receive security updates. Living on the edge might be tempting, but it can also end badly for the business which relies on the application. User data leak, frauds, this all can simply lead to serious legal and financial issues.
I went for a run today and I was catching up with some podcast episodes today and I would like to share my comments to the great episode about sagas & process managers published by Mariusz Gil in the Better Software Design. Mariusz has been talking with Kuba Pilimon. This was the third episode when these devs have discussed how to design software using Domain Driven Design techniques & design patterns. (The podcast is in Polish but some episodes - like the inverview with Alberto Brandolini are recorded in English). I've listened to this podcast and the overall discussion is very interesting but I have some remarks:
Rails 6 released in August 2019 has brought us several new features. One of the notable changes is support for multiple databases. To make the story short, to use multiple databases you need to: define multiple database configurations in config/database.yml file (for each environment) define a new abstract class that uses connects_to to set the target databases define a separate folder for other database migration files (don't forget to set it in the database config) define new models that inherit from new abstract class - all of them will be read & written to the database defined in the base class All details have been described in Rails guides and I've already read several blog posts describing how to do it. But how to use this feature to allow Rails Event Store data to be stored in a separate database?
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.
The Rails Event Store comes with a bounded_context gem (and a generator) that simplifies making your application modular. Using the command: bash rails generate bounded_context:bounded_context YOUR-BOUNDED-CONTEXT-NAME you can quickly generate folder structure, add load path and start working on implementing your business logic without friction.
Hi, we're Arkency and it's our blog with meaty content.
Recently I've posted a tweet: We are updating @RailsEventStore in our workshop reference app (and a base for exercises for Domain-Driven Rails book). Who knows what's coming next :) You could purchase the book & get access here https://t.co/cKiPFfMio0 pic.twitter.com/o60o8CyoMC— Arkency (@arkency) April 14, 2020 Since then we have published 2 more Rails Event Store versions. And we have finally reached a 1.0.0 milestone! The process of the upgrade between versions is always described in release notes, but here I've decided to summarise all changes required and to emphasize the most important ones.
Hi, we're Arkency and it's our blog with meaty content.