
Gay marriage: the database engineering perspective - ams1
http://qntm.org/gay
======
roc
I can't say I've even _seen_ a database that had redundant man/woman tables in
this way. Regardless of where your politics lie on the issue, it's a violation
of normal form with no benefit and any number of inherent problems.

When I was writing code for a medical facility, the guy who designed the
database was as straight-laced and socially conservative as you'll meet.

But his design handled same-sex marriage/bigamy/polygamy/transgender issues,
etc.

(It was a mental health facility. You get all sorts of interesting data
problems when tracking the outliers.)

His philosophy on the design --and I'd imagine this isn't so odd amongst
geeks-- was that data was data and needed to be tracked in a proper and robust
manner, regardless of rightness or wrongness or personal feelings.

Assuming a male/female table is a reasonable logical starting point because
'some people feel this way' is akin to suggesting redundant
christian/muslim/dirty_atheist tables would/should be expected to occur in
professional code, because 'some people feel this way'.

~~~
oldgregg
I can't think of anything more irrelevant or distracting than debating
marriage policy based on database schema.

~~~
gridspy
However, it makes for entertaining reading.

------
billybob
So we start with "how to put gay marriage in a database" and end with
"marriage is a union between any number of people, where people can come and
go as they please." By that definition, I could be married to the company
where I work.

Truly, an obliteration of any meaning to the word "marriage."

Really, I think we should start over. What is marriage, in the eyes of the
state? Why should it grant special privileges to encourage it? Does society
reap benefits from having a man and a woman committed to each other? Does it
benefit from having eight people of varying sexes and self-declared genders
semi-committed to one another in varying degrees? Are we prepared to draw a
line somewhere and - gasp! - judge some unions better than others?

If we don't have widely-accepted answers to that, maybe we should stop
recognizing marriages legally, substitute designations like "this person can
make decisions for me if I'm ill," and leave marriage to be a religious
designation only.

~~~
aristus
Right now by defining it as "one man, one woman" the opposition is pissing off
10+% of the population. Claiming that gay marriage will lead to polygamy or
bestiality is inflammatory. It's like saying that being religious is a
dangerous choice because everyone knows it leads you to kill unbelievers.

Redefinition depends on how far you want to go to deconstruct the term
"spouse". In addition to making decisions when you are ill, how about
"adopting my children", "inheriting my property (and debts)", or "becoming my
common-law spouse after 6 month's co-habitation", or "perhaps not in my church
but ok in another one", etc?

After a certain point you either have to draw a line, ie "sorry, you can have
this much dignity and no more", or you eventually accept the strong form of
gay marriage. Anything else would be politically unstable. You can,
politically, rule out polygamy and define marriage as "two people". It doesn't
have to lead to chaos and anarchy.

~~~
sp332
>Claiming that gay marriage will lead to polygamy or bestiality is
inflammatory.

What argument would you use to defend gay marriage that would not also allow
polygamy? Or what argument would you make against polygamy that wouldn't also
apply to gay marriage?

~~~
aristus
My argument would be amoral but straightforward: a politically-significant %
of people want gay marriage, and make a strong case for it. You could
reasonably implement it as "two persons" and go home. The % of people
seriously agitating for polygamy is much lower so you can safely ignore them.

~~~
nitrogen
Given the number of cultures in the world that still practice polygamy, and
how historically some cultures in the US did as well, I wouldn't be surprised
if a number of "closeted polygamists" started popping out of the woodwork if
polygamy were legalized along with same-sex marriage.

I'd also question whether "people seriously agitating" is a good way of
determining whether a particular action is right or necessary, as it's the
lack of agitation caused by fear that allows discrimination (against any small
minority: geeks/nerds, races, genders, etc.) to exist for such a long time
before finally being addressed.

~~~
eru
> Given the number of cultures in the world that still practice polygamy, and
> how historically some cultures in the US did as well, I wouldn't be
> surprised if a number of "closeted polygamists" started popping out of the
> woodwork if polygamy were legalized along with same-sex marriage.

Polygamist have basically the same rights as gay people: They can't marry (in
most countries), but nobody forbids you from screwing around (or even loving)
multiple partners.

