News for hackers. Stuff that matters.
Re:A query had to go by andrewfromx on Tuesday June 06, 2017 @02:13PM (#14499589)
hey feel free to checkout the golang code here https://github.com/activityclub/pointspaced it's way more versatile than sql for our needs. BTW the #{id} we call .to_i on it first so ruby will make that 0 if it's a string with a single quote or something.
Re:A query had to go by matt4077 on Tuesday June 06, 2017 @03:53PM (#14500688)
I've had only a cursory look, but it really feels as if you're reinventing database indices.

Indices are based on the same logic, i. e. "99% are reads, let's try to do more work on writes".

Redis is great. But to be honest: so is MySQL. If you give MySQL enough RAM and create the right indices, you can easily get to 6-digit numbers of queries per second.

Re:A query had to go by andrewfromx on Tuesday June 06, 2017 @04:19PM (#14500923)
Re:A query had to go by packetized on Tuesday June 06, 2017 @03:23PM (#14500350)
That sounds like a recipe for disaster, if that's the only thing you're relying on for input validation of #{id}.
Re:A query had to go by andrewfromx on Tuesday June 06, 2017 @03:34PM (#14500457)
what do you mean. "wefwkefjwe'".to_i will goto zero every time. How is sql injection possible if I to_i your string?
Re:A query had to go by slantyyz on Tuesday June 06, 2017 @04:34PM (#14501052)
Wouldn't it be better to not even run the query if id is a non-integer value, or does id = 0 have some intrinsic meaning in your data?