Question

Would you prefer to use custom APIs for doing the querys on the table or directly from the application? Which has the better performance?

Was it helpful?

Solution

There shouldn't be any differences between the performance of using either of them. In such scenarios there are typically two main components which will affect the performance: the network request itself and the database connection.

For the former, they're really the same (one goes to /tables/<tableName> while the other goes to /api/<apiName>, and the difference of three characters really shouldn't make a difference).

For the latter, it will depend on how you implement the table access. If you use the table object in an API, you'll likely be doing the same as what you get "for free" in the table, so you'll be writing more code to accomplish the same thing (and notice that you can also use table scripts to do the same on table operations as well). If you're using the mssql object to customize your DB queries, it may or may not be faster than the default implementation (you'll need to go deep into the SQL optimizer to do that), but again you can use it on both tables and API scripts, so it ends up as another tie.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top