------
eplanit
The author is actually outlining a new market for programmers. This is akin to
fixing the MMDDYY errors in databases that brought the Y2K phenomenon (one
part factual basis, two parts hype and hysteria). We could call it "Y2Gay".

But, I agree with other posters here. While MMDDYY was indeed pervasive, I've
seen very few DB designs that assume role/gender at the schema level. That
said, I would not be at all surprised to find logic or 'validation' that would
choke on "MM" or "FF" or "was M but now F".

Y2K made lots of consulting firms (as well as retired mainframe programmers)
quite profitable during 1998-2000. Here's to new opportunity. :-)

~~~
borism
the best comment I have read here so far. Y2Gay totally made my day!

------
jrockway
Just another reason to use object databases:

    
    
       role Person { has qw/age height weight serial_number/ }
       class Man with Person { has 'length' }
       class Woman with Person { has 'size' }
       class ... # whatever else people can be
    
       # assume index on "does Person" set
       my $bob = $db->get_person('Bob'); # isa Man
       my $harry = $db->get_person('Harry'); # isa Man
       my $sally = $db->get_person('Sally'); # isa Woman
    
       # i think there was a movie about this
       txn_do {
          my $m = Marriage->new( people => [$harry, $sally] );
          $harry->add_marriage( $m ); # in real life, there is a trigger on $m->add_person that does this
          $sally->add_marriage( $m );
          $db->store_marriage( $m ); # harry and sally are stored too
       };
    
       # didn't work out.
       $m->annul( on => DateTime->now );
       $db->store( $m );
    
       $harry->is_married; # false
       $harry->has_been_married; # true
    
       $m2 = Marriage->new( people => [$bob, $harry] );
       ...
    
       $harry->is_married; # returns $m2
    
       my $tom = $db->get_person('Tom');
       $m2->add_person( $tom ); # "three way"
    
       ...
    

Anyway, object graphs make modeling all the possibilities pretty easy; with
the right indexes (on people and marriages) it's fast, with the right data
structures it's lossless (annul pushes the marriage onto a history for that
person), and with the right triggers (adding a person to a marriage adds a
marriage to the person) the data stays consistent.

~~~
Semiapies
As I reread this, I hoped someone would try to take this out of the relational
paradigm. :)

------
sh1mmer
Originally posted to HN when he wrote it shortly after the CA Prop 8 vote.

<http://news.ycombinator.com/item?id=371987>

------
nfnaaron
Wow, lots of non-database comments (not that there's anything wrong with
that).

Design your systems flexibly, with a reasonable lack of assumptions. If
society moves past your system, fix it.

I have one name. _Very_ few online forms have ever allowed me to leave first
or last blank. I generally try to get away with first-blank, last-filled in,
and then surrender as appropriate.

What's worse, I think, is online groups where only one person can be known by
a particular name. Stupid. How you call yourself should be unrelated to how
the database needs to identify you uniquely.

------
yummyfajitas
Another reason to oppose gay marriage: the stable straight marriage problem is
solvable, and there is a fairly simple algorithm to solve it. It heavily uses
the fact that preferences form a bipartite graph.

<http://en.wikipedia.org/wiki/Stable_marriage_problem>

In general, the stable roommate/gay marriage problem does not always have a
solution.

<http://en.wikipedia.org/wiki/Stable_roommates_problem>

~~~
tedunangst
"This is different from the stable marriage problem in that the stable
roommates problem does not require that a set is broken up into male and
female subsets. Any person can prefer anyone in the same set."

You know that not all gay people prefer all other gay people? If a gay man
prefers a gay woman, we call them straight.

~~~
ibsulon
I call them bisexual, anyway.

~~~
jacquesm
You'd be wrong.

------
nkassis
Another case for NoSQL databases. (Actually I have no clue how to solve this
but, I felt like no HN database discussion would be complete without it.)

~~~
Semiapies
Actually, I'd _love_ to read a roundup of non-RDBM ways to address this.

------
theBobMcCormick
That's the stupidest rationalization I've ever heard for why we should
continue to deny basic equality to a significant portion of the population.

~~~
cj
Reread the article.

