Database storage or flat file?

For everything that's not in any way related to PureBasic. General chat etc...
Matt
Enthusiast
Enthusiast
Posts: 447
Joined: Sat May 21, 2005 1:08 am
Location: USA

Post by Matt »

Upgraded the server to another gig of ram + 100mpbs and they moved the vps to another server. Sites running much faster and smoother
traumatic
PureBasic Expert
PureBasic Expert
Posts: 1661
Joined: Sun Apr 27, 2003 4:41 pm
Location: Germany
Contact:

Post by traumatic »

8)
Good programmers don't comment their code. It was hard to write, should be hard to read.
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

8) and expensive?
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
Matt
Enthusiast
Enthusiast
Posts: 447
Joined: Sat May 21, 2005 1:08 am
Location: USA

Post by Matt »

As long as people click on the ads it'll be profitable 8) 8)
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

Whats the site url?
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
Matt
Enthusiast
Enthusiast
Posts: 447
Joined: Sat May 21, 2005 1:08 am
Location: USA

Post by Matt »

If you're really interested I can PM you lol
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

Ok, please PM me - I'm really curious now. :D

btw: you should link from here - won't it 'up' your google rank?
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
Pantcho!!
Enthusiast
Enthusiast
Posts: 538
Joined: Tue Feb 24, 2004 3:43 am
Location: Israel
Contact:

Post by Pantcho!! »

PM me the site, I hope we all get free membership :)
Thalius
Enthusiast
Enthusiast
Posts: 711
Joined: Thu Jul 17, 2003 4:15 pm
Contact:

Post by Thalius »

linklink ! hehehe

On the long run i think you dont get around a profile system where you store related votes inside the profile DB.

Create a Vote Table with all votes by user ID ( index field ) or IP (well IP restrictions apply bad idea).

Then create a link table which links votes against user IDs and then do a left joint query across both tables. This is probably the fastest way and uses a binary indexing and search on the db tables inside mysql.


Or Simpler:
Use a Table for IPs stored as Integers ( Longs ) then use this as (Indexed!) lookup table with a COUNT query on the IP Table and IF the result is greater than 1 the user has voted and then you can do the real query on the Votes table to get the IDs and compare them. That way you just do the hard query on need.

To create a Integer Decimal based IP ID you can use the following:

Code: Select all

<?php
$a = 192 ;
$b = 168;
$c = 1;
$d = 1;

$ip = $a*pow(256,3) + $b*pow(256,2) + $c*256 +$d ;
echo $ip;
?>
Cheers,
Thalius
"In 3D there is never enough Time to do Things right,
but there's always enough Time to make them *look* right."
"psssst! i steal signatures... don't tell anyone! ;)"
Matt
Enthusiast
Enthusiast
Posts: 447
Joined: Sat May 21, 2005 1:08 am
Location: USA

Post by Matt »

links sent, just remember the site makes money ;) and enjoy

Thalius wrote:linklink ! hehehe

On the long run i think you dont get around a profile system where you store related votes inside the profile DB.

Create a Vote Table with all votes by user ID ( index field ) or IP (well IP restrictions apply bad idea).

Then create a link table which links votes against user IDs and then do a left joint query across both tables. This is probably the fastest way and uses a binary indexing and search on the db tables inside mysql.


Or Simpler:
Use a Table for IPs stored as Integers ( Longs ) then use this as (Indexed!) lookup table with a COUNT query on the IP Table and IF the result is greater than 1 the user has voted and then you can do the real query on the Votes table to get the IDs and compare them. That way you just do the hard query on need.

To create a Integer Decimal based IP ID you can use the following:

Code: Select all

<?php
$a = 192 ;
$b = 168;
$c = 1;
$d = 1;

$ip = $a*pow(256,3) + $b*pow(256,2) + $c*256 +$d ;
echo $ip;
?>
Cheers,
Thalius
thanks for the tips :)
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

Just seen the link - not normally something I'd visit, but I can understand how it could make you some $.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
Post Reply