8 ms·
Gay marriage: the database engineering perspective
- yummyfajitas 17y agoAnother 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 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 http://en.wikipedia.org/wiki/Stable_roommates_problem
- ErrantX 17y agoThat's really not Another reason to oppose gay marriage :) (I assume your being as tongue in cheek as the article). Because the pool of marital age humans is constantly growing (and changing) the stable straight marriage problem can pretty much be considered insoluble :)
- pw0ncakes 17y agoAlso, the real-world "marriage problem" (even restricted to heterosexuals) is characterized by radically incomplete information. Moreover, it's dynamic; peoples' levels of desirability change radically over time. People can't actually "try out" 10+ pairings and not be damaged by it.
- anamax 17y ago> People can't actually "try out" 10+ pairings and not be damaged by it. Huh? I suppose that it depends on what you mean by "try out". Obviously you can't live with each of those pairings for 15 years.
- yummyfajitas 17y agoIt is another reason. The first reason is that it causes problems for database admins. The fact that it also causes problems for graph theorists is another reason.
- tedunangst 17y ago"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 17y agoI call them bisexual, anyway.
- jacquesm 17y agoYou'd be wrong.
- yummyfajitas 17y agoYou know that not all straight men prefer all other straight women? That's why the stable marriage problem is non-trivial. If all men preferred all women equally, any set of marriages would be stable.
- philwelch 17y agoThe set of gay men isn't broken up into male and female subsets, and neither is the set of gay women. You don't have this cross-set matching which seems necessary for the stable marriage problem: you indeed have a single-set stable roommates problem, or perhaps two such single-set problems, one for gay men and one for lesbians.
- huherto 17y agoGood links; but the moral opinion not so much.
- dmm 17y agoI doubt the individual above sincerely believes that game theory problems have any practical relevancy to homosexuals marrying. It was a joke along the same lines as the article.
- nkassis 17y agoAnother 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 17y agoActually, I'd love to read a roundup of non-RDBM ways to address this.
- roc 17y agoI 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'.
- jacquesm 17y agoAssuming a male/female table is really mislabelling things, these are both 'people', and a marriage can then be simply construed as a relationship between two (or more!) people. Their other labels are just attributes stored in fields in the people table. The simplest solution is actually the most robust. Any specialization adds complexity and rigidity.
- oldgregg 17y agoI can't think of anything more irrelevant or distracting than debating marriage policy based on database schema.
- gridspy 17y agoHowever, it makes for entertaining reading.
- jbarciauskas 17y agoWell, the author himself says, "Finally we are reaching something which is non-stupid and non-sexist enough that it might actually exist somewhere in reality" I think the male/female tables were meant to be a model of how people actually think, as is the whole of the article, not how any even incompetent data modeler would model the problem (except in the second half, where acceptable mental models and acceptable data models converge).
- billybob 17y agoSo 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.
- deleted 17y ago[deleted]
- axod 17y ago>> "and - gasp! - judge some unions better than others?" That just isn't doable in this age of "Everyone is equal" political correctness stupidity. It'd be like saying that black people on average are better at basketball than white people! Which is clearly racist!!!
- jbm 17y agoI don't think you'd run into someone who is upset at you from a personal standpoint if you were to claim that there were more black players than white players in the NBA.
- oldgregg 17y agoGreat point. Marriage will probably remain as an cultural artifact and that's about it. If marriage means everything then it means nothing-- people just won't bother getting married. Europe is already ahead of us in this respect. It's been a long time coming, from no-fault divorce to a culture where personal happiness is the only standard by which we make decisions.
- sh1mmer 17y agoOriginally posted to HN when he wrote it shortly after the CA Prop 8 vote. http://news.ycombinator.com/item?id=371987 http://news.ycombinator.com/item?id=371987
- jrockway 17y agoJust 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 17y agoAs I reread this, I hoped someone would try to take this out of the relational paradigm. :)
- eplanit 17y agoThe 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 17y agothe best comment I have read here so far. Y2Gay totally made my day!
- theBobMcCormick 17y agoThat'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 17y agoReread the article.
- nfnaaron 17y agoWow, 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.