Which is the best way to synchronize a SQL Server database with its remote client databases? Web services/any other built-in features available in SQL Server?
Application details:- Wpf desktop with SQL Server 2005.
The scenario is client’s main office having stock management database. Same database structure implemented in client’s remote outlets. New stocks are adding in main office database. Whenever a new row is added to head-office database, need to inform all remote client SQL Server databases. And whenever a change happens in remote client outlet, need to send back the changes to main office database.
Thanks in advance.
After a lot of research I ended up with followings
1. Sql Server Replication
2. SymmetricDS
3. Microsoft Sync Framework
4. Customized WCF service.(An Example)
I chose customized WCF service for synchronizing DBs. The steps adopted are mentioned here.
1. Created an Index Table. This table holds the transaction history and signature of client.
2. Created a service layer (class library) which receives and returns table rows as stateless DTO objects. This service layer referencing a Data Access Layer which is responsible for communicating with database.
This service layer & Data Access Layer are referenced by WCF service and windows service.
3. Created one WCF service and hosted it in IIS of web server, This service offers:
a). Download(DTOClass dto)
b). Upload(DTOClass dto) service contracts.
4. Created one Windows service and deployed it in multiple client locations. This service consumes the WCF service hosted in Webserver IIS.
Windows services from client location communicate with WCF service at specific intervals, if a new update available in main server database(this information available in IndexTables), windows service downloads the update (using Download(DTOClass dto) contract) and update local database.
Likewise, if any changes happen in local database, windows service handover the changes to WCF service(using Upload(DTOClass dto) contract). WCF service then update master database.
Since both services accessing Database servers locally, this result in better performance.
Related
We are creating an integration application which will sync data between Dynamics CRM and Xero. We are now at the stage where we need to decide which type of application we should use to connect to Xero and perform operations.
The application will be used by multiple Xero Customers. So our application should serve multiple Xero users.
We will have web api which will call on Dynamics CRM events(Create, Update Contact etc.) and will update the data in Xero.
So our web api should connect to Xero and perform operations in Xero. We tried using Public application but it generates the token that is valid for 30 minutes. The web api should communicate to Xero without any time limitation.
Please suggest how we can achieve this.
You should begin developing your integration using a public application, and get in touch with Xero to register for becoming a partner application (which will give you the ability to request long-term tokens). The process is documented here: https://developer.xero.com/documentation/auth-and-limits/partner-applications
We are developing a dashboard application. In the home screen it has four charts and list view. The data for these charts and list view are stored in different tables in the backend database. We are planning to create web services for fetching the data from server.
My question is, do we need to write separate web services (in this case 5 web services) for fetching the data or can we create a single web services that returns all the data in a single call?
If we write different services, then we need to invoke five services from the mobile device (iPad/Android Tablet). If we write single service, the response time will be delayed due to the joining table in the server side.
We are creating our application using Sencha touch framework. Our app is a cross platform mobile application. The web services are writing using restful wcf services and it returns JSON.
Please give ur your suggestions
I am configuring Stratos 1.6.0 and trying get the following scenario working.
Create a database in Storage Server
Create a user in Storage Server
Assign the user to the database
Generate datasource for the user/database combination in the Storage Server
Create DataService in Data Service Server and use the data source above
From what I can see in the code... when one creates a datasource in a Carbon application, the org.wso2.carbon.ndatasource.core.DataSourceRepository will notify the member's in the cluster of the new DataSource. These members will then invalidate the registry cache.
The problem comes is that in the default clustering configuration in Stratos 1.6.0, the Storage Server and the Data Service Server are in different Tribe domains, so messaging using Tribe is not possible between the two types of applications.
How can one get the Data Service Server to update its datasource configuration when datasources are created in the Storage Server?
What you've mentioned in your query itself is exactly what's expected from providing the option to create a datasource via WSO2 Storage Server. However, there are certain technical complexities associated with sharing datasources across nodes/clusters of different Carbon products (other than the type of Carbon product in which the datasources are created) and we're currently in the middle of attending to them. Therefore, all considered, a better way to integrate SS with DSS would be, first create your database/database user in WSO2 SS, then create datasources with that information (connection strings, user credentials, etc) in WSO2 DSS and consume them.
Regards,
Prabath
P.S. You can refer http://sparkletechthoughts.blogspot.in/2013/04/relational-storage-solution-using-wso2.html which provides you with a comprehensive guide for creating databases/database users/privilege templates.
Good Day Everyone,
Excuse the newbie question, I am new to Microsoft Sync Framework. I've done extensive research on the Internet in order to find my way in this puzzle with the different versions of Sync Framework, of SQL Server, of Sync Services for ADO.NET, of SyncAgent vs SyncOrchestrator, etc. etc. and what should be used in which type of scenario. Unfortunately, after about a week of struggling all day long with how to code my ASP.NET 2.0 C# web application right, I am still lost.
My current situation is this: I am developing applications for a large Department and I cannot expect to get approval for installing new stuff on the server side. I am stuck with SQL Server 2008 and (I believe), the server has Sync Framework 1.0 installed on it. However, I have the freedom to install later versions on the client computers that will connect to the server. These will have SQL Server 2008 Express (NOT Compact) and will each run the web app. in their localhost IIS. The synchronization model is centralized in that the clients will only connect to the server for bidirectional synchronization (in a star-shaped network topology, do we call this the hub-spoke model?) but will not connect to each other (no peer-to-peer collaboration).
I have prepared both sides of the database for synchronization (enabled Change Tracking, put GUID data type for Primary Keys, etc. etc.)
The core of the synchronization, the program that makes the interface between the two nodes to synchronize, seem to be exclusively the web application on the client side. Right?
QUESTION: If I want to use Sync Framework v2.0 or v2.1, can I just ignore what version is installed on the server? In other words, is the Sync Framework on the server side even doing something? The SQL Server does not have the web application installed on it.
Unfortunately I could not find answer to this rather simple question on the web!
Thanks very much for your help! Have a great day!
Kindest Regards,
Zyxy
No, you don't need to install sync framework on the central sever. All you need from the central database is a connection string. As long as you can access the central database with a login that has sufficient rights, then you don't need to install anything on it. The sync application can run from anywhere as long as it is able to connect to the central server.
depends how you build your application.
if all sync code is on your app and you simply point it to connect the central sql server, then no need to have sync framework on the server.
if however you decide to use WCF such that you have a service component of the sync on the server side, then you need sync framework on the server. you client will have a proxy for the server side service and part of the synchronization will be executed server side on the wcf service.
with regards to SQL Express on the client side, SQL Ce is the only supported client database is you use VS Local Database Cache Project item or if you manually code against the SyncAgent/SQLCeClientSyncProvider/DbServerSyncProvider.
if you use SQL Express, you will have to use the newer SyncOrchestrator/SqlSyncProvider combo but that doesnt use the built-in SQL Change tracking.
Suppose I have 2 web services A and B in SOA project. Both web services are running on a remote servers. Web Service A depends on information available from only a locally installed desktop application on a human actor machine and thats all web service A does i.e. provide this information). There are hundreds of such human actors with the same locally installed application providing its own information that web service A needs. Web service B needs this information from web service A, the result of which (which is the whole benefit of this project) is provided to that human actor who originated this process (by loging into system and clicking some command button). So this human actor is acting like the consumer of Web service B. The question is how can I make this locally installed application act as Web Service A (in the context of SOA project)?
This question could best be answered by some one with extensive experience in Web services and SOA.
This SOA project uses java, like ESB based on Java and there is no Microsoft specific services running although the desktop application is a Windows application. The application provides c/C++ API for an external process to call and retrieve the information needed by Web service A. What I want is the both web services A and B are hosted on remote server and interacting with each other via ESB but the problem is how to make local application information available to Web Service A?
There are two types of solutions
The first: have the original client application add a parameter with the address of web service A, and use this address for calling the service.
The second: pass a more abstract user identifier from the client (actually, there's a good chance you have such a field in the service). and use a translation service to retrieve the physical address corresponding to this id.
To allow such translation, the desktop application that acts as a server needs to "register" with the translation service when starting up.
If you are using an ESB, or other SOA infrastructure (like a service directory, message queuing service) it will include much of the functionality you need to build the translation service.
regarding the actual hosting of the service in the client machine.
the simplest solution is to use a different process from the actual application, and just access the files or DB the application uses.
In this case you can use any infrastructure you like to develop the service.
a more complex scenario is when you need the actual application to supply the service. in this case you will need to have a thread in the application that listens to service requests.
if you are using WCF see Hosting Services about how to host a web service in your application.
EDIT
some additions regarding you clarification.
as I understand, the desktop application exposes a C\C++ API that is available for external processes on the same machine.
You can either write a web service that will use this API. Googling "C++ Web Services Windows" will give yo several relevant pointers on implementing those.
Another good option is to use a messaging infrastructure. most JMS providers provide API's in languages other then Java - including C++.
Your application will be a C++ windows service that listens and sends messages to you JMS provider.