Jump to content

Can MySQL handle my needs?


pcbytes

Recommended Posts

I am building a templates site with MySQL backend.

 

I am storing the background images, CSS, etc for the layout all in the database.

 

So everytime someone views a webpage at XYZ persons site, it pulls the content from my database.

 

Now assuming my website takes off and I get lets say 1000 people to use my templates. That could mean 1000's of queries hitting my database at once to pull down background images.

 

****************************

 

I've been building it this way because it makes it easier. When i create the template I dont have to manually edit the <img src="someoutsidesite/somefilename.jpg">

 

The database takes care of all that for me!

 

End result for me... I dont have to spend hours hand coding templates because its all filled out by SQL.

 

But what are the long term results. Can mySQL handle my needs if my site becomes popular?

Link to comment
Share on other sites

Are you actually storing the background image itself as a BLOB in the database, or are you simply storing a reference to a local file? There is a huge difference in server load for those two queries. I would have no worry at all for 1K consecutive users querying for the location of a background image from my database since I'm simply returning a string value to them. On the other hand, if I have people hitting my DB and actually trying to pull an image from my DB, there will be problems. Grant it, if the images are tiny, you may not immediately see a problem, but in my experience, it's a poor design to put that much load on a SQL server.

 

Out of curiosity, if you are creating templates for use or sale, why on earth are they connecting to your server to display it? Are they just personalized pages that people are using that are all hosted on your server, or are they actually connecting to your database server from their own? If it's the latter, this opens up a whole new security issue...

Link to comment
Share on other sites

in answer to your question yes. I was programming it to store the background as a blob to in an effort to alleviate me from having to manually directory path to the image.

 

I had it so  I just upload the background image and it spits out the CSS code with a link to the databased image. Much easier to hit browse image/upload than hardcode each CSS page.

 

But if it's going to cause my SQL to take a dump later on I could take it out. The site isn't live, just on my sandbox.

Link to comment
Share on other sites

No I am not hosting the sites. The sites are hosted externally. The only thing I would be hosting would be the background images on these peoples templates.

 

I would recommend you really think this through, then. First, you are going to have to open up your MySQL database for connection via other servers. This can be a very dangerous thing if you're not extremely careful. First off, remember that if they have the source, they have all your database connection information. You'll have to make sure that you have a MySQL user created that has only SELECT rights granted, or you're going to have people editing your tables on you.

 

I guess I'm still struggling with the reasoning behind hosting the template yourself. Every other template system I'm aware of lets me purchase and download it. With that, I'm able to make modifications to fit my needs. If you are hosting all the CSS and images, you are severely limiting the customization ability of your end user.

 

I'm not trying to discourage you entirely, but I do want to make sure you've considered all the ramifications of the design process you're following, too.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.