# Database Singleton Helper class vs Package

**URL:** <https://forums.kodeco.com/t/database-singleton-helper-class-vs-package/184198>\
**Category:** Real-World Flutter by Tutorials\
**Created:** [February 20, 2023, 12:42am UTC](https://forums.kodeco.com/t/database-singleton-helper-class-vs-package/184198 "2023-02-20T00:42:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![shahil7685](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/shahil7685/32/105896_2.png) [@shahil7685](https://forums.kodeco.com/u/shahil7685)\
**Post date:** [February 20, 2023, 12:42am UTC](https://forums.kodeco.com/t/database-singleton-helper-class-vs-package/184198/1 "2023-02-20T00:42:10Z")

</div>

Hello,  
I have read 2 books.

1. Real World Flutter by Tutorials (uses Hive)
2. Flutter Apprentice (uses SQLite)

In Flutter Apprentice, the database part is managed using a Singleton Helper class whereas in Real World Flutter by Tutorials, we are using a package to initialize the database but the actual database operations are wide-spread into the other packages.

Was this decision taken considering the package based architecture used in Real World Flutter book?  
Or was there any other reason that I am missing?

Or one is a preferred approach based on the database type being used?

---

<div class="post-metadata">

**Author:** ![ebueno](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/ebueno/32/110264_2.png) [@ebueno](https://forums.kodeco.com/u/ebueno)\
**Post date:** [March 6, 2023, 4:17am UTC](https://forums.kodeco.com/t/database-singleton-helper-class-vs-package/184198/2 "2023-03-06T04:17:31Z")

</div>

Hi @shahil7685,  
It’s a mixture of taste and the architecture used in this book. Both are valid, although the approach used in Flutter Apprentice wouldn’t fit in this codebase’s architecture.

Thanks for the question.

---

<div class="post-metadata">

**Author:** ![kpere](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/kpere/32/109586_2.png) [@kpere](https://forums.kodeco.com/u/kpere)\
**Post date:** [July 28, 2023, 10:31pm UTC](https://forums.kodeco.com/t/database-singleton-helper-class-vs-package/184198/3 "2023-07-28T22:31:41Z")

</div>

Thank you for reaching out to us with your question. We hope that the response provided by @ebueno, was helpful in addressing your concerns.

If you have any further questions or need additional assistance, please don’t hesitate to ask. Our community is here to support you!
