# Bullet

> Help to kill N+1 queries and unused eager loading

Source: https://talira.ai/catalog/bullet-1h5ge3bv
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [developer tools / performance / n plus one queries](https://talira.ai/categories/developer-tools/performance/n-plus-one-queries), [languages / ruby / rails](https://talira.ai/categories/languages/ruby/rails)
- Platforms: linux, macos, windows
- Licence: MIT
- Pricing: Free and open source
- Free tier: yes
- Self-hostable: yes
- Creator: Richard Huang (flyerhzm)

Bullet watches the queries a Rails app makes while you develop and tells you when to add eager loading (N+1 queries), when eager loading you added isn't used, and when a counter cache would save a COUNT query. It tracks the loading of associations in Active Record (4.0 and later) and Mongoid, and reports through the browser (alerts or the footer), the Rails log, its own log file, [Sentry](https://talira.ai/catalog/sentry-d969wppj.md), [Honeybadger](https://talira.ai/catalog/honeybadger-qpvyfksr.md), [Slack](https://talira.ai/catalog/slack-bp8cdfdq.md) and others. It can raise in tests, and you can allowlist known cases.

## Links

- GitHub: https://github.com/flyerhzm/bullet

## Problems it solves

- warn me in the browser when a Rails page has an N+1 query
- find eager loading I added that isn't actually used
- tell me when a counter cache would save a COUNT query on every row
- make the test suite fail when an N+1 query is introduced
- send N+1 warnings from staging to Sentry or Slack
- a Mongoid app is making one query per document in a loop
- my Rails app is slow and I suspect it's loading associations one by one
- list every place my app should add includes

## Features

- N+1 query detection
- unused eager loading detection
- counter cache suggestions
- Active Record and Mongoid
- browser alerts and footer
- Rails log and bullet.log
- notifiers for Sentry, Honeybadger, Slack and more
- raise in tests
- safelists

## Trust

Overall: 0.59 out of 1.
Signals: maintenance 0.75, adoption 0.77, momentum 0.47, community 0.93, backing 0.20, extensibility 0.00.

- last commit 28 days ago
- 23 commits in the last 90 days
- 7.3k GitHub stars
- 207 contributors
- created by Richard Huang (flyerhzm)

## Alternatives

- [Prosopite](https://talira.ai/catalog/prosopite-x9rmtzwr.md): Rails N+1 queries auto-detection with zero false positives / false negatives
- [Goldiloader](https://talira.ai/catalog/goldiloader-h53tw30y.md): Just the right amount of Rails eager loading
