Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Design and Architecture
  4. Dynamic DB Connection based on user type

Dynamic DB Connection based on user type

Scheduled Pinned Locked Moved Design and Architecture
databasequestionsql-serverdesignsysadmin
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vicky457
    wrote on last edited by
    #1

    I need to create an application: upon user login, check the user type and decide the database that application will use for that user. Here is what I have: 1: Master database: stores user information and application configuration data, such as which db to use and connection string 2: Database I on server 1: contains all the application data for user group I. 3: Database II on server 2: contains all the application data for user group II. 4: Database I backup on server 2: as backup for user group 1 in case server 1 fails. 5: Database II backup on server 1: as backup for user group 2 in case server 2 fails. 6: Through log shipping between server 1 and server 2 to keep DB I and I and their backup up-to-date. 7: The web site is running on web farm. The session state management is using SQL server session state management, which is on the same server as Master DB. My questions are: 1: How do I determine if server 1 or server 2 is down and it's time for application switching to use the DB backup on the other server. 2: What to do if the master DB server is down? 3: Is there a better approach than the above design to achieve the same goals: using different DB for different users, and achieving fast recovery by using the backup server? I would really appreciate any suggestion and help! Thanks in advance!

    L M 2 Replies Last reply
    0
    • V vicky457

      I need to create an application: upon user login, check the user type and decide the database that application will use for that user. Here is what I have: 1: Master database: stores user information and application configuration data, such as which db to use and connection string 2: Database I on server 1: contains all the application data for user group I. 3: Database II on server 2: contains all the application data for user group II. 4: Database I backup on server 2: as backup for user group 1 in case server 1 fails. 5: Database II backup on server 1: as backup for user group 2 in case server 2 fails. 6: Through log shipping between server 1 and server 2 to keep DB I and I and their backup up-to-date. 7: The web site is running on web farm. The session state management is using SQL server session state management, which is on the same server as Master DB. My questions are: 1: How do I determine if server 1 or server 2 is down and it's time for application switching to use the DB backup on the other server. 2: What to do if the master DB server is down? 3: Is there a better approach than the above design to achieve the same goals: using different DB for different users, and achieving fast recovery by using the backup server? I would really appreciate any suggestion and help! Thanks in advance!

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      There are commercial products that work with Databases to perform mirroring, monitoring and automatic rollover on failure. Is something like that an option for you? Trying to roll your own solution will certainly be a sizeable effort and you will likely not achieve the level of confidence a commercial product will have.

      led mike

      V 1 Reply Last reply
      0
      • L led mike

        There are commercial products that work with Databases to perform mirroring, monitoring and automatic rollover on failure. Is something like that an option for you? Trying to roll your own solution will certainly be a sizeable effort and you will likely not achieve the level of confidence a commercial product will have.

        led mike

        V Offline
        V Offline
        vicky457
        wrote on last edited by
        #3

        We just got the second database server and plan to divide users into two two servers. Unless the tool can utilize both servers, we will go with own solution. What product do you recommend? Thanks!

        1 Reply Last reply
        0
        • V vicky457

          I need to create an application: upon user login, check the user type and decide the database that application will use for that user. Here is what I have: 1: Master database: stores user information and application configuration data, such as which db to use and connection string 2: Database I on server 1: contains all the application data for user group I. 3: Database II on server 2: contains all the application data for user group II. 4: Database I backup on server 2: as backup for user group 1 in case server 1 fails. 5: Database II backup on server 1: as backup for user group 2 in case server 2 fails. 6: Through log shipping between server 1 and server 2 to keep DB I and I and their backup up-to-date. 7: The web site is running on web farm. The session state management is using SQL server session state management, which is on the same server as Master DB. My questions are: 1: How do I determine if server 1 or server 2 is down and it's time for application switching to use the DB backup on the other server. 2: What to do if the master DB server is down? 3: Is there a better approach than the above design to achieve the same goals: using different DB for different users, and achieving fast recovery by using the backup server? I would really appreciate any suggestion and help! Thanks in advance!

          M Offline
          M Offline
          Mark Churchill
          wrote on last edited by
          #4

          and if the master database goes down....? :P

          Mark Churchill Director, Dunn & Churchill Pty Ltd Free Download: Diamond Binding: The simple, powerful, reliable, and effective data layer toolkit for Visual Studio.
          Alpha release: Entanglar: Transparant multiplayer framework for .Net games.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups