Idea behind PubSubSQL is to have an SQL database that allows you to SUBscribe to certain tables with filters (like
anything in table STOCKS with STOCK_ID=’APPLE’) but retain all the benefits of a relational database (MySQL in this case).
For a conventional worker that upserts data usage is just like with any other database connector (use normal SQL, be oblivious to the fact that PSS is in between). Only “catch” is that data flows through PSS server service which handles data subscriptions before streaming data to MySQL backend. For a worker/service that wants to react to changes to that same relational data, usage is somewhat different - interface is the same as conventional database (objects you receive are the same as if querying the db normally) but you of course use different syntax to “query” (subscribe). This concept is best explained with the following flowchart:
Code is pretty hackish and crappy for the time being but if there is enough interest we plan on dedicating ourselves more to the project. First of all we need to abstractize the syntax more (fully support SQL) and make HUGE improvements to the code-base and in-memory handling.
What do you think about this use-case and idea? We’d appreciate feedback below!
Project is open-source (github project) so feel free to explore, play & log ANY issues or feature-requests.