# Dry-system: auto import with component identifiers

**URL:** <https://discourse.dry-rb.org/t/dry-system-auto-import-with-component-identifiers/1252>\
**Category:** dry-system\
**Created:** [April 23, 2021, 6:15pm UTC](https://discourse.dry-rb.org/t/dry-system-auto-import-with-component-identifiers/1252 "2021-04-23T18:15:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![wuarmin](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.dry-rb.org/wuarmin/32/641_2.png) [@wuarmin](https://discourse.dry-rb.org/u/wuarmin)\
**Post date:** [April 23, 2021, 6:15pm UTC](https://discourse.dry-rb.org/t/dry-system-auto-import-with-component-identifiers/1252/1 "2021-04-23T18:15:35Z")

</div>

Hey,  
I’m studying the guides of dry-system and I am very excited about the progress regarding Hanami 2.0. Thank you for this.

I have a question about the component identifiers section ([dry-rb - dry-system master - Auto-Import](https://dry-rb.org/gems/dry-system/master/auto-import/#component-identifiers)) regarding the persistence boot example, where the persistence dep is started for every repo. Does that mean the db connects on every repo instantiation? If yes, is it possible to boot the persistence dep just once, using this auto import feature?

Thanks

---

<div class="post-metadata">

**Author:** ![solnic](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.dry-rb.org/solnic/32/779_2.png) [@solnic](https://discourse.dry-rb.org/u/solnic)\
**Post date:** [April 26, 2021, 4:39am UTC](https://discourse.dry-rb.org/t/dry-system-auto-import-with-component-identifiers/1252/2 "2021-04-26T04:39:50Z")

</div>

Bootable components are started only once, because everything that happens within each lifecycle blocks is executed just once. Lazy-loading is based on the identifier, which can include anything that’s nested under it. For example, if you have `db.connection` and you have `include Deps['db.connection']` then `db` will be started automatically and it’s assumed that this should result in `db.connection` becoming available.

---

<div class="post-metadata">

**Author:** ![wuarmin](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.dry-rb.org/wuarmin/32/641_2.png) [@wuarmin](https://discourse.dry-rb.org/u/wuarmin)\
**Post date:** [April 26, 2021, 8:55am UTC](https://discourse.dry-rb.org/t/dry-system-auto-import-with-component-identifiers/1252/3 "2021-04-26T08:55:52Z")

</div>

@solnic Many thanks for your answer. This is crystal-clear!

I’ve figured it out myself with the help of this clear code ([dry-system/container.rb at d01c78cf68c05a1ab71356b739f9a35bae52e6a1 · dry-rb/dry-system · GitHub](https://github.com/dry-rb/dry-system/blob/d01c78cf68c05a1ab71356b739f9a35bae52e6a1/lib/dry/system/container.rb#L580)). But you got ahead of me 😉

---

<div class="post-metadata">

**Author:** ![solnic](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.dry-rb.org/solnic/32/779_2.png) [@solnic](https://discourse.dry-rb.org/u/solnic)\
**Post date:** [April 27, 2021, 4:33am UTC](https://discourse.dry-rb.org/t/dry-system-auto-import-with-component-identifiers/1252/4 "2021-04-27T04:33:43Z")

</div>

@wuarmin ah fantastic 🙂 Tim has been making the code oh-so-much-better recently!
