473,379 Members | 1,386 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

data storage

Hi All,
I want to be able to store data as part of my website. I'm assuming that
I''ll need to use PHP scripts to provide this functionality, but what would
the best aproach be to storing data?. I could use a database of some sort
(maybe MySQL?), but I'm wondering whether there are any other aproaches to
data storage that would be less elaborate than a full database.

Any ideas?.

Dave

Jul 17 '05 #1
10 1721
I noticed that Message-ID: <42**********@baen1673807.greenlnk.net> from
Dave Moore contained the following:
I'm wondering whether there are any other aproaches to
data storage that would be less elaborate than a full database.

Any ideas?.


Database or files. Take your pick.

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #2
Dave Moore wrote:
Hi All,
I want to be able to store data as part of my website. I'm assuming
that
I''ll need to use PHP scripts to provide this functionality, but what
would the best aproach be to storing data?. I could use a database of some
sort (maybe MySQL?), but I'm wondering whether there are any other
aproaches to data storage that would be less elaborate than a full
database.

Any ideas?.

Dave


Hi Dave,

Well, you can always use files to store data.
But you should wonder if the initial ease of coding is not backfiring later.
(I think it will)

If you use files to store data (often called: flatfile approach), you will
face a LOT of extra headages later on in the project, like:
- bad performance

- you have to prepare your files against concurent writes by different
request/commands from clients.
Use filelocking to prevent this. (= extra work)
If you do not it is just a matter of time before your files become corrupt.

- If the data you store is even a little bit complex, you will soon face the
fact that you have to open many files, scan them, do a lot of processing.
This is EXCACTLY where SQL makes things easier for you.

If you have no experience using databases, this might be a little
intimidating at first glance.
But take it from a guy who did actually make dynamic websites using flat
files in Perl: it is ABSOLUTELY worth the time/study investment.
Go database.

Of course I do not know your actual requirements, but studying databases is
most probably worth your while.

Have a look at www.w3schools.com for some great tutorials.

As for your choice of database: Go mySQL or Postgresql.
I think both are under the GPL licence. (= Free as in Freedom :-)
I prefer Postgresql because it is a robust, featurerich opensource database.
But MySQL should do most jobs just as fine (and a little bit faster. :-)

Hope this helps.

Regards,
Erwin Moller
Jul 17 '05 #3
Dave Moore wrote:
Hi All,
I want to be able to store data as part of my website. I'm assuming
that
I''ll need to use PHP scripts to provide this functionality, but what
would the best aproach be to storing data?. I could use a database of some
sort (maybe MySQL?), but I'm wondering whether there are any other
aproaches to data storage that would be less elaborate than a full
database.

Any ideas?.

Dave


How much data? What kind of data? Do you mean pictures and text documents
or things like sales orders and employee records?

Generally, if you are going to store business data, you will sooner or later
master a database, so you can start now or start later. Many try to gloss
over this fact and it limits what they can get done.

If it is not business data, it gets more gray and you would have to provide
more details.

--
Kenneth Downs
Secure Data Software, Inc.
(Ken)nneth@(Sec)ure(Dat)a(.com)
Jul 17 '05 #4
Hi Erwin,
Thanks for the pointers. I am slightly familiar with SQL 'INSERT',
'SELECT' etc, so this is not too scary. However, can you recommend a
webspace hoster that will accept server side PHP and MySQL databases to be
run?. Also, how would you suggest that I approach developing the site? -
should I develop using a webserver (like Apache) on my desktop locally and
then keep my fingers crossed that it will port OK to a hoster's webserver?.

Ta,
Dave


"Erwin Moller"
<si******************************************@spam yourself.com> wrote in
message news:42***********************@news.xs4all.nl...
Dave Moore wrote:
Hi All,
I want to be able to store data as part of my website. I'm assuming
that
I''ll need to use PHP scripts to provide this functionality, but what
would the best aproach be to storing data?. I could use a database of some sort (maybe MySQL?), but I'm wondering whether there are any other
aproaches to data storage that would be less elaborate than a full
database.

Any ideas?.

Dave
Hi Dave,

Well, you can always use files to store data.
But you should wonder if the initial ease of coding is not backfiring

later. (I think it will)

If you use files to store data (often called: flatfile approach), you will
face a LOT of extra headages later on in the project, like:
- bad performance

