PDA

View Full Version : Two sites, one database


deniser
7th November 2008, 14:38
I know a little about SEO and about selling my product online but nothing at all about how websites are made/work and wonder if someone could kindly help me?

I have one website which has been up and running for over 2 years. This has a database attached to it which doubles up as my stock database.

Website 1 has a number of product categories. I have now set up website 2 which will sell products from only one of those categories on a different server with a different host (in case something drastic happens to the server for website 1) and to cushion me in case website 1 falls out of favour with Google.

My question is, can both websites use the same database in some way (although it is currently on server 1 so if that went down I would be stuffed anyway) or do I have to have two separate ones? When someone buys a product the item count reduces down automatically and tells the customer if they try to order more than the available number. This would need to work across the two sites.

Is there are way to do this or have duplicate databases that are linked in some way? Hope this makes sense!

wood1e2
7th November 2008, 14:47
There are ways of connecting to one database, but basically you are duplicating the content, so I don't see the benefit in terms of SEO.

deniser
7th November 2008, 14:52
There are ways of connecting to one database, but basically you are duplicating the content, so I don't see the benefit in terms of SEO.

No, the content will be completely different if you mean in terms of the structure of the site, headings, categories, copy, photography.

Only the actual physical product sold will be the same - the only thing in common will be the product code and the quantities of each size available.

sysops
7th November 2008, 15:02
There are ways of connecting to one database, but basically you are duplicating the content, so I don't see the benefit in terms of SEO.

This is often said, but is really not true.

Say I have a site selling food, myfinefoods.co.uk. One of my categories is cheese, and I have a fantastic range of cheeses on there.

I would definitely benefit from setting up another site, finestcheese.co.uk, which is purely optimised for cheese. I would be likely to sell a lot more cheese there than I do in my general site, because a) it would rank better and b) it would convert better (all else being equal).

TotallySport
7th November 2008, 15:03
You can get the web site to access the DB (database) on the other site, but in terms of processing speed and effort, it isn't generally recommended for the whole application, why didn't you set it up on the same server it would have been much easier, although if it's on shared hosting it is whether the hosting company would allow you to but then again if it's on shared hosting it is unlikely they will allow the external site to access the DB.

Depending on how it is written and you want to go into it, you could write a script that would equalise the information on the systems and have one master and one slave, or you could right and API application but it's a bit over kill.

sysops
7th November 2008, 15:04
My question is, can both websites use the same database in some way (although it is currently on server 1 so if that went down I would be stuffed anyway) or do I have to have two separate ones? When someone buys a product the item count reduces down automatically and tells the customer if they try to order more than the available number. This would need to work across the two sites.

This can be done, but in order to do it you need to have admin privileges on both servers. This is because most shared web hosting is configured in a safe, restricted way, so that PHP on one server can't make db connections to other servers.

DotNetWebs
7th November 2008, 15:04
I agree with sysops.

Regards

Dotty

EDIT was referring to his first post.

nickpp
7th November 2008, 15:42
Cpanel makes it really easy to allow a remote ip access to mysql, as already mentioned would be easier to run it all locally off one DB.