# Difference between repositories and relations

**URL:** <https://discourse.rom-rb.org/t/difference-between-repositories-and-relations/317>\
**Category:** Usage Stories\
**Created:** [May 10, 2019, 11:09pm UTC](https://discourse.rom-rb.org/t/difference-between-repositories-and-relations/317 "2019-05-10T23:09:23Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![solnic](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.rom-rb.org/solnic/32/279_2.png) [@solnic](https://discourse.rom-rb.org/u/solnic)\
**Post date:** [June 3, 2019, 12:50pm UTC](https://discourse.rom-rb.org/t/difference-between-repositories-and-relations/317/8 "2019-06-03T12:50:41Z")

</div>

> [@ianks](#):
>
> a repo is tied to a relation inherently `ROM::Repository[:users]`

I can see some confusion here. No repo is not tied to any relation. The reason why “root repositories” were introduced is because it’s very, very common, to use a single relation as “the starting point” from which you get the data. That’s why it was beneficial to create a simple abstraction for such use case.

**Repositories have access to all relations**. The fact you typically use a single one as your “root” in aggregates is the reason why we have root repos. This allows you to do things like use `root` method in abstract way to add additional functionality (like “default scope” etc.).

I will try to explain this better in the docs. Thanks for feedback ❤

---

_[View the full topic](https://discourse.rom-rb.org/t/difference-between-repositories-and-relations/317)._
