I am new to backend development and working on a project which has huge user base (very similar to Uber Eats). Our team should develop both the web app and the mobile app (for both Android and IOS). Because of the time constraints and the budget, we have decided to implement a PWA first and then with the customer satisfaction we are planning to implement native mobile apps also.
I want to know, when creating the backend for this kind of application system, is it worth to implement two API servers for authentication and for other general API calls separately and will there be a considerable increasing of performance than keeping the both are in one API server? Will it be changed after implementing the two native mobile apps?
There would be no significant increase in performance in this case, rather using two APIs would over-complicate the architecture and you should always aim for a simpler system architecture.
Using multiple APIs which are hosted on the same VPS would decrease the performance as compared to a single API. Using multiple APIs would require you to run multiple processes, ultimately decreasing the performance.
You maybe would need multiple APIs if you were scaling horizontally, but in this case you are just hosting it on a single VPS, thought in the case of horizontal scaling too you would rather use a load balancer like nginx to distribute the traffic over multiple servers.
Large companies like YouTube, Google and GitHub use a single API for everything - GET requests, POST requests, Authentication, etc.
It is recommended to use multiple APIs for different services if you want to apply optimizations to each of those services differently. A tech giant which uses multiple APIs for different services is WhatsApp; it uses different APIs for its text messaging and media messaging streams. WhatsApp uses this design pattern because it text messages are very small in context of storage whereas media usually takes more storage.
WhatsApp has to apply different optimizations on both of them and also it has to set priorities. You might ask: "This could also be accomplished using different endpoints", yes it could be but there is a whole list of reasons to do so.
To conclude, it won't be a great practice to use multiple APIs unless you want to restrict some services in your app on the network level. I hope I answered your query!