Replication of database in WPF + EF system

1

I have a sales system in WPF / EF that is in use in different cities, but the database is in headquarters. I'm having trouble when the city link is too slow, resulting in a slow sale.

Can I do a replication of this my database to the local server and then sync with my central server?

    
asked by anonymous 05.03.2015 / 14:01

1 answer

1

I think in your case a second level cache should resolve. The Entity Framework has a package that implements this. You can download it here .

According to the developer blog, the configuration is pretty simple . Put the following in your configuration class:

public class Configuration : DbConfiguration
{
    public Configuration()
    {
        var transactionHandler = new CacheTransactionHandler(Program.Cache);

        AddInterceptor(transactionHandler);

        Loaded +=
          (sender, args) => args.ReplaceService<DbProviderServices>(
            (s, _) => new CachingProviderServices(s, transactionHandler));
    }
}

This alone makes your system more fluid, with no need for basic replication. However, if the base grows more and demand too, there is no magic: you have to invest in the infrastructure.

    
05.03.2015 / 14:40