Im Not Playing Any More

.. rantings and blog of Chris Williams @scampiuk

Saturday, 10 July 2010 21:30

External Databases and Joomla! Featured

Written by  Chris Williams
Rate this item
(0 votes)

I get may people asking me about linking external databases with Joomla! because they have found my ExternalDB plug-in on the JED - but people often look for different things when they tap in this simple phrase into Google.. I'm going to try to clear up things a little to get people working in the right direction.

First off, there are two distinct things people are trying to achieve. The most common I've found is trying to get a particular component to get it's data from a separate database. For example, if you have two J! sites and you wish to use the database for a calendar component on both to contain the same data. The second is to get actual Joomla! content from a second database, albeit all of the site's content or just a section of it - and isn't something that I'm really covering here because I've always found ways around doing this.

 

It is possible!

Most of the questions I get ask if it's possible to get an existing component to work with another database. The sales pitch answer is, of-course 'Yes!'. The practical answer is that it depends on the complexity and the design of the component. If they've correctly used the framework and table objects, then it's a reasonably simple task to modify those to make that component use whatever database you so wish - of if more serious changes are required than from any data source you wish. Taking the 'two sites wanting the same calendar data' example, it could be possible to get the slave site to get it's data from an RSS or JSON feed, instead of accessing the databases.

The golden rule is - the more complex and non-standard the code has been written in, the longer it will take to make it work with another database. Code littered with MySQL queries in different places is not a good sign that it'll be a quick process to take that existing component and modify it.

 

It can have problems

There is also something that I find people miss:  latency. Connecting to a database the other side of the world is slow! While developing components for our clients web sites, or modules for one of our video streaming sites we have development and staging servers in Europe that have to read our main databases in  the US. It doesn't sound much, but if a MySQL connect takes 2 seconds each page load you sure has hell notice it. The same goes if you're using another web-based data-source, if the host you're collecting from isn't quick then you're already getting bogged down before you even get around to parsing the data.

Last modified on Saturday, 10 July 2010 22:00
Chris Williams

Chris Williams

PHP programmer for a mere 6 years, I've worked on creating social communities and content management systems while teaching myself the language.   For the last few years I've worked on free-to-view and pay-per-view live streaming / in-demand streaming media sites 247.tv and livesquash.tv, We travel around the world filming live sporting events, often doing post-production work for TV in the process.

20 comments

  • «
  •  Start 
  •  Prev 
  •  1 
  •  2 
  •  Next 
  •  End 
  • »

Leave a comment

Make sure you enter the (*) required information where indicated.
Basic HTML code is allowed.

Chris Williams
Chris Williams
chris@imnotplayinganymore.com
PHP & Joomla! Developer
FacebookFlickrFollow @scampiuk on twitter

West Midlands Joomla! User Group logo
West Midlands Joomla! User Group is now up and running.

Me on Twitter

scampiuk: Fuck me a try he didn't fuck up with theatrics. #6nations
scampiuk: RT @GreggCarter: RT @JoeSOTL Jesus Christ Barnes. How long do you want to leave before the................................ Engage! #6Nations
scampiuk: What is the recent trend to take an age to call the scrum? It's got the word 'pause' in it, don't add three pauses as well? #6nations
A coffee is always welcome, or maybe some pennies to charge the laptop.
They also pay for flowers for my wife so she doesn't hate me spending so much time on the computer...

Hosted by...

Dreamhost - a nice host

Get a free domain and up to 50% off registration costs! use the promo code CHRISWDISCOUNT

You are here: