{"id":2843,"date":"2018-12-21T10:58:03","date_gmt":"2018-12-21T10:58:03","guid":{"rendered":"https:\/\/www.beaconzone.co.uk\/blog\/?p=2843"},"modified":"2023-05-04T20:40:01","modified_gmt":"2023-05-04T20:40:01","slug":"advertising-change-stream","status":"publish","type":"post","link":"https:\/\/www.beaconzone.co.uk\/blog\/advertising-change-stream\/","title":{"rendered":"Advertising Change Stream"},"content":{"rendered":"\n<p>If you work in IT and particularly if you have knowledge of programming, you will know it&#8217;s best to be informed of data rather than repeatedly request changes. <\/p>\n\n\n\n<p>Repeatedly requesting changes, called <strong>polling<\/strong>, wastes resources when there&#8217;s no data returned. It also doesn&#8217;t get the data as soon it is available as you have to wait for the next poll.<\/p>\n\n\n\n<p>A feature of our <a rel=\"noreferrer noopener\" aria-label=\"BeaconServer\u2122 (opens in a new tab)\" href=\"https:\/\/www.beaconserver.net\/\" target=\"_blank\">BeaconServer\u2122<\/a> and <a rel=\"noreferrer noopener\" aria-label=\"BeaconRTLS\u2122 (opens in a new tab)\" href=\"https:\/\/www.beaconrtls.net\/\" target=\"_blank\">BeaconRTLS\u2122<\/a> is that they offer <strong>change stream<\/strong> data on all database data. Change stream is a standard web (HTTP(S)) protocol that provides data to systems and apps as and when it becomes available. The client sets up a long running HTTP connection and then receives updates.<\/p>\n\n\n\n<p>The stream looks something like:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"243\" src=\"https:\/\/www.beaconzone.co.uk\/blog\/wp-content\/uploads\/2018\/12\/changestream-1024x243.png\" alt=\"\" class=\"wp-image-2844\" srcset=\"https:\/\/www.beaconzone.co.uk\/blog\/wp-content\/uploads\/2018\/12\/changestream-1024x243.png 1024w, https:\/\/www.beaconzone.co.uk\/blog\/wp-content\/uploads\/2018\/12\/changestream-300x71.png 300w, https:\/\/www.beaconzone.co.uk\/blog\/wp-content\/uploads\/2018\/12\/changestream-768x182.png 768w, https:\/\/www.beaconzone.co.uk\/blog\/wp-content\/uploads\/2018\/12\/changestream.png 1162w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n\n\n\n<p>First you get an &#8216;ok&#8217; followed by data as and when it becomes available. The above only shows a generic iBeacon. When used with <a rel=\"noreferrer noopener\" aria-label=\"sensor beacons (opens in a new tab)\" href=\"https:\/\/www.beaconzone.co.uk\/sensor\" target=\"_blank\">sensor beacons<\/a> this also includes all <strong>decoded <\/strong>data such as  movement,&nbsp;temperature, humidity, air pressure, light and magnetism (hall effect), proximity (short range IR and PIR) and fall detection.<\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/www.beaconserver.net\/\" target=\"_blank\">BeaconServer\u2122<\/a> and <a rel=\"noreferrer noopener\" href=\"https:\/\/www.beaconrtls.net\/\" target=\"_blank\">BeaconRTLS\u2122<\/a> provide REST based insert, update, query and change stream on all data allowing external systems and apps to fully use the system. This can also be authenticated via HTTP header tokens to prevent unauthorised access.<\/p>\n\n\n\n<p>An example of use of the change stream is <a rel=\"noreferrer noopener\" href=\"https:\/\/www.beaconrtls.net\/\" target=\"_blank\">BeaconRTLS\u2122<\/a> itself. The web UI uses the change stream to asynchronously update the UI with no flicker or redraw. All data, including beacons, locations and alerts are obtained asynchronously from the server (image below not live at it needs login):<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"661\" src=\"https:\/\/www.beaconzone.co.uk\/blog\/wp-content\/uploads\/2017\/06\/warehousewithalerts-1024x661.png\" alt=\"\" class=\"wp-image-1705\" srcset=\"https:\/\/www.beaconzone.co.uk\/blog\/wp-content\/uploads\/2017\/06\/warehousewithalerts-1024x661.png 1024w, https:\/\/www.beaconzone.co.uk\/blog\/wp-content\/uploads\/2017\/06\/warehousewithalerts-300x194.png 300w, https:\/\/www.beaconzone.co.uk\/blog\/wp-content\/uploads\/2017\/06\/warehousewithalerts-768x496.png 768w, https:\/\/www.beaconzone.co.uk\/blog\/wp-content\/uploads\/2017\/06\/warehousewithalerts.png 1190w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you work in IT and particularly if you have knowledge of programming, you will know it&#8217;s best to be informed of data rather than repeatedly request changes. Repeatedly requesting changes, called polling, wastes resources when there&#8217;s no data returned. It also doesn&#8217;t get the data as soon it is available as you have to &hellip; <a href=\"https:\/\/www.beaconzone.co.uk\/blog\/advertising-change-stream\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Advertising Change Stream&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[151,200],"tags":[],"_links":{"self":[{"href":"https:\/\/www.beaconzone.co.uk\/blog\/wp-json\/wp\/v2\/posts\/2843"}],"collection":[{"href":"https:\/\/www.beaconzone.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.beaconzone.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.beaconzone.co.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.beaconzone.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=2843"}],"version-history":[{"count":7,"href":"https:\/\/www.beaconzone.co.uk\/blog\/wp-json\/wp\/v2\/posts\/2843\/revisions"}],"predecessor-version":[{"id":8652,"href":"https:\/\/www.beaconzone.co.uk\/blog\/wp-json\/wp\/v2\/posts\/2843\/revisions\/8652"}],"wp:attachment":[{"href":"https:\/\/www.beaconzone.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=2843"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.beaconzone.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=2843"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.beaconzone.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=2843"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}