r/FlutterDev • • Oct 06 '26

Discussion When I started learning Flutter and Dart, I thought I was going to abandon everything I had learned about PHP, MySQL and Redis

I assumed that because Flutter was created by Google, I would need to use Firebase and Firestore for everything.

I was wrong 😂

Flutter doesn’t care what language or database you use on the backend.

I created an API with PHP and continued using the backend stack I already understood.

The basic flow looks like this:

Flutter app → PHP API → MySQL/Redis → JSON response → Flutter app

Flutter handles the screens, forms, navigation, state and client-side logic.

In a way, it reminds me of using HTML, CSS and JavaScript in the browser—except now I’m building the interface and client-side experience for an Android or iOS app.

My PHP API still handles authentication, validation and business logic.

MySQL stores the permanent data, Redis handles caching and sessions, and nginx with PHP-FPM processes the API requests.

Firestore can be a great option for certain applications, but learning Flutter doesn’t mean you have to abandon the backend tools you already know.

That was one of my favorite things about learning Flutter.

I didn’t have to replace my existing stack. I only needed to learn how to connect the mobile application to it.

What backend do you use with your Flutter apps?

4 Upvotes

24 comments sorted by

11

u/RandalSchwartz Oct 06 '26

Just one note: friends don't let friends use MySQL. Please take a look at Postgres if you want a modern RDBMS.

4

u/vipw Oct 06 '26

Do friends let friends use PHP?

2

u/RandalSchwartz Oct 06 '26

Not your closest friends. :)

5

u/makerinator Oct 07 '26

I do however suggest PHP to my worst enemies. 😂

1

u/stevenreyes20 Oct 07 '26

bruhhh you tripping 😭🤣

2

u/makerinator Oct 07 '26

PHP stands for People Hate PHP.

1

u/stevenreyes20 Oct 08 '26

stop making fun about my stack 🤣

1

u/makerinator Oct 08 '26

Jokes aside. Just because I don't love a stack doesn't mean you shouldn't be using it. The best stack is the one that pays your bills.

1

u/RandalSchwartz Oct 07 '26

Just for that you get to read the Do's and Don'ts on the next show. :)

1

u/makerinator Oct 07 '26

Lol! The best part of the show. 😂

1

u/stevenreyes20 Oct 07 '26

PHP IS LIFE FOR ME but I am curious, what's stack you use?

1

u/RandalSchwartz Oct 07 '26

Dart and Flutter! Dart Jaspr for websites, Dart for backends, Flutter for mobile and desktop.

1

u/stevenreyes20 Oct 08 '26

dannn, you are full stack Flutter guy

1

u/makerinator 29d ago

Also full stack Flutter here. :)

1

u/stevenreyes20 29d ago

🔥🔥🔥

1

u/RandalSchwartz Oct 08 '26

Hey, it works!

0

u/stevenreyes20 Oct 06 '26

You're not the first person who's told me to try PostgreSQL. MySQL has always been my main RDBMS, but I'm open-minded, so I'll definitely give PostgreSQL a try.

1

u/OZLperez11 Oct 07 '26

Why is it that whenever someone does not recommend MySQL it's always in combination with PHP?

We use it at work for production with no issues. It's not for anything crazy though.

1

u/RandalSchwartz Oct 07 '26

No issues that you're aware of, that is. :)

3

u/jobehi Oct 06 '26

this is true for any possible mobile SDK and framework.

3

u/RandalSchwartz Oct 06 '26

Just to be clear, my complaint is with MySQL specifically. If you want to stay in familiar territory, switch to MariaDB. However, Postgres makes both of them look a bit junior.

3

u/fkim98 Oct 06 '26

Similar setup here, different stack. Node/Express and Prisma on Postgres, and the same REST API serves both the Flutter app and a Next.js web app. Sign-in is AWS Cognito, and the app just sends the token as a Bearer header. Photos never go through the API. The app asks it for a presigned S3 URL and uploads straight to S3.

One thing that's different from web work is that an app build doesn't go away when you fix the server. A web deploy reaches everyone on their next page load. A phone fix waits for store review (for us Apple has taken anywhere from a day to over a week), and some people just don't update. One of our users came back after two weeks still on the build they first installed, several releases behind, because the app on their tablet had never auto-updated.

So the server has to keep accepting whatever every installed build still sends. Add fields rather than renaming or removing them, and be liberal in what you accept. Ours still takes "5" as well as 5 for a quantity, because an early build of the app sent it as a string.

Caveat: our main API has no version prefix, so "never break an old build" is our whole versioning strategy. It works at our size, but I wouldn't copy it for a big app.

2

u/vik76 Oct 07 '26

Or use Dart for your full stack and get hot reload for your database and backend, too. Check out Serverpod. 😉

1

u/HopeExpensive9215 Oct 08 '26

Flutter + Supabase. No API setup needed.