I'm working on a full-stack business deal inventory and time-tracking application that primarily involves CRUD operations. I'm using React for the frontend and Node.js with TypeScript for the backend, with REST currently handling all CRUD functionalities. I have an ingestion service utilizing Vertex AI to process emails and input data into a PostgreSQL database via Sequelize. Given my setup, which includes multiple related tables and a growing number of data entries, I'm considering if switching from REST to GraphQL would be beneficial, especially with performance concerns related to querying. I'm also thinking about the future integration of an AI chatbot feature to handle user inquiries about deal information. What's the best approach for my situation?
3 Answers
Honestly, you should stick with REST for your current project. It's perfectly fine for CRUD operations, and switching to GraphQL won't necessarily resolve your 30-column challenge. Performance issues typically arise from database optimizations like indexing, not from the API design itself. If you start running into performance problems later, focus on tuning your database instead.
In your case, GraphQL feels unnecessary. It’s more useful when you need flexibility in data retrieval and your app's data requirements are unpredictable. Since you have a single frontend and backend, just use REST and keep it simple!
If this is a learning or hobby project, go with what excites you. That said, for standard CRUD, REST is usually the way to go. GraphQL shines when you're dealing with nested data structures rather than straightforward CRUD operations. Stick to REST for now and think about GraphQL down the line if it fits better with your needs.

Thanks for clarifying that! I'll keep an eye on database indexing.