Best Way t Frequent Access to WCF Service

Tags: c# wcf crm lookup
By : ykh
Source: Stackoverflow.com
Question!

I have a WCF service. The WCF services expose a set of methods that talks directly to a CRM. Most of the data I am getting from these services are lookups data and I am getting them frequently. This would degrade performance, as a single form in my website contains several lookups fetched from CRM.

To solve this, I have thought of:

*Create a windows service that will grab all the data and save in a local database. The service will be run after specific time to ensure that all data are in sync.

*Cache data. For each call made to a method to retrieve a cretin type of lookup, the data will be cached such that any similar call will return the cached data.

My questions are:

1-Are there any better ways than this?

2-If no, which is better?

By : ykh


Answers

I would not recommend creating a caching service to offer faster access to CRM data. It would just be a remote cache with persistence, which could also just be integrated into your wcf service as you mentioned as your second approach.

If you can guarantee that the selected data is still of value when it was selected for example 1 hour ago from the CRM system, your approach to use caching is the correct way here. Question is, if it is acceptable for your customers to miss the possible latest changes done in the CRM in the last hour. Just saying -> be careful with caching.

My tip: If your wcf service is high frequently accessed, such as 100 x per second, a caching for 5-10 seconds can often reduce accesses extremely by not reducing actuality of data by much.

But: Most database systems and tables are designed to offer fast, concurrent data read accesses (f.e. paging). Ms-Sql for example stores execution plans for known, often used scripts and stored procedures, to increase performance in future calls. So first make sure your CRM is really not capable of handling your read accesses before introducing caching (which should often be used carefully).



From your current output, just remove res2.php?res= and ending parameters &g=500&u=335:

You will get the direct link

http://www.arena-offshore.com/site/big/08032016130016552-GEMI-g%C3%B6zc%C3%BC1.jpg
By : Rocherlee


if type(value) is numpy.ndarray:
    #do numpy things
else
    # Handle None

Though the above would work, I would suggest to keep signatures simple and consistent, ie table[w] should always return numpy array. In case of None, return empty array.

By : Ayan Guha


This video can help you solving your question :)
By: admin