Last post Sep 01, 2014 02:41 AM by ramana123
Aug 28, 2014 03:59 PM|DotNetXenon|LINK
When using Singleton Instance management mode in WCF service, will state be stored across load balancing web servers? I'm trying to store file to a location through a WCF service and get the count of number of files stored. The Service will have Get() and Copy()
method. A website accessing the WCF service will call the Get() and get number of file for eg: 1(name:File1) and for storing another file, Copy() method will be called. Since the value returned through Get() is 1, Copy() will increment 1 and save this file
1. Please let me know if Singleton method can handle the above scenario with load balancing web servers.
2. If not, is there another way I can do with WCF?
3. Is it better idea to store the count of files in a database rather than WCF session?
Aug 30, 2014 12:03 AM|francissvk|LINK
Yes. Singleton Instance management mode in WCF is enough for your requirement.
For more detailed info please go with the below urls:
Sep 01, 2014 02:41 AM|ramana123|LINK
Hi Xenon, Interesting question...I really doubt the file count will be maintaied across all the load balacing servers though its Singleton as Server#1 may not know what Server#2 is holding off also If i am not wrong if you have 3 load balance servers then
you may end uo having 3 diff instances eachone for server.
unles its prooved or experts confirmed I would go with DB store of file count ratther.
I would be interested to see experts opinon.