

Stranger than Fiction: The story of PostgreSQL and Online Poker - 4chan4ever
http://www.codingthewheel.com/archives/stranger-than-fiction-story-online-poker-tracker-postgresql

======
mattmaroon
The article makes it sound like poker players have become a little more
database-savvy than they really have. The vast majority of poker tracker users
are vaguely aware that some db with a goofy name exists, but that's about it.
The number of them who know what a foreign key is is a rounding error.

And the reason poker attracts so much technology is the same reason the stock
market does: there's a hell of a lot of money to be made. A $50 piece of
software is worth what you pay for it 10,000 times over if it even improves
your win rate by 1% (and Poker Tracker most certainly does much more). A bot
that can average winning 1 cent a hand could make you a millionaire, so a year
or two spent building it is easily justified.

~~~
ScottWhigham
"A $50 piece of software is worth what you pay for it 10,000 times over if it
even improves your win rate by 1% (and Poker Tracker most certainly does much
more)."

hehe - there's a big "if" there: _if_ you play enough and _if_ you use the
info. I bought PT 5-6 yrs ago and I don't play anymore. A 1% improvement over
400 hands won't make my $50 back at the low limits :)

------
ScottWhigham
I tried to make it, I really did, but the stories and other stuff up front
made it impossible. I made it through one scroll and, by that point, I had
found nothing interesting about Postgre or online poker and I bailed. Now that
I come back here and see that this was submitted by "4chan4ever", I feel a bit
dirty for having visited.

~~~
brown9-2
On the contrary, I thought it was actually an interesting history of poker
players using software to track hand history (a subject which is very common
to his blog), and how the industry/area grew into using Postgres. Its not
really meant to be a technical article but rather a history of sorts.

As an aside, does anyone else ever feel the desire to start programming some
sort of poker app whenever they read codingthewheel? Seems like it'd be such a
fun area for a side-project!

~~~
jah
I've you're serious about writing a poker bot, you should check out the forums
at <http://pokerai.org>. I recently started developing a bot and found several
useful nuggets of information on the site. Be warned though, everything feels
like a hack when writing a poker bot (specifically determining the state of
the game from a screenshot ... kind of a pseudo-OCR).

And finally, no, I haven't made any significant income from my bot (as it
current only plays preflop on 6-max tables ... I manually takeover after the
flop).

~~~
brown9-2
Codingthewheel actually did a pretty intensive and in-depth series of blog
posts about building a poker bot, you might want to check it out if you
haven't already. IIRC covered things like communicating with the other
processes, using Win32 APIs to scrape the text and controls of the poker
client, how poker clients attempt to detect bots, etc.

------
jbarciauskas
This is funny because a friend and I were having the exact same conversation
recently. He started playing poker after a long hiatus, and was impressed with
how much Poker Tracker had improved, and mentioned that it was so
sophisticated now it came with an installation of PostgreSQL. I balked at this
immediately, thinking there must be a better way than loading an entire
PostgreSQL instance onto an end user's machine. I assumed that standalone
applications that required RDBMS functionality would use an embeddable
database system like Derby or SQLite. I'm most interested to hear from the
developer what requirements led him to choose PostgreSQL over those
alternatives. Anyone here have any thoughts?

------
oliveoil
I'm reading the Codingthewheel blog pretty regulalry. While I don't find this
article on Postgre particularly intriguing, some others are good, for instance
the one on hand evaluator algorithms:
[http://www.codingthewheel.com/archives/poker-hand-
evaluator-...](http://www.codingthewheel.com/archives/poker-hand-evaluator-
roundup).

All this talk is often making me wonder whether good (and improving bots) will
take over the world of online poker someday, to the point where it is just a
pure waste of money for anyone else than an expert to play, on any blinds
level. (not that I'd feel sad about it).

------
johnwatson11218
I have read some other articles about poker bots and the attempts by the site
operators to ban them using captchas and such. Does anyone else think it would
be a good idea to build an online poker site where the bots are actually
encouraged? I don’t know about betting for real money but I would bet there
are lots of people and/or groups that would love the build the strongest
system in the world.

------
bayareaguy
While I'm glad PostgreSQL proved useful, I fail to understand why SQLite
wouldn't be a better choice for this application.

------
jacquesm
Interesting, if somewhat longish read.

------
Tichy
I have a feeling that article could be condensed into something way shorter.

------
blhack
_But when you consider MySQL's web-centric history, its lack of transactional
and foreign key support, and its relaxed attitude with regard to data
integrity_

2 things:

1 MySQL has had support for transactions since version 4.

2 _Relaxed attitude towards data integrity_ Seriously?

~~~
brown9-2
Well if you don't support foreign keys in the main implementation (ISAM or
whatever it's called), isn't it hard to say that you seriously care about data
integrity?

~~~
blhack
MySQL DOES have support for foreign keys.

create table foo (blah, blah, blah) engine = innodb

Sorry, I'm not trying to start an argument. That sentence just struck me as a
bit inflammatory.

~~~
modoc
The GP's point is that the default engine, and hence the one used by probably
90+% of people using MySQL doesn't support FKs and other "standard" data
integrity features that you wouldn't even know to ask about, since every other
major db supports them by default.

Plus if you try to create an FK on a myisam backed table it happily runs the
SQL, without errors, and you _think_ you have a working FK.

~~~
jfarmer
It's more like the "default default" -- you can change it so, by default,
every table is created using InnoDB. IIRC, MySQL comes with an example config
that demonstrates just that.

