• IT DT - data processing, transfering and transforming

Intro for ServerSig

ServerSig – lightweight and efficient websocket server connected to a database layer

If you want changes to any database table to be sent as a stream to a websocket recipient, you need to create an event table. The server, based on the event table, monitors whether changes have occurred in the source table and, if so, sends them to the server’s buffers and from there to connected clients. The server allows you to define the fields that will be sent in the stream. Multiple source tables can be defined in the server (as DSN). The server is very efficient – it can handle up to tens of thousands of connections.

DSN is defined as one line with fields separated && where the individual fields represent the following:

  • Name  – name of DSN
  • JDBC URL – connect string to database
  • User – user in database
  • Password – password for user (you can encrypt password – script runenc.sh – then you must enter the password in the format [encrypted]<encrypted password>)
    • after “-” – max connection (not used now – max connection is set in license string)
  • level – 0 – only one row is store in buffor (the index is the first field in the field definition for a given DSN), N – in buffor is stored N rows
  • number of skip messages – default is 0 (this parameter allows you to skip some messages when the table is changing very quickly and the above parameter is set to 0 or a low value (this value should be calculated as (1 or N) * number of unique values ​​in the first field defining the DSN * 2)
  • source table – table with data
  • event table – table to check if there were changes to the source table (based on the number field)
  • event time – sleep time before next check when check showed changes
  • control buffer – not used
  • count time – sleep time before next check when previous check showed no changes
  • where – fragment of an SQL query returning data from the source table

Example of DSN preparation (based on HSQLDB)

In database

Source table:

Event table:

And of course triggers:

In file serversig.conf

Definition of fields: