Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Sharing A Database

Posted on 2015-01-26
6
Medium Priority
?
51 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 84

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
Independent Software Vendors: 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!

 
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 111

Accepted Solution

by:
Ray Paseur earned 2000 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

636 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