Omega Owners Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Please check the Forum Guidelines at the top of the Newbie section

Pages: [1] 2 3  All   Go Down

Author Topic: Any MS SQL Server Experts?  (Read 1854 times)

0 Members and 1 Guest are viewing this topic.

TheBoy

  • Administrator
  • *****
  • Offline Offline
  • Gender: Male
  • Brackley, Northants
  • Posts: 107162
  • I Like Lockdown
    • Whatever Starts
    • View Profile
Any MS SQL Server Experts?
« on: 16 July 2009, 18:37:25 »

I can bluff my way around MS SQL server, but got a question for any experts/architects about replication.  Looking at Transactional Replication.

Got multiple SQL Servers that can communicate via slow WAN links which feasibly may not always work. Each SQL Server deals with SQL queries and updates from multiple, local clients. When a client creates a new record, it indexes and uses the seed, that set to autoincrement.

Need to have a single database that is replicated (entirely) around those SQL Servers.

OK, so I will set up a distributor, and each one as a publisher and subscriber, no issues with that.


My question(s): Conflicts.

What happens if 2 records are created at exactly the same time (or at a time when the WAN link isn't working) at different sites? Will they get same seed?

What happens if one client reads a value from a field, decrements it, and write is back, and another client at another site does similar before its replicated? Does it only decrement once? Twice?


Anyone KNOW the answers? Is transactional replication the best replication to use?
Logged
Grumpy old man

cem_devecioglu

  • Guest
Re: Any MS SQL Server Experts?
« Reply #1 on: 16 July 2009, 18:48:24 »

reading and thinking..
Logged

Jimbob

  • Global Moderator
  • *****
  • Offline Offline
  • Gender: Male
  • Chester / Flintshire
  • Posts: 24530
  • I like traffic lights, but only when they're green
    • E250 Est / Golf GTI
    • View Profile
Re: Any MS SQL Server Experts?
« Reply #2 on: 16 July 2009, 18:50:44 »

If I was in work I can ask the DBA's unlikely to be in for a week or so.

Can mail them if you dont get the true answer here  :y

cem_devecioglu

  • Guest
Re: Any MS SQL Server Experts?
« Reply #3 on: 16 July 2009, 18:51:49 »

the most critical question is what development environment is used.. if .net solution very very easy..
Logged

cem_devecioglu

  • Guest
Re: Any MS SQL Server Experts?
« Reply #4 on: 16 July 2009, 18:53:52 »

you can use unique identifier data type which brings definitely a unique value even across the servers..

http://msdn.microsoft.com/en-us/library/ms187942.aspx
« Last Edit: 16 July 2009, 19:15:43 by cem_devecioglu »
Logged

cem_devecioglu

  • Guest
Re: Any MS SQL Server Experts?
« Reply #5 on: 16 July 2009, 18:55:59 »

for those multiple client server environments database defined autoincrement value or value from a fixed server/table keys/indexes are not suitable..will bring many problems..
« Last Edit: 16 July 2009, 19:16:17 by cem_devecioglu »
Logged

cem_devecioglu

  • Guest
Re: Any MS SQL Server Experts?
« Reply #6 on: 16 July 2009, 18:58:19 »

if transactions are critical (sure is)  the best way to use : microsoft distributed transaction coordinator..

and you can use 2 phase commit in every possible way..

replication must be used mostly for reporting purposes I think.. as I worked for a bank previously ,
we used mostly transaction coordinators..

Here is how it works :

1 - you define the remote servers to insert update delete for every server and log on user password parameters..

2 - you define the triggers for the related tables for inserts updates including the remoteserver.dbo.tablename..

3  - you start msdtc server service in every server ..

4 - from the application you can start inserts and watch what goes on.. (of course by using unique identifier) ..

5 - my advice will be also using the client user name and recording time extra fields..

6 - you can use dtcping utility to check also if things go wrong
« Last Edit: 16 July 2009, 19:07:35 by cem_devecioglu »
Logged

Taxi_Driver

  • Guest
Re: Any MS SQL Server Experts?
« Reply #7 on: 16 July 2009, 19:03:40 »

I havent a clue.....but and this maybe a daft suggestion, Microsoft might know  :-/ :D

Dunno if that would cost you a few sheckles, depends on support contract I guess  :-/
Logged

cem_devecioglu

  • Guest
Re: Any MS SQL Server Experts?
« Reply #8 on: 16 July 2009, 19:09:35 »

but as a note the application must be specifically designed for that kind of use..

trying replication also can work but will be more complex to manage and maintain..

by the way msdtc will not be insistent for continuous wan link..when its open it will start to send..
« Last Edit: 16 July 2009, 19:11:06 by cem_devecioglu »
Logged

cem_devecioglu

  • Guest
Re: Any MS SQL Server Experts?
« Reply #9 on: 16 July 2009, 19:19:02 »

Quote
I can bluff my way around MS SQL server, but got a question for any experts/architects about replication.  Looking at Transactional Replication.

Got multiple SQL Servers that can communicate via slow WAN links which feasibly may not always work. Each SQL Server deals with SQL queries and updates from multiple, local clients. When a client creates a new record, it indexes and uses the seed, that set to autoincrement.

Need to have a single database that is replicated (entirely) around those SQL Servers.

OK, so I will set up a distributor, and each one as a publisher and subscriber, no issues with that.


My question(s): Conflicts.

What happens if 2 records are created at exactly the same time (or at a time when the WAN link isn't working) at different sites? Will they get same seed?

What happens if one client reads a value from a field, decrements it, and write is back, and another client at another site does similar before its replicated? Does it only decrement once? Twice?

Anyone KNOW the answers? Is transactional replication the best replication to use?

the best and appropriate way is to avoid incrementing or decrementing common tables or numbers..

you can use two phase commit and many kinds of locking but these will cause real headaches..(done that and lived many problems)

ps: I hope I could explain the picture :-[
« Last Edit: 16 July 2009, 19:32:50 by cem_devecioglu »
Logged

TheBoy

  • Administrator
  • *****
  • Offline Offline
  • Gender: Male
  • Brackley, Northants
  • Posts: 107162
  • I Like Lockdown
    • Whatever Starts
    • View Profile
Re: Any MS SQL Server Experts?
« Reply #10 on: 16 July 2009, 19:38:04 »

thanks. Not going to modify the app too much (needs a rewrite, but thats a longer term goal), so looking for SQL Server to do the replication in background.

My orig Qs remain:
Using Transactional server-server replication, will I automatically avaoid the conflicts in 1st post?
Logged
Grumpy old man

cem_devecioglu

  • Guest
Re: Any MS SQL Server Experts?
« Reply #11 on: 16 July 2009, 19:49:08 »

Quote
thanks. Not going to modify the app too much (needs a rewrite, but thats a longer term goal), so looking for SQL Server to do the replication in background.

My orig Qs remain:
Using Transactional server-server replication, will I automatically avaoid the conflicts in 1st post?

without seeing the actual application code and data types its hard to predict :-/

but if you add extra fields like server name or such  and include in primary key fields in addition to autoincrement values this may help me thinks..
Logged

tunnie

  • Get A Life!!
  • *****
  • Offline Offline
  • Gender: Male
  • Surrey
  • Posts: 37593
    • Zafira Tourer & BMW 435i
    • View Profile
Re: Any MS SQL Server Experts?
« Reply #12 on: 16 July 2009, 19:58:52 »

shouldn't the distributor prevent DB locks / simultaneous records being written?
Logged

cem_devecioglu

  • Guest
Re: Any MS SQL Server Experts?
« Reply #13 on: 16 July 2009, 20:04:06 »

Quote
shouldn't the distributor prevent DB locks / simultaneous records being written?

imho easiest way is to set up the scenario and test.. :-/

the solutions may be applied after..
« Last Edit: 16 July 2009, 20:04:40 by cem_devecioglu »
Logged

TheBoy

  • Administrator
  • *****
  • Offline Offline
  • Gender: Male
  • Brackley, Northants
  • Posts: 107162
  • I Like Lockdown
    • Whatever Starts
    • View Profile
Re: Any MS SQL Server Experts?
« Reply #14 on: 16 July 2009, 20:29:06 »

Quote
shouldn't the distributor prevent DB locks / simultaneous records being written?
WAN (possibly unreliable) links mean it has to use queued transactional replication.  So distributor may not always be available ;)
Logged
Grumpy old man
Pages: [1] 2 3  All   Go Up
 

Page created in 0.012 seconds with 17 queries.