Each web server frontend is single-threaded. Single connection to the DB.
- Eric Florenzano
Is there a link for that? Or a recording?
- Nick Lothian
No link that I know of. Just had iPhone so couldn't take great notes but when I get back home I can post some of the highlights in these comments.
- Eric Florenzano
Everything is a "stream". Filters, lists, etc are all "streams".
- Eric Florenzano
Currently have 24 shards, each shard has multiple replicas. Right now there are two shards per physical machine.
- Eric Florenzano
Data changes are dealt with in code on the client side. There's a callback function that basically fixes data so that client code can expect a uniform data representation. Prime examples are StumbleUpon's crappy unicode.
- Eric Florenzano
Another example is the recent beta. Now people can post to multiple streams at once, before that was a single property and now it's a list.
- Eric Florenzano
Sharding is done right now in a naive way. If sharding strategy needs to be addressed, there'll probably be a major architectural change anyway.
- Eric Florenzano
Entries brought in from 3rd party services do the write to the entries table, and let the cleaner update the indexes. Entries posted directly from users make sure to update the indexes before returning an HTTP response.
- Eric Florenzano
The database layer errs on the side of returning too many results, and the Python side of things removes extra entries. This way there are no false positives.
- Eric Florenzano
Had a hard time deciding between using JSON/protocol buffers/pickles as the property bucket format, but eventually decided on pickled python dictionaries because the format is well understood and there was already an efficient Java implementation available.
- Eric Florenzano
Search is done using Lucene, and FriendFeed has built a custom in-memory layer on top of that Lucene backend that stores the diffs and other things--this was needed to provide the near-realtime results that you see.
- Eric Florenzano
The database stuff used to be written in C++ with Python bindings, but that proved too cumbersome. Switched to pure-Python implementation.
- Eric Florenzano
FriendFeed has actually submitted 2 patches to MySQL--Bret says that the MySQL team was very receptive of the patches.
- Eric Florenzano
"The Cleaner" actually has multiple instances running. One process takes about a week and updates every entry in the system. Other processes take much shorter amounts of time and update just the newest entries.
- Eric Florenzano
That's all I can think of for now. There was definitely more interesting bits but that's what I remember off the top of my head :) Hopefully you guys find this interesting.
- Eric Florenzano
We should have setup some kind of FFeed area, didn't know so many people were there- from what I heard the attendance seemed unaware of FriendFeed (and/or not really active users)
- anna sauce
Bret wasn't sure what version of MySQL was used but it would be interesting to know. I've been looking at Percona's version but there is not a 32bit deb and no access to source deb (that I know of)
- jho
By switching to blob format, easy to add additional fields/metadata.
- jho
Design goal is for eventual consistency. "Cleaner" helps clean things up. I.e. indicies are rebuilt continually (most recent is covered more frequently)
- jho
"Cleaner" is also able to go back and update older entries with new fields, fetch from feeds etc.
- jho
Because entries are uuid, de-dupe is handled with insert noop rather than a unique key constraint.
- jho
We're using a pretty recent Percona 5.0 build of MySQL on x86_64 (with innodb tables).
- Jim Norris
Jim, the crowd question was which exact version.
- jho
Yeah, Bret said something about trying out a few different versions before finding one that didn't crash.
- Eric Florenzano
That's about all the additional things I can remember. It was an interesting talk, esp. because I remember going through a lot of the same design decisions last year =)
- jho
Oh, and Bret promised to put up a link to the slideshow he used.
- jho
Would love to see a recording. Sounds very interesting.
- Bill
+1 for a recording, but a link to the slideshow will be great too, Thanks!
- Peter Hoffmann
I do not think anyone recorded the meetup but I could be wrong.
- jho
He said he was going to put it up... probably on the blog
- anna sauce
Jauder, we currently use percona's 5.0.77 highperf b13. It should be possible to compile from source to get a 32bit version. Use mysqlbug to find out what configure options were passed to your currently running version.
- Private Sanjeev
Sanjeev, thanks. Percona had released 64bit debs, I was just hoping that they would release the source debs too so that I could compile from that instead.
- jho
As a followup, OurDelta is publishing 32bit debs of MySQL incorporating Percona, Google etc. patches. I'm now running 5.0.77d8 with no issues so far. Worth checking out.
- jho