YordanGeorgiev has asked for the wisdom of the Perl Monks concerning the following question:
I want to implement "hot reload" of the tables and columns meta-data in the following project:
qto - github
https://qto.fi - click just login to get to the ui ...
The page life cycle / control flow goes as follows:
- user requests a page - the Mojoicious framework builds the "empty templates" and servers t +hem to the browser - once loaded to the browser, client side axios http requests fetch t +he data from the back-end - vue does the data-binding on the client side by using BOTH the data + for the page and the global tables and columns meta-data
by not-breaking however the horizontal scalability provided the world's best framework Mojolicious
the variant would be to have the following flow of events:
- 1) alter table in postgres - 2) reload a metatable from UI ( to tell to the Application Layer to + reload the meta-data) - 3) the meta data hash ref of hash refs is accessible to all the per +l processes
The current implementation does not implement this "hot reload" to all the hypnotoad processes ... which breaks the listings in the UI, because they are meta-data "aware" ...
Could it be wise to complicate the current setup by adding Redis with publish subscribe mechanism for the meta-data only ?
Could it be implemented by some kind of interprocess signalling / communication - one proc reloads the meta-data and somehow signlas to the others ... as at the end those DDL changes on the db site will probably not occur so often ...
Could some kind of quick hack not requiring a lot of work be implemented ?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: multiprocess run-time data structure sharing in Mojolicious web app ...
by 1nickt (Canon) on Jan 29, 2020 at 20:18 UTC | |
by YordanGeorgiev (Acolyte) on Jan 30, 2020 at 14:34 UTC | |
by YordanGeorgiev (Acolyte) on Feb 09, 2020 at 19:35 UTC |