Solved

Sharing A Database

Posted on 2015-01-26
6
44 Views
Last Modified: 2015-02-11
Is it possible and OK for two websites to share a database?  If I have two websites on two different hosting servers and services, is it ok for one Website to share/look at a database used by another website?

Website Number One would be implementing, editing, adding data and interacting with the Database.
Website Number Two would be looking at the info on the database, not interacting or editing.

This seems ok but am I missing something?  Are there best practices to consider?  Security issues?

Thanks in advance!
0
Comment
Question by:rgranlund
6 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 40570853
yes, that is perfectly possible. usually you should have 1 central place (webservices for example is a good way) to access the db from "anywhere", and the web sites using those webservices exclusively to make sure that the data is read/updated the same way indeed from any application
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 40571033
Some hosting services like Godaddy will not allow you connect to a database server on another outside hosting/server.  Test it before you commit to it.

And some don't allow external access to the database servers.  At all.
0
 
LVL 34

Expert Comment

by:gr8gonzo
ID: 40571148
Just general thoughts:

1. In terms of security, every additional access point to the database can be considered a security issue. That's not a bad thing - just something you have to keep in mind when you design solutions. It's like adding another door onto a house - you have to just make sure all your doors are locked in order to be secure - you can't just lock the front door and leave the others unlocked and expect to be secure.

2. It's good that you can identify that Website #2 will ONLY be reading from the database. That means you can create different credentials that ONLY have reading (SELECT) privileges, and in case that website is compromised, it won't be AS bad as if you lost full admin credentials. It's still bad, though, and information can be as good as gold in terms of gaining additional access, so it's still a priority to make both sites as secure as possible.

3. The database engine you use will make a big difference in how you do things. For example, if you have a lot of visitors on website #2 and expect to be doing a lot of updating/writing to the database on website #1, then you might want to consider using the InnoDB engine in MySQL. A lot of people use the default MyISAM engine, but when you make updates to a table in MyISAM, it locks the entire table, which can impact people who are trying to access the data in that table. Of course, if you don't update the tables often, or if you don't have a lot of traffic, it's not a big deal. If you're a MySQL novice, then you can USUALLY consider InnoDB tables to basically act like MyISAM tables, but with a few advantages.
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 7

Author Comment

by:rgranlund
ID: 40571153
Well I guess my question is this;
How do I display information from an outside DB on my website?
0
 
LVL 34

Expert Comment

by:gr8gonzo
ID: 40571198
What do you mean "outside DB" - are you talking about the central DB you're referring to in your original post?
0
 
LVL 109

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 40571626
Ask your hosting company how to connect to the databases.  This will do two important things.  First, it will probably get you an answer complete with an example, and second, it will verify that the host intends to be able to support this sort of thing.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Many companies are looking to get out of the datacenter business and to services like Microsoft Azure to provide Infrastructure as a Service (IaaS) solutions for legacy client server workloads, rather than continuing to make capital investments in h…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question