r/FlutterDev • u/theunknownguy__ • Aug 04 '26
Discussion Drift vs SQLite for a long-term Flutter app? Looking for advice from people who've maintained apps.
I'm currently deciding between DriftDB and SQLite for a Flutter app. It's a long-term project, and I don't mind spending time learning the right tool if it's worth it.
My concern isn't the learning curve. It's the ecosystem and debugging experience. With SQLite, I feel confident that if I get stuck, there are plenty of Stack Overflow posts, Reddit discussions, blog posts, and videos to help. With Drift, I get the impression there are fewer community resources, so I'm worried that if I run into issues with things like code generation, migrations, or build_runner, I might spend more time trying to figure things out.
I'd love to hear from people who have actually used Drift in a real project.
- Would you still choose Drift today?
- Have you ever regretted choosing it?
- Has the smaller ecosystem or documentation ever slowed you down?
- Looking back, was choosing Drift worth it over using SQLite?
Thanks!
Edit: I meant Drift ORM
20
u/raman4183 Aug 04 '26
What do you mean?
Drift is SQLite under the hood by default. There are adapters for it to be working with other databases like postgres and etc.
Do you mean Drift ORM vs Raw SQLite?
Then use whatever you are comfortable with.
4
u/sauloandrioli Aug 04 '26
"I'm currently deciding between DriftDB and SQLite"
Are you really? Because Drift is just an ORM for Sqlite.
6
u/rabinapps Aug 04 '26
Drift is great
6
u/DomiO6 Aug 04 '26
either you write your own orm or you just use drift, if you need to build your own drift, rethink
6
u/Spare_Warning7752 Aug 04 '26
I use it for some years now.
Consider this: I'm a programmer since 1986. I've seen some shit.
Drift, in my opinion, is the best ORM amongst ALL ORMs I've seen in my entire life, for a lot of reasons, but I can pinpoint to 3:
It will generate a Dart method:
You don't need to remember ORM shit. You just call the method. (The ORM shit part is still there, if you prefer it).
Source: https://drift.simonbinder.eu/sql_api/drift_files/
Source: https://drift.simonbinder.eu/dart_api/daos/
Drift is a must (same as SQLite for data).
2
u/RaBbEx Aug 04 '26
Our whole Agency uses drift in flutter apps, no complaints
2
u/Bachihani Aug 04 '26
With sqlite u are executing string queries directly.
Drifs gives u type safety , schema definition and migration utils ..etc.
2
u/DigiProductive Aug 04 '26
Drift is amazing and I wouldn’t choose anything else. It’s an important layer over SQLite so it’s consistent and reliable. Also, because it uses Streams very well which means you can literally use it as a persistent state manager which your UI can depend on for updates. This makes offline app features a walk in the park! Very clean and easy to setup the fundamentals. It’s a go to for me. Since I write a lot of SQL as well, I tend to use it for Data Access Object queries. Super nice!👌
2
u/Ok_Leather7354 Aug 08 '26
Consider these params.. 1. size of data to store, 2. watch and render realtime, 3. app size
a. depends on if you want what drift provides by default watching over sqlite tables while inserts, updates, deletes auto trigger rebuilds of widgets
b. if that's not required.. simple sqflite should do the job..
You can check up more whatever I said with chatgpt something for detailed info..
1
u/Ottiro2000 Aug 04 '26
No experience with Drift, but with SQLite and Objectbox (you might wanna consider this one) in Flutter Apps. Had no issue at all with generating code with AI for both.
- When you want to maintain and understand also manually, objectbox is closer to Flutter since you define objects instead of tables. When you already know SQL it‘s no issue, but still, I would prefer objectbox over SQLite because it has less boilerplate in my opinion.
- When performance is important take objectbox. SQLite comes not even close to it
- When portability is important you should take SQLite since it‘s a SQLDatabase, so migration and portability to other SQL Databases is way easier. Objectbox is worse in this case.
F.e. why do you use Flutter? I guess because you want to have an android and iOS App. If not, take native code, even if you only know flutter yet, you can easily learn the native part. If it is for multiplatform, think about your project from now on in maybe 5 years. Is there any chance to change to migrate to native code? If yes, you should go with SQLite.
But this is just my opinion
1
u/tired-person-2002 Aug 04 '26
Drift is great and truly works well for for platform based apps. It can be annoying to set up the first time but afterwards its solid. I have had success with it on all platforms. However if you plan on making a web app using flutter, there is still some compatibility issues.
If your app is gonna be platform based drift is solid, if its a web app might be worth looking elsewhere
1
u/makridistaker Aug 05 '26
Pure sqlite cannot run in the background and instead it blocks ui thread. This is an issue in big transactions and drift solves that.
1
u/PositiveMaterial5297 Aug 07 '26
In the AI era, just use SQLite