VSS Utility

Current Project as i blogged before, I am facing a problem. It is a synchronization problem from offshore. Refer to previous blog for more information. Well I have been thinking about a solution to this problem. There are a couple of solutions to this problem. I might try to find a solution to this problem by upping the technology, or I might try to solve this problem by upping the process.

The ways I can solve this problem upping technology are I upgrade from Visual Studio 2002 to Visual Studio 2005 Team System, which is not feasible from the cost perspective, I try to find a utility that would give me a better performance on the network, or try to work on improving the network connectivity. And there is always a cost crunch on every project (as we all developers know) and the idea purchasing of licenses are always sneered at. So purchasing a tools is again not a good enough solution.

There are some network latency issues at the client site in our project, that cannot be avoided so making the network more efficient is not really that feasible a solution. I haven't come across a utility that would solve this problem until now. The search continues, but the solution cannot wait long enough. What I am thinking at this point is that the delay in the check in and check out is only at a real time level.

I am trying to think of a solution like this. There should be a VSS database snapshot offshore. Now this snapshot is synchronized with the actual VSS database everytime there is a change in the snapshot or on the VSS Server. The offshore users are checking files in and out of this snapshot. This snapshot provides an abstraction layer between the actual VSS database onsite and the offshore user. This would help get by the network latency.

Everytime A file gets checked out onsite, a message is sent back to the remote snapshot and the snapshot synchronizes itself for that file alone. Whenever a file is changed and checked in offshore, a signal is sent to the VSS Server onsite and the snapshot offshore synchronizes itself again. All this happens on a separate thread and not when the user is actually doing it. So the user gets the illusion that everything is happening on his machine itself or at the most on his local network.

There could be a few concurrency issues in case of multiple checkouts, but the disconnected CVS model really works here well. e.g. onsite user checks out a file. offshore user checks out the same file. Onsite user changes and checks in a file. Now before the message is sent to the offshore snapshot, The offshore user also checks in a file. would both the changes be merged and how. The solution according to the CVS model is simple. Onsite user checks out a file, signal sent to offshore snapshot. Offshore user checks out file, he is alerted that the file has already been checked out. Suppose offshore user checks out simultaenously with the onsite user. Checkout is successful. Now when the user checks in the file, if the synchronization has happened, whoever checks in first is alerted that the file has been checked out by another user and whether he would like to override that checkout or wait. If the user chooses override, the second person who checks in is alerted that the file has changed and is given the choice to merge the changes.

There are a no. of concurrency scenarios, wost case scenario is when both the users check out and check in a file simultaenously and before synchronization occurs. in this case, when the synchronization occurs, the last user who has checked in the file could be alerted about the change and should be asked to merge the changes. This is a work in progress and a good food for thought for everyone. .

Multiple check out is a great feature but then it has its own complexities, specially on an onsite offshore model. Now the thing is if I can think of a technology solution like that, I am sure there must be people who have already thought about this and written code. I am looking but I can't find anything like that. Besides that what I would really like to know is this. Does Microsoft expose any API or Framework for the VSS that would easily allow us to check in and check out files from a VSS Database programmatically? If yes, what is it called? how can I procure it? I intend to write a utility like that, sort of a plug in that integrates with VSS.

This is the technology standpoint. On the other hand we can solve this issue strategically also.

Set up two VSS databases onsite and offshore. Two build managers onsite and offshore. The build managers maintain discipline among their respective teams and generate releases that compile, build and run. These build managers synchronize the source code between the VSS databases onsite and offshore. This process needs a lot of discipline and it is also a maintainance nightmare.

Besides that I can't think of any solution right now. Thoughts are welcome

2 Comments

  • VSS has an API in COM and easier still a command line option set. Products like SourceOffsite use the API and you can use the coomand line tools to build a script to do the needful

  • Upgrade to VSS 2005. It has a new service that speeds up access over a LAN so that it's not so chatty, especially if you're working across a VPN or slow connection. Also, if you're using Visual Studio 2005, you can also enable VSS 2005's Web services for even speedier usage.

Comments have been disabled for this content.