What is the best approach for a mobile app backend in PHP for retrieving SQL data and push notifications: a single endpoint or multiple endpoints? Alternatives welcome.
Based on my experience, a segmented approach using multiple endpoints tends to yield better maintainability and scalability. Each endpoint focuses on a specific function, resulting in clearer separation of concerns and easier troubleshooting when issues arise. This architecture also allows nuanced security measures and consistent performance optimizations per endpoint, which can minimize the risk of bottlenecks and vulnerabilities. Although alternatives like a single comprehensive endpoint or even GraphQL were considered, multiple endpoints provided a more straightforward and flexible solution for evolving backend needs.
i’d try sticking with a single endpoint that dynamically routes calls. it keeps the backend simpler until things scale roughy. just be wary of messy code if you end up overloading that one point.
hey ppl, what about a hybrid approach? splitting push notifs from sql endpoints might ease scaling and debugging. ever tried mixn them with a light framework? keen to know your experince and ideas.
In my experience, considering the backend as a collection of specialized services can also be beneficial. Instead of strictly opting for a single or multiple endpoints, I experimented with an approach where distinct tasks were managed by tailored services behind an API gateway. This allowed for more precise load balancing and simplified error tracking without overwhelming the server with all functions at once. By maintaining a consistent API contract and decoupling services, it becomes easier to extend functionality without device-specific constraints. This method combines modularity with centralized management and addresses scale issues progressively.
i guess using separate endpoints for push notifs and sql data allows you to isolate potential issues. a single endpoint might simplify things early on but will grow messy as you scale. just be ready to refactor if you choose the simple path.