Solved

Sharing A Database

Posted on 2015-01-26
6
45 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 35

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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
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 35

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 110

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

749 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