Singleton isolate for SQL
- Dominant language
- APL
- Stars
- 4
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
SQL queries in the main process [cause slower responses](https://github.com/Dyalog/DCMS/blob/f1ce6077dbf26da0168826e11b6a43a59c4da528/docs/ISOLATES.md?plain=1#L54) and so ought to be done in separate processes. This issue is to design and implement a scheme within the SQL utility library for this.
Propose an operator `_Isolate` or `_OutOfProcess` (name TBD) that checks whether the singleton isolate is running. If not, it starts the isolate with an initialisation function that copies in the `SQL` namespace, connects to the database, executes the query and returns the result or propagates the error information as applicable. The singleton isolate lives for some set timeout ready to receive further statements. The timeout is reset when a new statement arrives. After the timeout expires with no statements, the isolate is terminated.
This internal change can be made with no alteration of API, so no major version change required.
- [ ] propagation of error information
- [ ] handling isolate process crashes
Contributor guide
Research direction
Start with docs/ISOLATES.md and the SQL utility library to understand how isolate processes are used. Design the singleton lifecycle around query execution, timeout reset, result and error propagation, and process-crash handling. Done means the scheme works without changing the public API and covers both unchecked items.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- sql
- Domain
- backend, database
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100