bdmovies Posted December 31, 2008 Share Posted December 31, 2008 Say I've got this: Company A needs to utilize the services of Company B. Both Companies are using my application. Company A can assign Company B to the job. <-- This sounds simple enough, Company A needs to create a profile for Company B and can then just assign them as needed (Company B would be equivilant to an employee in Company A, but Com. B is serving some area of the country where A does not have employees). Now the cool part. When A assigns B to the job, B gets the information automatically added to it's DB. A and B's servers are both sitting on the companies local servers. So, I need a way to get the info from A to B. Here are my possible solutions: 1. I've got a "Mothership" server that gets updated when A assigns B. Then, B queries the Mothership DB to see if they have a new job. Pros to 1: I can keep my DB schema from A to mothership to B. It's conservative (I know this would work) Cons to 1: Any changes to schema would have to be reflected on the mothership server. HEAVY traffic on the mothership database. The query from A to Mship would have to occur periodically (Like, every few seconds, minutes at most.) If I just had A and B companies it would be fine, but looking into the future, what happens when I've got companies A, B, C, all the way through ZZ? Or, in reality, when we've got a network of hundreds of companies (Our target number of clients is in the 100's). 2. Use SOAP to work directly with A and B, no mothership needed. Pros to 2 No mothership Cons to 2: I have no knowledge of SOAP. Heavy traffic on each companies servers That's where I am at now. I was also contemplating an XML based file containing all of the info needed, and storing that file in the DB. I still have lots of calls to the DB, but the DB is smaller in size. I also thought about using XML and a file system on the mothership server, but that sounds dangerous. Thoughts? Quote Link to comment https://forums.phpfreaks.com/topic/139035-mothership-server/ Share on other sites More sharing options...
corbin Posted January 1, 2009 Share Posted January 1, 2009 Couldn't the server that needs to be modified always listen? For example, if my friend across the room wants to tell me something, I wouldn't periodically ask him if he has anything to say. I would be listening (maybe ) and he would just tell me. Pros: Minimal traffic Cons: Always listening, thus always running, although the overhead would be very, very small. Or maybe I've misunderstood the question. Now that I reread it, I think I have, but the concept could still apply. (And for those out there that are going to want to generalize, I do realize that constantly listening could, indeed, be a bad idea sometimes.) Quote Link to comment https://forums.phpfreaks.com/topic/139035-mothership-server/#findComment-727372 Share on other sites More sharing options...
bdmovies Posted January 1, 2009 Author Share Posted January 1, 2009 I guess that always listening could work, but I really don't want to go down that route. I have a feeling Security would come up quite a bit. But how exactly would that work? I would need a listener on EVERY page of my app. Maybe I'm missing something, but if there is a constant listening, wouldn't that mean high traffic? Quote Link to comment https://forums.phpfreaks.com/topic/139035-mothership-server/#findComment-727374 Share on other sites More sharing options...
corbin Posted January 1, 2009 Share Posted January 1, 2009 Why would every page of your app need to listen? You would have one script/application listening. Also, why would listening create traffic? Perhaps you're thinking of polling and not listening? What exactly is your server setup again? Serv A and B are entirely separated, in different LANs? Quote Link to comment https://forums.phpfreaks.com/topic/139035-mothership-server/#findComment-727376 Share on other sites More sharing options...
bdmovies Posted January 1, 2009 Author Share Posted January 1, 2009 Company A and Company B are completely different. For instance, Com A could be in Boston. Com B could be in L.A.. They could have NO relationship at all Quote Link to comment https://forums.phpfreaks.com/topic/139035-mothership-server/#findComment-727377 Share on other sites More sharing options...
448191 Posted January 1, 2009 Share Posted January 1, 2009 Just use SOAP. Using a WSDL generator it is ridiculously simple to use. Quote Link to comment https://forums.phpfreaks.com/topic/139035-mothership-server/#findComment-727533 Share on other sites More sharing options...
448191 Posted January 2, 2009 Share Posted January 2, 2009 And supersoniclicious fast: http://www.johnkleijn.nl/soap-server-in-30-seconds Quote Link to comment https://forums.phpfreaks.com/topic/139035-mothership-server/#findComment-727893 Share on other sites More sharing options...
bdmovies Posted January 8, 2009 Author Share Posted January 8, 2009 So, I've decided to just use a completely unnormalized table on the mothership. When a admin goes to the home.php page an ajax call is sent to the mothership, if it returns true, then there are jobs there (SELECT COUNT(*) FROM lightspeed WHERE pServer = 'someuniquevalue' AND down = '0'). SOAP just seemed like too much work for this. Quote Link to comment https://forums.phpfreaks.com/topic/139035-mothership-server/#findComment-732816 Share on other sites More sharing options...
corbin Posted January 8, 2009 Share Posted January 8, 2009 AJAX can't request across domains without tweaking security settings. Might want to take that into consideration ;p. Quote Link to comment https://forums.phpfreaks.com/topic/139035-mothership-server/#findComment-732886 Share on other sites More sharing options...
bdmovies Posted January 8, 2009 Author Share Posted January 8, 2009 I'll call to a local page, and then have that page query the database Quote Link to comment https://forums.phpfreaks.com/topic/139035-mothership-server/#findComment-732892 Share on other sites More sharing options...
corbin Posted January 9, 2009 Share Posted January 9, 2009 Ahhh, ok ;p. Quote Link to comment https://forums.phpfreaks.com/topic/139035-mothership-server/#findComment-732973 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.