High performance database messaging or pushingUDAParts Contents
Reasons for message pushes from backend databases a. Fast updating one or more middle tier
caches for different client applications whenever backend database is updated. One socket connection from database to SocketPro server To push messages from a database, SocketPro starts to build one client socket connection from database to a remote SocketPro server. Usually, we treat database as a server, but SocketPro thinks your database is one of its clients. Therefore, your database server is required to install a proper version of (32bit or 64bit) npUSocketPro.dll and make it registered because it is a COM library. SocketPro database push library is thread-safe. You can call any exposed functions under any conditions within a database system. Although SocketPro database push library opens one socket connection only, it is very fast for its 100% non-blocking communication. Internally, it has a hidden memory queue which has very high communication rate without wasting network bandwidth. Load library into database management systems Before using SocketPro database push, you need to make sure that a proper version of (32bit or 64bit) npUSocketPro.dll is registered by calling regsvr32 npUSocket.dll from DOS command as described here. Afterwards, you need to load one of dll located within the directory of ..\UDAParts\SocketPro\DatabasePush so that your database can access it. Usually, you are required to have DBA privilege at least. Also, see the SQL script file named as registration.sql for each of database management systems.
Registration of external stored functions Once we have loaded our SocketPro database push library into a database server, we need to register the five functions IsConnected, Connect, Disconnect, Notify, and SendUserMessage. We take MS Sql server as an example as shown below. All of other databases are similar. Please see the attached file registration.sql for each of database management systems.
Once the above functions are registered within your database, you can access them at your will. Again, please see the attached file registration.sql for each of database management systems. Connecting string to a remote server could be: "host|server=address;uid|userid=YourUserID;pwd|password=YourPassword;port=SomeNumber;zip=0|1;encryption=0|5|3;verify=paypal.com;strict=0|1" Note that the settings verify and strict are ignored if the encryption is 0 (no encryption, default). By default, zip is zero; encryption zero; verify string empty; and strict zero. The setting verify is used for verifying certificate subject, chains and validity. If the setting strict is not set to zero and encryption is either 3 (SSL3) or 5 (TLSv1), server authentication is fully tested through certificate before sending user id and password to a remote server. To test SocketPro database push library, you need to start SocketPro HTTP push server as described here and here. The sample server is written for supporting all types (middle tier, http server, silverlight, desktop, device and database) of push demonstrations. Please compile the sample project inside the directory C:\Program Files\UDAParts\SocketPro\tutorial\CSharp (VBNet)\Chat. After copying all files in the directory C:\Program Files\UDAParts\SocketPro\tutorial\HTTPChatSampleFiles into the directory C:\Program Files\UDAParts\SocketPro\tutorial\CSharp (VBNet)\Chat\Server\bin\Release, you can see messages on your web browsers from your databases. If you do everything correctly, you are expected to get the following two pictures: Error codes from functions Connect, Notify and SendUserMessage The above three functions may return one of the below error codes:
Absolutely safe and no security problem SocketPro database push library doesn't change any database objects or properties. It sends data from database onto a remote SocketPro server only after starting a client socket connection. Actually, there is absolutely no possibility to change any database objects or properties. Therefore, it is absolutely safe from security view. |