Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » Transfer compress data
Transfer compress data [message #59821] Wed, 26 April 2023 12:59 Go to next message
forlano is currently offline  forlano
Messages: 1182
Registered: March 2006
Location: Italy
Senior Contributor
Hello,

my app communicate with a MySql database online.
I wonder if the data transfer can be done in a compressed/zipped way to speed the whole procedure.

Thanks,
Luigi

[Updated on: Wed, 26 April 2023 16:49]

Report message to a moderator

Re: Transfer compress data [message #59830 is a reply to message #59821] Sat, 29 April 2023 00:25 Go to previous messageGo to next message
zsolt is currently offline  zsolt
Messages: 693
Registered: December 2005
Location: Budapest, Hungary
Contributor
Hello Luigi,

A had a same problem, so I created a backend part for my U++ software.
It receives JSON data as arguments in HTTP and the responses are also in JSON. This way it can be used by not only my GUI app, but a Javascript SPA (single page app) also.
HTTP is good, because I put my backent behind an Nginx reverse proxy. Nginx can compress the responses.

The other problem, you can had solved with this solution is the latency, caused by multiple SQL queries. E.g. user opens a data entry window with a lot of droplists and/or converts, based on the database, that generates a lot of SQL queries one by one, adding a very large latency. Using this JSON requests, you can send all the parameters to the server (the backend) in a JSON. It runs all the queries in place and sends back all the results in one JSON, so the latency is one request-response time only.

Jsonize framework is very useful here.
Re: Transfer compress data [message #59832 is a reply to message #59830] Sat, 29 April 2023 15:01 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1182
Registered: March 2006
Location: Italy
Senior Contributor
zsolt wrote on Sat, 29 April 2023 00:25


Jsonize framework is very useful here.


Hello zsolt,

thank you for the reply. I'll move in this direction too.

Best regards,
Luigi
Re: Transfer compress data [message #59833 is a reply to message #59832] Sat, 29 April 2023 18:24 Go to previous message
zsolt is currently offline  zsolt
Messages: 693
Registered: December 2005
Location: Budapest, Hungary
Contributor
It is good to know, that if you don't plan using a Javascript client, the normal Serialize framework can be much better (faster and more compact).
JSON is not very efficient to transfer query results (2 dimension array of values), so I had to create a class to implement it more efficiently.
It serializes field names as an array of strings and rows as raw JSON value array (2 dimensions). Something like a CSV.
Previous Topic: sqlite3 encryption
Next Topic: Sqlite3 ChangePassword() failed.
Goto Forum:
  


Current Time: Fri Mar 29 01:25:32 CET 2024

Total time taken to generate the page: 0.00910 seconds