···2233`hydrant` is an AT Protocol indexer built on the `fjall` database. it's meant to be a flexible indexer, supporting both full-network indexing and filtered indexing (e.g., by DID), also allowing querying with XRPCs and providing an ordered event stream with cursor support.
4455+## vs `tap`
66+77+while [`tap`](https://github.com/bluesky-social/indigo/tree/main/cmd/tap) is designed primarily as a firehose consumer and relay, `hydrant` is flexible, it allows you to directly query the database for records, and it also provides an ordered view of events, allowing the use of a cursor to fetch events from a specific point in time.
88+99+### stream behavior
1010+1111+the `WS /stream` (hydrant) and `WS /channel` (tap) endpoints have different designs:
1212+1313+| aspect | `tap` (`/channel`) | `hydrant` (`/stream`) |
1414+| :--- | :--- | :--- |
1515+| distribution | sharded work queue: events are load-balanced across connected clients. If 5 clients connect, each receives ~20% of events. | broadcast: every connected client receives a full copy of the event stream. If 5 clients connect, all 5 receive 100% of events. |
1616+| cursors | server-managed: clients ACK messages. The server tracks progress and redelivers unacked messages. | client-managed: client provides `?cursor=123`. The server streams from that point. |
1717+| backfill | integrated queue: backfill events are mixed into the live queue and prioritized by the server. | unified log: backfill simply inserts "historical" events (`live: false`) into the global event log. streaming is just reading this log sequentially. |
1818+| event types | `record`, `identity` (includes status) | `record`, `identity` (handle), `account` (status) |
1919+| persistence | **full**: all events are stored and replayable. | **hybrid**: `record` events are persisted/replayable. `identity`/`account` are ephemeral/live-only. |
2020+521## configuration
622723`hydrant` is configured via environment variables. all variables are prefixed with `HYDRANT_`.
···127143### stats
128144129145- `GET /stats`: get aggregate counts of repos, records, events, and errors.
130130-131131-## vs `tap`
132132-133133-while [`tap`](https://github.com/bluesky-social/indigo/tree/main/cmd/tap) is designed primarily as a firehose consumer and relay, `hydrant` is flexible, it allows you to directly query the database for records, and it also provides an ordered view of events, allowing the use of a cursor to fetch events from a specific point in time.
134134-135135-### stream behavior
136136-137137-the `WS /stream` (hydrant) and `WS /channel` (tap) endpoints have different designs:
138138-139139-| aspect | `tap` (`/channel`) | `hydrant` (`/stream`) |
140140-| :--- | :--- | :--- |
141141-| distribution | sharded work queue: events are load-balanced across connected clients. If 5 clients connect, each receives ~20% of events. | broadcast: every connected client receives a full copy of the event stream. If 5 clients connect, all 5 receive 100% of events. |
142142-| cursors | server-managed: clients ACK messages. The server tracks progress and redelivers unacked messages. | client-managed: client provides `?cursor=123`. The server streams from that point. |
143143-| backfill | integrated queue: backfill events are mixed into the live queue and prioritized by the server. | unified log: backfill simply inserts "historical" events (`live: false`) into the global event log. streaming is just reading this log sequentially. |
144144-| event types | `record`, `identity` (includes status) | `record`, `identity` (handle), `account` (status) |
145145-| persistence | **full**: all events are stored and replayable. | **hybrid**: `record` events are persisted/replayable. `identity`/`account` are ephemeral/live-only. |