

Goodbye Tokyo Cabinet, hello PostgreSQL - khingebjerg
http://briancarper.net/blog/545/goodbye-tokyo-cabinet-hello-postgresql

======
seldo
"I switched to TC to begin with because I was using SQL wrong, and it was too
slow and clumsy. Once I figured out how to use SQL correctly, it was a no-
brainer to go back."

While k-v stores and other NoSQL solutions have many great, valid use-cases, I
expect there are many other people who switched to NoSQL stores on the basis
that they were "faster" only to discover that they needed many of the features
they'd left behind in SQL databases.

------
mahmud
Moved a personal blog from MySQL to TokyoCabinet to Postgres? Why?

He writes:

 _"I have no idea how to use a key/value store database properly."_

You don't need a database, or object-store or anything fancy to get decent
performance for a _personal_ blog. I use Chronicle and it spits out flat
files; lighttpd uses sendfile(2) and everything is _fast_. FWIW, his blog
software is one he wrote in Clojure:

<http://github.com/briancarper/cow-blog/tree/0.2.0>

For read-intensive applications, Sqlite3 would do just well.

This write-up should not influence anyone with respect to the (de)merits of
MySQL, TokyoCabinet or Postgres.

~~~
briancarper
Why? Because it's a fun project to play with and a good way to learn. SQLite3
probably would work, yes.

I agree, this post shouldn't influence anyone. Not sure why it was submitted
to HN.

~~~
khingebjerg
I submitted it because I like reading about your experiments with your blog,
and I thought others would like it too.

A person hacking on his own stuff, just to try out things, is hacker news to
me.

------
jonhohle
While I like reading informative articles about hackers mastering their tools,
this article doesn't have a lot of general purpose information, or mastery of
tools.

A follow up article about the query architecture in all three implementations
could be interesting: how he failed with a relational DB, how he failed with a
key/value DB, how he succeeded with a relational DB. An article like that
could have an interesting story arc and may include information applicable to
other developers.

------
wkornewald
That guy has no clue how to use a non-relational DB (he even admits it) and he
uses a DB that is wrong for his task and wonders why it's so hard.

The only point he makes is that the APIs for non-relational DBs are much too
simple and limited, so you end up building lots of code on top to do the most
trivial things.

What we really need is a way to generate indexes or materialized views on
these DBs in a standardized way (see CouchDB, for an example).

~~~
wvenable
He has no clue how to use a relational DB either (he even admits it). How and
why is this on the homepage?

~~~
briancarper
I have a (bit of a) clue how to use a relational DB. But not from Clojure two
years ago, when the only interface was a very thin layer over JDBC.

As for why it's on the homepage, I don't think it belongs here either. The
intended audience was rather more narrow than HN.

~~~
wvenable
I wasn't sure I was reading it right, but you said MySQL was too slow to run
your personal blog? Is that right?

~~~
briancarper
I ran on MySQL for a few months without issues, but my code was disgusting. My
choice was clean code + slow, or ugly code + fast. Today I have clean code +
fast, thanks partly to better library support in Clojure, so I'm happier. I'll
be the first to admit that I didn't have much of a clue a year and a half ago.
I think I have a bit more of one today, but I could be wrong.

Again, not sure why any of this is important enough to talk about on HN. I'm
hoping this thread dies before my server bursts into flames.

------
lo_fye
Why is this on the front page? I could understand it IF he switched to
PostgreSQL because it outperformed Tokyo Cabinet, but he switched back simply
because he finally learned SQL. This isn't about technology, it's about his
understanding. This story is lame.

------
apower
People who don't understand database/relational-stuff should not touch db-
related work.

------
benatkin
Why not use both, especially if you're using your blog as a technical
playground? Every time you update the document in the Tokyo cabinet, you could
make appropriate changes to the PostgreSQL tables, and that way you wouldn't
have to worry about writing clever queries for tags.

(Disclaimer: I don't know what I'm talking about. If someone else had
mentioned this idea, I wouldn't have said anything.)

------
waratuman
Point number 2 for why not to use TC is not very strong. If you need help
installing a database perhaps you need to learn a little bit more before
managing a webserver.

