Forums / General Questions / Database Connectivity - Using a different server

Database Connectivity - Using a different server

Locked
Results 1 to 12 of 12
This thread is locked. New replies are disabled.
23 Aug 2010, 20:39
#1
ecomuser2010 avatar

ecomuser2010

New Zenner

Join Date:
Aug 2010
Posts:
7
Plugin Contributions:
0

Database Connectivity - Using a different server

Hi there,

I currently have 2 stores running:

Store A - a store that users can purchase products from
Store B - another zen cart set up with the exact same products as Store A.


My question is, is there any way for Store A to pull it's product info and store it's sales in Store B?
I want all users to use Store A but have all database connectivity go to Store B. Store's A's DB should be disregarded completely.


They are on seperate domains & servers. If you have any questions, please let me know. Otherwise, I appreciate any input given!
23 Aug 2010, 20:44
#2
ecomuser2010 avatar

ecomuser2010

New Zenner

Join Date:
Aug 2010
Posts:
7
Plugin Contributions:
0

Re: Database Connectivity - Using a different server

Just to illustrate a bit better, the flow of the transaction would go like this:

ADD TO CART IN STORE A

\/

CHECKOUT PROCESS AND PAYMENT IN STORE A

\/

WRITE ALL DATA TO DATABASE IN STORE B



Orders would be then processed from the back end of Store B
23 Aug 2010, 20:54
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,506
Plugin Contributions:
173

Re: Database Connectivity - Using a different server

Um ... why?
There's a whole lot of information missing from your post, and thus a proper answer is impossible without understanding the much bigger picture of what you're trying to do and why.

Why have 2 stores at all?
Why force your customers into delays while one store is trying to read data over a slow connection to another server to find data that can/should already be in its own database anyway?
Why cripple half of two stores just to name them "A" and "B" when there's no functional difference between them in the end?
24 Aug 2010, 01:14
#4
ecomuser2010 avatar

ecomuser2010

New Zenner

Join Date:
Aug 2010
Posts:
7
Plugin Contributions:
0

Re: Database Connectivity - Using a different server

It's been requested by a client. I've tried to deter them from it but this is what they really want. They plan on having multiple stores on different servers write to one single database.
24 Aug 2010, 01:29
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,506
Plugin Contributions:
173

Re: Database Connectivity - Using a different server

If those stores are on different servers, then they have no idea what they're really getting into. Seriously.

(Databases housed on separate servers introduce significant delays in getting responses back when reading and writing the data. That's not a prudent thing to do in real-time customer-interaction websites.)

I suggest that if they really want something akin to what you've described in your posts, that a different approach be used, whereby each store stands on its own but simply sends the appropriate data back and forth to the other databases on a scheduled basis. Otherwise you'll have serious performance problems which will cause customers to give up waiting for the data to show up.
Having each store stand on its own also gives redundancy in case one of the other servers may go down or be unreachable for some reason outside your control.

I suggest hiring someone who understands servers and databases very well when you consider designing the architecture of the solution for your client, regardless what solution you ultimately select.
24 Aug 2010, 02:02
#6
ecomuser2010 avatar

ecomuser2010

New Zenner

Join Date:
Aug 2010
Posts:
7
Plugin Contributions:
0

Re: Database Connectivity - Using a different server

Thank you very much for your input. I do actually have someone who actually owns a small hosting company setting it up. The more info I have the better as he's never done anything like this himself either.

I did think of the timed intervals to send the info to the other DB but the client is absolutely requires that the transactions run through the "Other Cart". Sending every 6 hours, for example, would still mean that the transactions are running through the current store.
24 Aug 2010, 02:05
#7
ecomuser2010 avatar

ecomuser2010

New Zenner

Join Date:
Aug 2010
Posts:
7
Plugin Contributions:
0

Re: Database Connectivity - Using a different server

If both carts were moved on the same server, would we have the sam performance issues ?
24 Aug 2010, 02:15
#8
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,506
Plugin Contributions:
173

Re: Database Connectivity - Using a different server

If they're physically on the same server, the performance issues to which I was referring are unlikely to be a problem.
24 Aug 2010, 02:16
#9
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,506
Plugin Contributions:
173

Re: Database Connectivity - Using a different server

ecomuser2010:

It's been requested by a client. I've tried to deter them from it but this is what they really want. They plan on having multiple stores on different servers write to one single database.


So, they *say* they want "different stores writing to one database".

But does that really mean they actually need different *stores*?
Or just different visual presentations of the stores? ie: maybe just "looks like" different sites?

Why *exactly* do they think they want different "stores"? What *exactly* do they mean by that?

(You already said that all the products are the same ... so really it's not different stores as far as I can tell from what I've read thus far.)
24 Aug 2010, 02:31
#10
ecomuser2010 avatar

ecomuser2010

New Zenner

Join Date:
Aug 2010
Posts:
7
Plugin Contributions:
0

Re: Database Connectivity - Using a different server

They want one master store. Say for example they have 5 other stores with 5 products in each (all different), they want 1 master store with 25 different products in it that they run all the transactions through and write to that 1 database.

I know, it's strange. They're way more successful than I though, so who am I to question.
24 Aug 2010, 03:16
#11
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,506
Plugin Contributions:
173

Re: Database Connectivity - Using a different server

Your first post left me with the impression that all the stores would have all the same products in them.

What you're talking about, while possible, is very complicated and prone to problems if not done well.
To do that is going to require a notable investment of time and custom coding.
And future upgrades will be ... well ... complex.

I really hope there's a lot more than just 5 products, else the amount of effort required isn't worth it.

Nevertheless, yes, it's possible. I wish you well !
24 Aug 2010, 04:43
#12
ecomuser2010 avatar

ecomuser2010

New Zenner

Join Date:
Aug 2010
Posts:
7
Plugin Contributions:
0

Re: Database Connectivity - Using a different server

Apologies for being a bit confusing, it's not easy to explain.

The first store attached to the 'master' one is goin to have the exact same products. After that each other store (selling different items) would have to have their items added to the mater one.

However, given the point about performance issues, this probably isnt a great solution, maybe it'd work well for 1 store if it was sat on the same server but otherwise like you said, it'd run slowly.

Anyway, thank you for your input, there wasn't too much online to research with :)