strong_migrations
bullet
Our great sponsors
strong_migrations | bullet | |
---|---|---|
16 | 27 | |
3,808 | 6,976 | |
- | - | |
8.1 | 7.7 | |
17 days ago | 2 months ago | |
Ruby | Ruby | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
strong_migrations
-
Must-have gems for mature Rails
gem "strong_migrations" - https://github.com/ankane/strong_migrations | Helps devs write non-blocking migrations, a must-have.
-
How does Rails handle out of order migrations (when working on different local branches)
There’s no real way to test, but you can use gems like https://github.com/ankane/strong_migrations and not allow to merge branches unless they are up-to-date with main.
-
When Postgres blocks: tips for dealing with locks
Half of the problems in this article are migration related.
I am extremely grateful that some people have created awesome libraries like strong migrations https://github.com/ankane/strong_migrations. Even if you are not using rails, bookmark its readme, it is an awesome cheat-sheet when writing a migration.
- Best practices as code using RuboCop
-
Why I Enjoy PostgreSQL – Infrastructure Engineer's Perspective
I would suggest taking a look at strong migrations[1]. It's a rails project, but the readme does a great job explaining what it checks for and what safe alternative to use instead. I still link to their explanations in PRs for non-rails projects.
-
Database... or Goose?
Nice one! Personally, I've been using https://github.com/ankane/strong_migrations to cover this case.
-
Ten Ruby gems for Rails you should definitely know about
StrongMigrations
-
Elixir and Phoenix after two years
> Ecto prevents N+1 queries by default, which I think is clearly better.
To be fair...
If you want to protect yourself from these with Rails you can install Bullet[0] and get protection through in your face notifications, and you have the option to let it slide because you're taking advantage of caching with Rails and in this case you know what you're getting into and the N+1 query with caching ends up being better because you understand your domain.
Rails also has the strong migrations[1] gem which is a huge help for not shooting yourself in the foot for running migrations in production by helping you avoid table locks and other issues / errors. But AFAIK there's no Ecto equivalent, but strong migrations is really really useful.
Rails also has the data-migrate gem which is a nice little abstraction for splitting out your schema changes and backfilling data in an automated way. There's nothing like with Ecto. This one isn't as useful as strong migrations IMO but it's still very handy to have this problem taken care of for you without having to re-invent a new strategy in every project or copy code over.
Basically all 3 of these things are something I'd use in every project in Rails but with Phoenix I wouldn't have these things except for N+1 query protection.
[0]: https://github.com/flyerhzm/bullet
bullet
- What was the name of the gem that finds all unindexed foreign keys?
-
Ban 1+N in Django
Rails has Bullet[0] to help identify and warn you against N+1
Does Django have anything active? Quick search revealed nplusone[1] but its been dead since 2018.
-
Inherited rails app - what the hell are all these rack timeout lines in the log?
Without seeing more of the app, it's tough to say for certain, but one gem you might find helpful is the [bullet](https://github.com/flyerhzm/bullet) gem -- set this up in the app then start browsing around the app in development. If you have any N+1 queries or other minor optimizations that could be done it will inform you about them.
-
A Guide to Memoization in Ruby
Getting rid of N+1 queries - This can help improve the speed of an app. The Bullet or Prosopite gems can give a lending hand here. The N+1 Dilemma — Bullet or Prosopite? entails a brief comparison of both.
-
Understanding N and 1 queries problem
There's a Ruby gem called Bullet that identifies and warns developers about N+1 problems. You can also have it fail tests if detected.
I don't know if the approach is possible with every ORM or if it's just leveraging some Ruby perks, but I can't think of a good reason why you wouldn't use the equivalent everywhere.
-
How do you find the cause of slowness in your app?
This is good advice, it'll likely pick out some glaring issues right away. I would generally recommend looking at DB queries here too and recommend Bullet, but most software like DataDog, AppSignal etc will often also point N+1 and issues like it out.
- What are the main suspects in a really slow Rails app?
-
Best way to learn query optimization?
You could add the bullet gem to your project. It can notify you (in a variety of ways) if your queries can be optimised.
-
My project: railstart app
bullet
-
Prosopite gem a year after its release hits 785 stars! Thanks!
I first posted prosopite in this subreddit a year ago as an alternative to bullet.
What are some alternatives?
prosopite - :mag: Rails N+1 queries auto-detection with zero false positives / false negatives
rack-mini-profiler - Profiler for your development and production Ruby rack apps.
Peek - Take a peek into your Rails applications.
safe-pg-migrations - Make your PostgreSQL migrations safe
Derailed Benchmarks - Go faster, off the Rails - Benchmarks for your whole Rails app
benchmark-ips - Provides iteration per second benchmarking for Ruby
ruby-prof - A ruby profiler. See https://ruby-prof.github.io for more information.
Timeasure - Transparent method-level wrapper for profiling purposes in Ruby
rubocop - A Ruby static code analyzer and formatter, based on the community Ruby style guide.
MemoryProfiler - memory_profiler for ruby
perftools.rb - gperftools for ruby code
Rbkit - A new profiler for Ruby. With a GUI