-
Support QuestionThe remote server example nicely demonstrates hosting a local file as a table. Wondering what does it take to host a real table (from a local database)? For example, say we have a SQLite or some other database and want to bind one of its tables - what kind of API marshalling need to be done? Is there some kind of interface / class that can be implemented so that any datasource can potentially become a table? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 8 replies
-
Hi @KrishnaPG. I've been able to successfully use perspective on the browser, and serve it data separately from a SQL backend. To do this, I was using JDBC > Apache Arrow via the provided utilities in the Arrow project. I then converted the Arrow data into batches, which I streamed to the browser via gRPC-web. Then on the browser, I read the Arrow data into Perspective. Would a workflow like that work for you? |
Beta Was this translation helpful? Give feedback.
-
Thank you @nevi-me That sounds reasonable. Perhaps the question would be then,:
One way binding from server/DB -> frontEnd/Perspectiv Viewer (streaming the results one way) is straight forward. But how to achieve the two-way binding, specifically being able to apply the filters, sort etc. on the fly and get (only) the relevant data from the very large DB. As user keeps changing the filters, sort etc. on the Perspective viewer, these need to be somehow sent to the server /DB adapter to tune the data that is streamed to the frontend. Is there some example / API to demonstrate the conversion of front-end params to query params? |
Beta Was this translation helpful? Give feedback.
-
@KrishnaPG, did you ever figure out how to dynamically pull data from a database into perspective? |
Beta Was this translation helpful? Give feedback.
-
For what is worth: I have been experimenting with this concept with Perspectice and Clickhouse. ClickHouse supports Arrow and I have a small Rust server that takes care of distributing Arrow files to the clients. I have separated the data into monthly chunks. Every month equals 1 arrow file. So when you see the dashboard, you get back an Arrow file for 1 month from the server. If the client requests 1 month + 2 weeks, it'll fetch the other month. This way, server interaction is minimized and the customer can fully leverage Perspective. This, in contrast to sending multiple parameterized queries, was much better. The sacrifice is a few extra seconds during initial load, which seems to be acceptable given the use case (versus slowness during analysis). |
Beta Was this translation helpful? Give feedback.
Hi @KrishnaPG. I've been able to successfully use perspective on the browser, and serve it data separately from a SQL backend. To do this, I was using JDBC > Apache Arrow via the provided utilities in the Arrow project. I then converted the Arrow data into batches, which I streamed to the browser via gRPC-web. Then on the browser, I read the Arrow data into Perspective.
Would a workflow like that work for you?