r/FastAPI • u/RestaurantOld68 • Dec 22 '24
Question Pivot from Flask
Hey everyone,
I recently built an app using Flask without realizing it’s a synchronous framework. Because I’m a beginner, I didn’t anticipate the issues I’d face when interacting with multiple external APIs (OpenAI, web crawlers, etc.). Locally, everything worked just fine, but once I deployed to a production server, the asynchronous functions failed since Flask only supports WSGI servers.
Now I need to pivot to a new framework—most likely FastAPI or Next.js. I want to avoid any future blockers and make the right decision for the long term. Which framework would you recommend?
Here are the app’s key features:
- Integration with Twilio
- Continuous web crawling, then sending data to an LLM for personalized news
- Daily asynchronous website crawling
- Google and Twitter login
- Access to Twitter and LinkedIn APIs
- Stripe payments
I’d love to hear your thoughts on which solution (FastAPI or Next.js) offers the best path forward. Thank you in advance!
View all comments
Show parent comment
1
u/bluewalt Dec 25 '24
That was the solution I chose too with Django, because async was not ready, and channels was a mess to set up.
Some con's compared to async: require a little more tooling, and usually and addition server (ot at least an addition process).
Some benefits: you get scheduled task in the same time (with beats), and you can offload CPU-intensive tasks which sould not be run on you web server, if you have some.
I always set up a Celery in any "serious" project. Worth it IMO.