I am considering starting researching an analytics application in Elm. This will require talking to SQL databases as a bare minimum. Now, I want to do be able to create dynamically many elm-ui elements on top of various queries.
I was thinking that managing 1 json tree on the server (which includes also the query results) and then passing that to Elm via websockets might work, but I wanted to hear some feedback on this idea. If you think it could be done differently or that it’s not a good idea at all please let me know.
The process would be:
- The user composes a query in Elm
- Elm sends the user input to the server (via websocket?)
- The server parses the input, queries the database and puts the output into a json
- Elm gets the updated json via subscription
- Elm dynamically creates, destroys or updates elm-ui elements
The json would persist alongside the Elm app so that eventually all state is persisted there and state is the same on both server and Elm.
Is this a bad idea?