Whether autocommit's on or off, I still have to handle errors that get
thrown from any DB statement, including simple queries outside of
transactions that can fail when, say, MySQL server times out and
closes the connection.
FWIW I started with autocommit on, had a few issues and switched over
to non-autocommit, which is the default in SqlAlchemy, probably
because it's supposed to have less overhead.
>
> personally i avoid joins whenever i can, and do them in code instead,
> eg - pull out a few rows, put the IDs in a set and pull out a few more
> rows with SELECT FROM X WHERE id IN ( .. )
>
>
> this is what facebook and other big sites do - mysql performance much
> better and more consistently as a basic key-value store.
Why use a relational database as a basic key/value store at all? There
are other options that are better suited to this type of data:
http://en.wikipedia.org/wiki/NoSQL#Key.2Fvalue_store
I know a lot of big sites (ab)use MySQL as a "hash in the sky", but that
probably has more to do with the fact that they were designed before
NoSQL options were widely accepted than any hard technical reasons.
If you have relational data, I'd suggest PostgreSQL. If you just need
key/value, I'd suggest researching a NoSQL database instead.
Cliff
Hi Artemi,
Google and Amazon both use NoSQL solutions, so that's two. The BBC is
using CouchDB. meebo.com (alexa rank 1132) also uses CouchDB.
businessinsider.com (alexa rank 786) uses MongoDB for everything,
including serving images. I'm sure 30 minutes on Google would turn up
plenty more.
http://www.couch.io/case-study-bbc
As an aside, I do find a bit of humor in the idea that MySQL is more
trustworthy than well... almost anything. The only widely-deployed
database I trust less would be BerkeleyDB.
> I'm not using MySQL as just a key-value store mind you, I use
> everything else too (indices, groups, replication, etc). I just try
> to avoid joins whenever i can
Joins are central to the relational paradigm (hence the name). Indices
and replication are not (in fact, replication is usually easier with
most NoSQL databases). Grouping and aggregation are also strong points
of the map/reduce paradigm.
In any case, you know your own data best, but it sounds to me like you
haven't really given NoSQL fair consideration.
Regards,
Cliff