For your Monday morning lulz: DBA vs. programmer thread.



Tagged with : blobsean is blob

What are tags?
impasse 820 2010-02-08 07:31:42.0 login to vote score 0
What the hell is this fear of SQL? Are some programmers so terrified of relational databases that they can't store anything without some highly abstracted ORM?
ludditemike 119 2010-02-08 07:34:14.0 login to vote score 0
impasse: What the hell is this fear of SQL? Are some programmers so terrified of relational databases that they can't store anything without some highly abstracted ORM?

It's nice to not have to worry about the quirks of a particular database, I guess.
fatsean 3838 2010-02-08 07:38:15.0 login to vote score 0
impasse: What the hell is this fear of SQL? Are some programmers so terrified of relational databases that they can't store anything without some highly abstracted ORM?

Most DB-backed apps don't need a very sophisticated schema either. Seems lazy to me, especially since once you know your data domain, creating a normalised DB schema is mostly procedural.


meta 1442 2010-02-08 07:51:02.0 login to vote score 0
Are you storing IP addresses as VARCHARs? Why? It's just 32-bit integer written in dotted quad notation.


FAIL.
bake 2096 2010-02-08 08:01:51.0 login to vote score 2
submitterFor your Monday morning ZZZZZZZZZZZZZzzzzzzzz: DBA vs. programmer thread.


grahams 5 2010-02-08 08:18:44.0 login to vote score 2
impasse: What the hell is this fear of SQL? Are some programmers so terrified of relational databases that they can't store anything without some highly abstracted ORM?

I understand databases just fine, but a decent ORM layer makes code so much easier.

DbUser impasse = DbUserPeer.retrieveByPK(820);
impasse.setStfu(StfuYou.ASSHOLE);
impasse.save();


impasse 820 2010-02-08 08:24:43.0 login to vote score 3
grahams: I understand databases just fine, but a decent ORM layer makes code so much easier.

DbUser impasse = DbUserPeer.retrieveByPK(820);
impasse.setStfu(StfuYou.ASSHOLE);
impasse.save();


Thin-ish ORMs are fine, I use them myself mostly just to throw a sql backend portability layer in. I'm talking about the kind where it completely hides the backend, then people like me have to figure out what the hell some massively abstracted ORM is doing when there's a database problem.

no.u();

fatsean 3838 2010-02-08 08:26:48.0 login to vote score 0
meta: Are you storing IP addresses as VARCHARs? Why? It's just 32-bit integer written in dotted quad notation.

FAIL.


Seriously. You should use a 64-bit INT to avoid issues with the sign bit.

impasse 820 2010-02-08 08:29:59.0 login to vote score 3
fatsean: Seriously. You should use a 64-bit INT to avoid issues with the sign bit.

BLOBs for everything, especially booleans.
mtman900 3599 2010-02-08 08:36:44.0 login to vote score 0
impasse: BLOBs for everything, especially booleans.

blobsean is blob
snooge 618 2010-02-08 08:46:48.0 login to vote score 1
This never gets old
fatsean 3838 2010-02-08 08:54:57.0 login to vote score 1
mtman900: blobsean is blob



meta 1442 2010-02-08 09:06:18.0 login to vote score 0
fatsean: Seriously. You should use a 64-bit INT to avoid issues with the sign bit.

Still FAIL.

Hint: my IP address is 2002:4219:ae2b:0:240:63ff:fecc:1f26/64
mtman900 3599 2010-02-08 09:08:58.0 login to vote score 0
meta: Still FAIL.

Hint: my IP address is 2002:4219:ae2b:0:240:63ff:fecc:1f26/64


You are going to still save space if you convert that to a base 10. But I see your point.
sloth 222 2010-02-08 09:12:58.0 login to vote score 0
mtman900: You are going to still save space if you convert that to a base 10. But I see your point.

Umm, do you?

His point is that IPv6 is 128bit, not 32bit (IPv4).
elebrin 1389 2010-02-08 09:17:00.0 login to vote score 0
impasse: What the hell is this fear of SQL? Are some programmers so terrified of relational databases that they can't store anything without some highly abstracted ORM?

The idea is to have your software database-neutral. It should be reasonable to replace your MySQL database with an MSSQL or Postgres database if needed. Yes, some work will be required but it shouldn't require an entire rewrite.
mtman900 3599 2010-02-08 09:20:07.0 login to vote score 0
sloth: Umm, do you?

His point is that IPv6 is 128bit, not 32bit (IPv4).


Yes, I do. I was just saying that, while the exact numbers are wrong, you still are going to get some savings by saving the IP address as an int rather than a string.

