Synchronize databases via Webservice C# Asp

Asked

Viewed 955 times

0

I have databases on the server and on the client and would like the changes made in one to be sent to the other via a Webservice. For example, a new row is added to a table on the server, then this new insertion is sent to the Webservice, which should replicate this action to the client’s database. Would that be possible?

NOTE: I cannot use a database on the server, it must be a Webservice.

  • Yes, there is, after you insert it into one have it inserted into the other. Read about asmx. And this webservice client has to read it from the other side

  • 1

    Your question is only whether it is possible? Or you are developing and there is some punctual doubt?

  • Why Web Service? Use something new, young. Web API, for example.

  • The question Renan, is to know if it is the Webservice who will make the insertions in the customers' comic book or if he will send the changes to the customer to do the same. How will he know who the customers are? I must have stored all the customer information in WS?

1 answer

3


I think you need to be very careful with architecture. A lot is possible, but not everything is viable or interesting for you.

Feasibility

How much information will you send to an external system? If the volume is large, sometimes it is not feasible to format everything with XML. So there is database replication, computers on protected networks etc. You may find that the volume is small, but you need to be careful. Small operations are not always easy to replicate. It’s easy to command new lines inserted in a register table. But if you have a table of balance of customer accounts, updated every day, will have to send the whole table every day.

Architecture

Also you need to think architecture. Send data does not mean you need to be active. You can be an integrator liabilities.

For example, you may have tables that register who customers are who can get information from you with a security token/key. From X to X time the client access a webservice in your application with this token and your application warns if you have data to integrate.

Then you create control tables, for each client, which was the last integrated record etc. And then you send a set of records since the last time he asked. You can also ask him to send the last code he was able to successfully insert (a date for example). But then you need to put fields throughout the database (the tables you want to integrate) with update dates to ensure you always send everything right.

Even so, always send paginated. Do not let accumulate much information.

Advantages of passive mode:

  • You create a protocol for your data. If an external company wants to access it, you won’t run the risk of each one publishing a web service with a slightly different name, one in java another in C#, with some integration problems that you will be responsible for dealing with. If they need access, they access it and that’s it.

  • If there are constant communication failures, the customer may be directly responsible for their implementation, even if the failure is on the client’s side. When you guarantee that you can deliver the data and get it back showing to the customer, very hard you will need to have a lot of headaches every time you fall integration

Information

Your webservice always exposes data. If you want to send something actively, you need the customer to expose a webservice to you. Then he needs to implement the insertion routines in his base. The same goes for passive mode. You can send the information whenever he asks for it, but he will always be responsible for how to store it.

Tip

If you are creating the client and server, use passive mode whenever possible. But first of all, consider very well the possibility of data replication by the bank when the volume is high.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.