- you have to prepare your files against concurent writes by different
request/commands from clients.
Use filelocking to prevent this. (= extra work)
If you do not it is just a matter of time before your files become corrupt.
- If the data you store is even a little bit complex, you will soon face the fact that you have to open many files, scan them, do a lot of processing.
This is EXCACTLY where SQL makes things easier for you.

If you have no experience using databases, this might be a little
intimidating at first glance.
But take it from a guy who did actually make dynamic websites using flat
files in Perl: it is ABSOLUTELY worth the time/study investment.
Go database.

Of course I do not know your actual requirements, but studying databases is most probably worth your while.

Have a look at www.w3schools.com for some great tutorials.

As for your choice of database: Go mySQL or Postgresql.
I think both are under the GPL licence. (= Free as in Freedom :-)
I prefer Postgresql because it is a robust, featurerich opensource database. But MySQL should do most jobs just as fine (and a little bit faster. :-)

Hope this helps.

Regards,
Erwin Moller

Jul 17 '05 #5
In: <42**********@baen1673807.greenlnk.net>, "Dave Moore" <da**********@baesystems.com> wrote:
Hi All,
I want to be able to store data as part of my website. I'm assuming that
I''ll need to use PHP scripts to provide this functionality, but what would
the best aproach be to storing data?. I could use a database of some sort
(maybe MySQL?), but I'm wondering whether there are any other aproaches to
data storage that would be less elaborate than a full database.

Any ideas?.


Very deep question, database is easier for most things, particularly updates
and queries. mysql is more popular, which is why I use it. I perfer postgresql
though. You don't have file permission issues with mysql. (Just access issues)

DBM's are some-what less elaborate.

There are a few dbm implementations, these are files but you get a key -> value
type of interface. Useful for high speed access, terrible if you need to span
hosts. Shouldn't be a problem to serialize an object and store to a DBM, this
would give you a "key => $object_or_array" type of functionality. It would
be terrible if you needed to lookup data based on something besides a single
primary key. (You'd have multiple "alternate index" DBM's to maintain on each
update)

Flat files are often good for file uploads.

I tend to use a combination of database + files, for the different data.

I'd probably go with an SQL database, it'll make your life easier in the long
run and probably make your web site more stable.

Jamie
--
http://www.geniegate.com Custom web programming
gu******@lnubb.pbz (rot13) User Management Solutions
Jul 17 '05 #6
Following on from Dave Moore's message. . .
Hi All,
I want to be able to store data as part of my website. I'm assuming that
I''ll need to use PHP scripts to provide this functionality, but what would
the best aproach be to storing data?. I could use a database of some sort
(maybe MySQL?), but I'm wondering whether there are any other aproaches to
data storage that would be less elaborate than a full database.

Any ideas?.

MySQL is a doddle. myAdmin is a convenient management tool.
Documentation for MySQL is excellent. You'll find it handy anyway. Now
is your opportunity to emerge from the primeval swamp as it were.

Large user supplied data files might be better in a file system -
uploading files isn't difficult. Downloading files is only half a dozen
lines of code....
....but you'll need some database to manage the files.

Or you could try carving the information as intricate designs on
potatoes, chips and crisps. A taterbase.


--
PETER FOX Not the same since the poster business went to the wall
pe******@eminent.demon.co.uk.not.this.bit.no.html
2 Tees Close, Witham, Essex.
Gravity beer in Essex <http://www.eminent.demon.co.uk>
Jul 17 '05 #7
Dave Moore wrote:
Hi Erwin,
Thanks for the pointers. I am slightly familiar with SQL 'INSERT',
'SELECT' etc, so this is not too scary. However, can you recommend a
webspace hoster that will accept server side PHP and MySQL databases
to be run?. Also, how would you suggest that I approach developing
the site? - should I develop using a webserver (like Apache) on my
desktop locally and then keep my fingers crossed that it will port OK
to a hoster's webserver?.

Ta,
Dave


I'd expect it to be more difficult to find hosts that *don't* support the
PHP and MySQL combination. Plenty of inexpensive hosts out there. I use
lunarpages.com but there are hundreds of others out there. Visit
webhosttalk.com for background on many web hosts.

Yes, do your development locally and then post it when it's ready... or have
two hosted accounts that you use so there is a development and a production
environment. It's worth it.

