1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

2 sites run on same database

Discussion in 'MySQL' started by l234244, Aug 9, 2005.

  1. #1
    Is it possible to have 2 sites hosted on seperate servers to run off the same database. I know if they were on the same server its possible but not sure about different servers. Possibly just change the host name to "domain.com" or something
     
    l234244, Aug 9, 2005 IP
  2. JoeO

    JoeO Peon

    Messages:
    431
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    0
    #2
    It is possible. As long as the database will accept connections from remote locations. You will need to check with your host.
     
    JoeO, Aug 9, 2005 IP
  3. l234244

    l234244 Peon

    Messages:
    1,225
    Likes Received:
    50
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks Joe
     
    l234244, Aug 9, 2005 IP
  4. iShopHQ

    iShopHQ Peon

    Messages:
    644
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I have 40+ sites running off the same database server. Some are co-located, others are remote. As long as you can connect through an IP address (you can with SQL Server and MySQL) youshould be good to go-
     
    iShopHQ, Aug 16, 2005 IP
  5. SpeedyDomainRegistration

    SpeedyDomainRegistration Peon

    Messages:
    170
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I'm thinking of security issue with accessing database from different servers.

    I do believe that the connection not set on secure channel so it is possible for sniffers to catch the datastream.

    I guess this would be ok for data that is not very important.
    Database with login credential would probably be a no no.
    _________________
    Pagerank Checker Tool | Cheap Domain Name Registration | Free Web Hosting |
     
  6. anton-io!

    anton-io! Active Member

    Messages:
    540
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    58
    #6
    I also have a number of domains accessing one database - they are one the same server though.

    If you have cpanel, you are able to set up hosts who are able to access the database. I use this to have my local database manager (EMS) access the database online.

    Within cpanel, go to mysql databases, should be at the bottom, 'Access Hosts'
     
    anton-io!, Aug 19, 2005 IP
  7. l234244

    l234244 Peon

    Messages:
    1,225
    Likes Received:
    50
    Best Answers:
    0
    Trophy Points:
    0
    #7
    There is no important information in the database just content data.

    Thanks for the advice but I have plesk :(
     
    l234244, Aug 20, 2005 IP
  8. JamieC

    JamieC Well-Known Member

    Messages:
    226
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    138
    #8
    It's best to be careful about having your database server in a different geographic location to your webserver.

    It will certainly work, so long as you configure it right and have a database that can work through a TCP/IP pipe (mySQL, then...), however you will almost certainly suffer speed issues unless your colocation / dedicated providers are top quality.

    Do some testing before committing yourself to any contracts / design decisions would be my advice.
     
    JamieC, Aug 23, 2005 IP
  9. ferret77

    ferret77 Heretic

    Messages:
    5,276
    Likes Received:
    230
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Can you access mysql databases via ip remotely, I thought you could only do that with sqlserver
     
    ferret77, Aug 23, 2005 IP
  10. JamieC

    JamieC Well-Known Member

    Messages:
    226
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    138
    #10
    Yeah definitely, so long as you access the database using TCP/IP. I use mySQL and ASP.NET, and have been successfully running my scripts on a test machine at my house from a test database on one of our colocated servers.

    http://dev.mysql.com/downloads/connector/net/1.0.html

    As for the original question - here's a few things to add to your todo list:

    - Make sure the relevant ports are open on your firewall and that any NAT is working correctly
    - Find out what DB your ISP use, then verify that that DB allows connections over TCP/IP
    - Verify that your ISP have configured your DB to accept connections from outside their subnet.
     
    JamieC, Aug 23, 2005 IP
  11. Enigma121

    Enigma121 Peon

    Messages:
    40
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #11
    We'd recommend if you are remote from your database that all data queries are encrypted. Even if your data isn't too critical, I'm sure you'd be annoyed if some script kiddie replaced your data with web graffiti.

    VPN is an option, or alternatively establish a connection over SSH then port forward the database connection to your host.

    If correctly implemented either option will prevent your login details from being revealed.
     
    Enigma121, Sep 5, 2005 IP
  12. Shoemoney

    Shoemoney $

    Messages:
    4,474
    Likes Received:
    588
    Best Answers:
    0
    Trophy Points:
    295
    #12
    I have 12 servers currently running off of 2 master databases. Its really the way to go if you can do it.
     
    Shoemoney, Sep 9, 2005 IP
  13. emil2k

    emil2k Well-Known Member

    Messages:
    1,391
    Likes Received:
    80
    Best Answers:
    0
    Trophy Points:
    138
    #13
    i would need this i have an article database
     
    emil2k, Sep 10, 2005 IP
  14. john_loch

    john_loch Rodent Slayer

    Messages:
    1,294
    Likes Received:
    66
    Best Answers:
    0
    Trophy Points:
    138
    #14
    I'd be careful about it. You're taking a big risk if you plan to pass queries in real time between your web app and a remote MySQL db. Basically, if there is a hiccup anywhere along the way, you can end up with a dead site. Or if a temporary bottleneck/congestion is encountered, your site can end up too slow (not good for bots etc).

    The only time I've bothered to do this sort of thing is when using cron/batch jobs to sync dbs every 24 hours. You can do it with most dbs including MySQL, MSSQL etc.

    Cheers,

    JL
     
    john_loch, Sep 12, 2005 IP
  15. Shoemoney

    Shoemoney $

    Messages:
    4,474
    Likes Received:
    588
    Best Answers:
    0
    Trophy Points:
    295
    #15
    I think its great if your site is small enough you can do everything on 1 machine. I try to do that when possible but unfortuantly as your site grows you will find you need a dedicated sql box. Also once you implement multiple web frontends its just not a option to have sql on the localhost.

    That is why you have redundancy and failover =).
     
    Shoemoney, Sep 12, 2005 IP
  16. iTISTIC

    iTISTIC Peon

    Messages:
    140
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #16
    Shouldn't be a performance problem if the db server and web servers are on the same network (in other words the packets won't have to travel across the net). If they are not on the same network, my experience has been that the performance is less than acceptable for me. It would all depend on the amount of data you query at one time, however. You will surely notice a decrease in speed, but if it's still acceptable, then it may work for you.
     
    iTISTIC, Sep 12, 2005 IP
  17. john_loch

    john_loch Rodent Slayer

    Messages:
    1,294
    Likes Received:
    66
    Best Answers:
    0
    Trophy Points:
    138
    #17
    Yes, actually I was unclear about that.. obviously it's fine if the boxes are on the same sub/net.. I was referring more to distribution across providers and what have you. :)

    What you get for posting at 2 in the am.. :)

    Cheers,

    JL
     
    john_loch, Sep 12, 2005 IP
  18. ozgression

    ozgression Well-Known Member

    Messages:
    343
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    140
    #18
    But what about the issue of duplicate content/sites?
     
    ozgression, Sep 12, 2005 IP
  19. iTISTIC

    iTISTIC Peon

    Messages:
    140
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #19
    I'd just install a copy of the database on the remote server, create a second copy of a page that has more db operations than most, change the connection string to the db in that page so it uses the copy on the remote server and test the performance. If you're just doing simple data updates and not pulling back a lot of data it won't be HORRIBLE. If you're pulling back larger result sets, however, you'll probably be quite disappointed in the response time.
     
    iTISTIC, Sep 12, 2005 IP
    Nitin M likes this.
  20. buonchit

    buonchit Member

    Messages:
    43
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #20
    If you're pulling back larger result sets, however, you'll probably be quite disappointed in the response time. :")
     
    buonchit, Sep 14, 2005 IP