Is it efficient to query data in Rust and send it to the frontend in Tauri, or should I use an SQL plugin for better performance? #11845
-
I'm developing a Tauri application and currently handling data querying in two ways:
I'm concerned about performance and efficiency. Which approach is better in terms of: Execution speed, Data transfer latency, Memory usage, Security Would using an SQL plugin significantly improve performance, or is querying through Rust more optimal for large datasets and real-time scenarios? Additionally, what are the pros and cons of each approach? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Both options are essentially the same. The sql plugin is nothing special, it also just calls the rust side and there uses the sqlx plugin. |
Beta Was this translation helpful? Give feedback.
Both options are essentially the same. The sql plugin is nothing special, it also just calls the rust side and there uses the sqlx plugin.
Using rust yourself directly is likely better as you can optimize the implementation to what you actually need, and not have to use the general purpose impl of the plugin. Also it would enable you to pre-process the responses on the rust side and sending only what you need to the frontend which would help with the big IPC bottleneck.