Rails 6.1 stable version released: support for horizontal partitioning, improved multi-database support, Strict Loading

The stable version of Rails 6.1 has been released. The development team said that in the past few months they have implemented improvements to multi-database support, support for destroying Association Async processes in the background, and converting errors into objects.

Switch by database connection

Rails 6.1 provides the function of switching connections by database . In 6.0, if you switch to the read role, all database connections will also switch to the read role. But in 6.1, if legacy_connection_handlingset to in the configuration false, Rails supports connected_toswitching the connection of a single database by calling the corresponding abstract class .

Horizontal partition

Rails 6.0 provides the ability to partition the database (multiple partitions, different schema modes), but it cannot support horizontal partitioning (same schema mode, multiple partitions). Rails does not support horizontal partitioning because the model in Active Record can only have one connection per role per class. Now that this problem has been solved, Rails' horizontal partitioning function is available.

Destroy Associations Async

This change adds the ability to destroy the associated asynchronous process in the background job for the application, which is helpful to avoid application timeouts and other performance problems when destroying data.

Error Objects

Active Model errors are now objects with interfaces, which allow applications to more easily handle and interact with errors thrown by the Model. This feature includes a query interface for more precise testing and access to error details.

View more content announcement .

Guess you like

Origin www.oschina.net/news/123126/rails-6-1-0-released