Configuring Database Cache Provider in deployment

5 posts, 0 answers
  1. John
    John avatar
    41 posts
    Member since:
    Jun 2013

    Posted 18 Nov 2014 Link to this post

    So, sadly, it seems I cannot use the nice new Redis cache for Telerik reports, because there is no support for Sentinel, and so there is no good failover story for high availablity.
    That means I need to use SQL server as the cache. The online help seems to suggest using some custom interactive utility to configure the DB. That is not an option for us, we do a headless automated install, there is no way we can add a manual "go run this tool" step.
    So, now can Sql Server cache be scripted for Telerik Reporting cache?
    Cheers
    John
  2. Stef
    Admin
    Stef avatar
    3610 posts

    Posted 24 Nov 2014 Link to this post

    Hi John,

    Thank you for your interest in Telerik Reporting and the Reporting REST services cache management in particular.

    On your question regarding the MS SQL database storage, the scripts are available in the MsSqlServerStorage Class article. You can test running them manually and adjust them for production. Then add custom logic for executing them once on starting the application in production.
    Other option is to use the MsSqlServerStorage.CreateSchema Method. It executes the same script on the database provided in the constructor connection string.

    The Redis storage implementation we ship uses the StackExchange Redis client as one of the common Redis client libraries. However it implements the public interface IStorage, which follows the built-in operations of the Redis storage, so you are free to provide different Redis storage implementation. The important here is that the service works with an IStorage instance which provides the locking mechanism.

    Regards,
    Stef
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. John
    John avatar
    41 posts
    Member since:
    Jun 2013

    Posted 24 Nov 2014 in reply to Stef Link to this post

    So....I added the code to call CreateSchema...but I have to check first if it is created or it throws an exception. I guess I can do that, but it would be nice if CreateSchema was more friendly.
    Also, the CreateStorage interface seems to be called a bunch of times...should I return the same MsSqlServerStorage instance each time, i.e. put it in a static variable? Or do you need new instances?
  4. John
    John avatar
    41 posts
    Member since:
    Jun 2013

    Posted 24 Nov 2014 in reply to John Link to this post

    In the course of rendering one report, CreateStorage was called no less than 14 times...
  5. Stef
    Admin
    Stef avatar
    3610 posts

    Posted 27 Nov 2014 Link to this post

    Hello John,

    The database must be created only once by using the provided tool or executing the scripts from MsSqlServerStorage Class article, for example when the application starts.

    It is the expected behavior for the REST service that the CreateStorage method will be invoked multiple times and creating a new MsSqlServerStorage instance each time is not a performance hit.  The creation of the storage database is not included in the CreateStorage method as the method's purpose is only to provide a proxy for accessing an already existing database.

    I hope this clears the misunderstanding.

    Regards,
    Stef
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top