--
Virgil
Jul 17 '05 #8
"Dave Moore" <da**********@baesystems.com> wrote in message
news:42**********@baen1673807.greenlnk.net...
Hi All,
I want to be able to store data as part of my website. I'm assuming that I''ll need to use PHP scripts to provide this functionality, but what would the best aproach be to storing data?. I could use a database of some sort
(maybe MySQL?), but I'm wondering whether there are any other aproaches to
data storage that would be less elaborate than a full database.

Any ideas?.


If your host runs PHP 5, you can use SQLite.

http://www.php.net/manual/en/ref.sqlite.php
Jul 17 '05 #9
Virgil Green wrote:
Dave Moore wrote:
Hi Erwin,
Thanks for the pointers. I am slightly familiar with SQL 'INSERT',
'SELECT' etc, so this is not too scary. However, can you recommend a
webspace hoster that will accept server side PHP and MySQL databases
to be run?. Also, how would you suggest that I approach developing
the site? - should I develop using a webserver (like Apache) on my
desktop locally and then keep my fingers crossed that it will port OK
to a hoster's webserver?.

Ta,
Dave

I'd expect it to be more difficult to find hosts that *don't* support the
PHP and MySQL combination. Plenty of inexpensive hosts out there. I use
lunarpages.com but there are hundreds of others out there. Visit
webhosttalk.com for background on many web hosts.


Yes, Virgil is completely right: Every ISP that is worth anything should
offer it.
Only exception are those pesky W$-only providers, they tend to stick ACCESS
and SQL-server.
If you are lucky they offer MySQL too.

But please try to find an provider that offers:
- GNU/Linux OS.
- Apache (1.3 or higher)
- PHP (at least 4.3, but preferably PHP5)
- MySQL or Postgresql

Relevant might be the LAMP shortcut:
Linux
Apache
MySql
Php

But I don't like that name LAMP, because it doesn't pay credit to the
GNU-part in Linux, which makes up over 95% of what many people call Linux.
GNU/Linux is a better name.

Provider?
I live in the Netherlands, Europe.
The best deal over here is XS4ALL. They run FreeBSD, and are very good
technically. (Maybe they run GNU/Linux too, not sure)

Yes, do your development locally and then post it when it's ready... or
have two hosted accounts that you use so there is a development and a
production environment. It's worth it.


Dave, Virgil is giving very good advise.
If possible try to do that.
You are doing yourself a huge favor. :-)

Good luck.

Regards,
Erwin Moller
Jul 17 '05 #10
SqlLite is a thing you need|~maybe

Jul 17 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Scott J. McCaughrin | last post by:
The following program compiles fine but elicits this message from the linker: "undefined reference to VarArray::funct" and thus fails. It seems to behave as if the static data-member:...
7
by: smith4894 | last post by:
Hello, I have a question regarding storage locations for different data types. For example, dynamically created objects (using "new") are created on the heap. local objects ( foo() {int x;} )...
4
by: Ced | last post by:
Hi, i'm not an expert in C but i try to compile BTNG software under linux kernel 2.4.2-2. I get these errors at the very first stage. Does someone could have a rapid look on this and tell me...
6
by: kobu.selva | last post by:
I was recently part of a little debate on the issue of whether constants and string literals are considered "data objects" in C. I'm more confused now than before. I was always under the...
41
by: laimis | last post by:
Hey guys, I just recently got introduced to data mappers (DTO mapper). So now I have a SqlHelper being used by DTOMapper and then business layer is using DTOMapper when it needs to persist...
8
by: Art | last post by:
Hi folks, I'm writing a traditional desktop app using VB.NET and am stumbling over what seems like a very basic question: My app does not need to be connected to a server or another computer....
4
by: Holger Marzen | last post by:
Hi all, AFAIK it is possible for columns to be very large, up to about 2 GB. Are there any hints or experiences about storing binary data (jpg-images, pdf-documents) in PostgrreSQL with or...
12
by: Chris Springer | last post by:
I'd like to get some feedback on the issue of storing data out to disk and where to store it. I've never been in a production environment in programming so you'll have to bear with me... My...
3
by: Atropo | last post by:
Hi, all. As you can see I'm just begining on C. with the tutorial "Sams Teach Yourself C in 24 Hours" as a starter. on aix 5.2 when compiling a helloWorld the gcc throws some warnings the...
10
by: Jeffrey | last post by:
My understanding is that if you write class X { int y; static int z; }; then you've defined (and declared) X and y, but you have only declared (and not defined) z. If you'd like to...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.