Of course, I say that as a fool who has not very much experience in programming at all, let alone managing data sizes.
impasse 820 2010-02-08 09:20:15.0 login to vote score 0
elebrin: The idea is to have your software database-neutral. It should be reasonable to replace your MySQL database with an MSSQL or Postgres database if needed. Yes, some work will be required but it shouldn't require an entire rewrite.

I'm not talking thin abstraction layers for db vendors, I'm talking about completely hiding all things SQL/relational to hotshot Web 2.0 programmerfags that wouldn't know a left join from their mom's dildo drawer.
elebrin 1389 2010-02-08 09:25:05.0 login to vote score 0
impasse: I'm not talking thin abstraction layers for db vendors, I'm talking about completely hiding all things SQL/relational to hotshot Web 2.0 programmerfags that wouldn't know a left join from their mom's dildo drawer.

Yeah when I reread the rest of the thread I got that.

But really... sql and managing databases is easysauce. Learning php took longer. Some of the more complicated stuff is much more involved, but the nice thing is that once you got your schema set you shouldn't have to mess with it. I don't know why people can't do this for themselves.
sloth 222 2010-02-08 09:25:48.0 login to vote score 0
mtman900: Yes, I do. I was just saying that, while the exact numbers are wrong, you still are going to get some savings by saving the IP address as an int rather than a string.

Yes you will. And I don't think he was denying that.
pale_green_pants_with_nobody_inside_them 46 2010-02-08 09:26:28.0 login to vote score 0
When I was a boy, we had JDBC and WE LIKED IT!
pale_green_pants_with_nobody_inside_them 46 2010-02-08 09:30:38.0 login to vote score 0
impasse: Thin-ish ORMs are fine, I use them myself mostly just to throw a sql backend portability layer in. I'm talking about the kind where it completely hides the backend, then people like me have to figure out what the hell some massively abstracted ORM is doing when there's a database problem.

no.u();


hibernate.showSQL=true;

done.
throwingknife 1634 2010-02-08 09:39:01.0 login to vote score 0
mtman900: Yes, I do. I was just saying that, while the exact numbers are wrong, you still are going to get some savings by saving the IP address as an int rather than a string.

Of course, I say that as a fool who has not very much experience in programming at all, let alone managing data sizes.


Some people use a host name as the address.
fatsean 3838 2010-02-08 09:42:46.0 login to vote score 0
meta: Still FAIL.

Hint: my IP address is 2002:4219:ae2b:0:240:63ff:fecc:1f26/64


Use of the acronym IP implies IPv4 :P

If using IPv6, one should implement 128 boolean columns.


impasse 820 2010-02-08 09:54:28.0 login to vote score 0
fatsean: Use of the acronym IP implies IPv4 :P

If using IPv6, one should implement 128 boolean columns.


I'd use around 200, since IPv6.1 might be right around the corner.
meta 1442 2010-02-08 10:00:22.0 login to vote score 0
mtman900: Yes, I do. I was just saying that, while the exact numbers are wrong, you still are going to get some savings by saving the IP address as an int rather than a string.

Yes, but how much quicker is it going to be to read 16 octets from a database instead of 39? Not much, I suspect, in these days of 8K cluster sizes.

Even if it's slightly faster because of network transmission, it's still probably not enough to be worth the tradeoff of having to convert your data between binary representation and canonical representation for every single read or write operation.

Next you'll be suggesting saving space by using 64 bit epoch dates instead of TIMESTAMP...
meta 1442 2010-02-08 10:01:12.0 login to vote score 0
pale_green_pants_with_nobody_inside_them: When I was a boy, we had JDBC and WE LIKED IT!

Unfortunately, we still have JDBC.
someone who may or may not be Sales Director 2010-02-08 10:23:38.0 login to vote score 1
Yeah, well when you're done with your geek-out, could someone please respond to my login request? I still can't get into email or internet and as I've mentioned several times it is IMPERATIVE that I can access the application from my blackberry.
sunofsam 241 2010-02-08 10:46:28.0 login to vote score 3
Real men use flat files
snooge 618 2010-02-08 10:59:16.0 login to vote score 0
Chip in Sales says the website is down.
tumescent 6689 2010-02-08 14:21:55.0 login to vote score 1
sloth: Umm, do you?

His point is that IPv6 is 128bit, not 32bit (IPv4).


Little Jonny was a coder
Little Jonny is no more
What Jonny thought was IP6
Was H2SO4

...yeah, doesn't make a lick of sense, but if I don't get it out of my skull, it'll rattle around in my head annoying me for a while
sockpuppet 2985 2010-02-08 17:06:00.0 login to vote score 0
Nerds.
If you logged in, you could post here.