Signalr webfarm with Backplane out of sync -


we have signalr application built , tested use on single web server. requirements have changed , need deploy application webfarm. signalr supports several backplanes, since application uses sql server have implemented. introduction of second web node ran issue keeping data cached within hub synced between nodes.

each hub has internal cache in form of dataset. private static dataset _cache; cache gets populated when client first requests data, , there interaction updates local cache , sql server, notifies connected clients of changes.

the backplane handles broadcast messages between clients other node not receive message.

our first thought there might method wire triggered backplane sending message nodes clients, have not seen such thing mentioned in documentation.

our second thought create .net client within hub.

private async void connecthubproxy()     {         ihubproxy eventviewerhubproxy = _hubconnection.createhubproxy("eventviewerhub");         eventviewerhubproxy.on<string>("broadcastacknowledgedevents", eventids => updatecacheisacknowledged(eventids));         eventviewerhubproxy.on<string>("broadcastdeletedevents", eventids => updatecacheisdeleted(eventids));         servicepointmanager.defaultconnectionlimit = 10;         await _hubconnection.start();     } 

our questions: how keep cache in sync? first thought possible , missed in documentation? there issues concerns having hub connect itself?

the recommended way have "state" in scaleout scenario have source of persistence. in case, if you're looking have "global-like" cache 1 way can implement via database.

by creating database nodes can write/read same source , therefore have global cache.

the reason why having in-memory cache not idea because in web farm, if nodes go down, lose in-memory cache. having persistence, doesn't matter if nodes been days or has recovered "shutdown" based failure, persistence layer there.


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -