The Core

Why We Are Here => Web Development => Topic started by: ukgimp on August 30, 2011, 05:12:13 PM

Title: Alternative to mysql
Post by: ukgimp on August 30, 2011, 05:12:13 PM
I am developing a system, well spec only at this point and I am trying to come up with an alternative to using mysql.

Here is what I am thinking:.

I want to be able to have up to 1000 keywords, each of which create a page, and that page gets some other data from the web.

Is it crazy to think that I could run a site that reads in a txt file and basically cuts out the mysql.

I want to be able to upload and it works, not have slaves mess around with mysql users etc.

BoL, I remember you did something where you held an array in memory? Was that you. If so, would it banjax my system if I had 200 sites say?

Anyone got any thoughts please.

cheers

Rich
Title: Re: Alternative to mysql
Post by: rcjordan on August 30, 2011, 05:41:11 PM
>I want to be able to have up to 1000 keywords, each of which create a page,

I did this in a crude form some years ago with perl.   Each line in the pipe-delimited text file contained multiple keywords (the number is user defined). The line also contains the name of the file, the template to use, and the path where that output is to be written.  As I recall, it wrote 30k static pages in a minute or two.  

>and that page gets some other data from the web.

I've used the above script to make large pseudo-dynamic pages by having it reference php templates or otherwise use includes. These includes were also written to the server by the above script, though in one case I used a custom cms to manage those.

I assume you are planning something more sophisticated but the only real problem I had was keeping track of how all the bits and pieces were going to be assembled.

BTW, this was initiailly used for a white site and it got kudos for years.
Title: Re: Alternative to mysql
Post by: Drastic on August 30, 2011, 06:27:08 PM
>Is it crazy to think that I could run a site that reads in a txt file and basically cuts out the mysql.

Makes sense to me, flat files are going to more reliable and probably faster for what you're doing.
Title: Re: Alternative to mysql
Post by: 4Eyes on August 30, 2011, 06:31:42 PM
It is exactly what I have been doing for the last couple of years - skype me for more info
Title: Re: Alternative to mysql
Post by: littleman on August 30, 2011, 07:06:11 PM
Text is really good for this kind of stuff, I've been using text files for years even to generate sites that are 30k+ pages.
Title: Re: Alternative to mysql
Post by: PaulH on August 31, 2011, 07:28:10 AM
Yeah not that unusual.
fully working CMS out there that use flat files rather than a DB - great for shared hosting where the first thing to go down is the DB
http://www.tutorialfeed.org/2009/08/list-of-xml-based-cms-for-web.html
Title: Re: Alternative to mysql
Post by: Rooftop on August 31, 2011, 08:20:11 AM
Agree with all the above: sometimes flatfiles is just the best option.

If you do need something halfway between the two take a look at sqlite as well.  Gives you a bit more clout and flexbility, but still doesn't need to have anything running other than PHP.
Title: Re: Alternative to mysql
Post by: Damian on August 31, 2011, 01:41:29 PM
Not really an alternative to Mysql but perhaps the best of both worlds:
You can have one mother server hosting a central CMS, and have it FTP generated flat files to the machines hosting the 200 sites.  That way you can still manage your lists in a central place with the conveniences of MySQL, and work with flat files on the children sites.
Title: Re: Alternative to mysql
Post by: littleman on August 31, 2011, 04:29:14 PM
>fully working CMS out there that use flat files rather than a DB

It would be nice if there was a plugin for wordpress that made it work with flat files, too many sh###y hosts cause issues with mysql.
Title: Re: Alternative to mysql
Post by: Rooftop on August 31, 2011, 04:50:17 PM
Biggest problem I have seen with wordpress & mysql is poor communication from wordpress: ie major shift in requirements and only tell you halfway through the upgrade process. Fail.
Title: Re: Alternative to mysql
Post by: ukgimp on August 31, 2011, 06:19:43 PM
I want to avoid wp as when it needs updating I don't want to have to update 100's of installs.

O want a bespoke system that has very few flaws.
Title: Re: Alternative to mysql
Post by: bill on September 05, 2011, 08:51:24 AM
Probably not exactly what you're after, as it's a wiki, but DokuWiki works off PHP and plain text files so you don't need a database. There are some examples of it being used as a CMS.
Title: Re: Alternative to mysql
Post by: Will.Spencer on September 06, 2011, 04:27:48 AM
Quote from: ukgimp on August 31, 2011, 06:19:43 PM
I want to avoid wp as when it needs updating I don't want to have to update 100's of installs.

WPMu handles multiple domains now.  You technically only need one Wordpress installation.

We are running 1,400+ Wordpress installs and I update them all with this one shell script:
#!/bin/bash

cd /usr/local/www/data

rm -rf /usr/local/www/data/wordpress
rm /usr/local/www/data/latest.zip*
wget http://wordpress.org/latest.zip
unzip latest.zip

if [ -d wordpress/wp-content ]
then
rm -rf wordpress/wp-content
fi

if [ -f wordpress/wp-config.php ]
then
rm -f wordpress/wp-config.php
fi

# use find command to get all first-level subdirectories containing Wordpress

BLOGS=$(ls  */wp-config.php | grep -v $(ls -d */wordpress-mu | cut -f1 -d'/') | cut -f1 -d'/')

for b in $BLOGS
do
cp -R wordpress/* $b/
done
Title: Re: Alternative to mysql
Post by: ukgimp on September 06, 2011, 09:46:46 AM
Hello Will

Thanks for the script example.

All looks pretty neat. I will have to look into that. There are others here who will have lots of installs that could use it now.

Thanks for posting and welcome along.
Title: Re: Alternative to mysql
Post by: thesaintv12 on September 06, 2011, 10:05:05 AM
@Will.Spencer - Thanks for posting that script, it should come in very handy.
Title: Re: Alternative to mysql
Post by: BoL on September 06, 2011, 11:57:15 AM
That script definitely is the way forward for WP. It's amazing to think how many man-hours could be wasted by the unaware.