One problem I have is when I need to run several or many database queries that depend on each other in the client. This takes a long time because of the network traffic. Each query has to wait for the one before to reach the gateway, execute, and come back to the client with the results.
For instance I might have a Save button that a user needs to press to save some information. Let’s say I have an event script on the button that needs to run 5 database queries. This causes the button to work slowly because of the network traffic of having to send and receive 5 queries back and forth between the client and the gateway.
Normally if I ran into such a circumstance I would write a stored procedure in the database that would contain the various database queries in it and I would call the stored procedure from my event script. This eliminates the back and forth traffic and can speed things up dramatically.
Instead of writing a stored procedure it would be very nice to be able to write a script or function and be able to send it to the gateway and have it run on the gateway, not the client, and then send the results back to the client.
There are gateway scripts of course, but gateway scripts don’t have a good way to communicate with clients. I am suggesting that there be a way for a client to send code to the gateway to execute and then return the results back to the client for the purpose of eliminating needless traffic overhead of the back and forth of the client and gateway.