763 karma · joined August 30, 2008
In the case of Sheets, the most reasonable sharding scheme for the database backing it would be based on some collection of spreadsheets (in the extreme case it would be just one spreadsheet, but that probably wouldn't be practical). The important assumption here is that all the traffic pertaining to one spreadsheet will ultimately go to one server. So, if there's too much traffic coming related to one spreadsheet, you cannot really scale horizontally by adding more servers – you have to give it more resources. A single Google Sheet is sometimes used by lots of users at the same time, but they are able to limit it from the frontend (for example by making it degrade gracefully).
If the traffic comes from the API, it's going to be a little bit more tricky – especially that IIRC the current rate limiting for the API uses a daily quota, leaving room for some really nice spikes.
So, as soon as a website built using this hack get somehow popular someone is going to have a really rotten day with a lot of pages.
(Of course, this is pure speculation on my side, I have no idea how Google Sheets is actually built – I would be very curious if there's a smart way of overcoming this sort of issue.)
This said, I really enjoyed the experience. Yes, it was tiring and stressful, but it was also super interesting and exciting. Being responsible for such a huge site was incredible, and the feeling of figuring out how to overcome a big outage was exhilarating. I actually miss the pager drama from time to time (my wife does not).
type Iterator interface {
// Next returns true if the iterator contains subsequent elements
// and advances its state to the next element if that is possible.
Next() (ok bool)
// Value returns the current value.
Value() interface{}
}
which you then use like this: iter := s.Iterator()
for iter.Next() {
fmt.Printf("%s\n", iter.Value())
}
I think this is a pretty good pattern: it's concise, looks less ugly than the callback and closure based iterators, and it's not using anything heavyweight like channels, so there should be no significant performance degradation.Out of curiosity, I added this pattern to OP's test code as StatefulIterator (https://github.com/ewencp/golang-iterators-benchmark/pull/1), in 2 versions: one in which the iterator is a struct, and one in which the iterator is an interface. The results look like this (the 4 last rows are my additions):
BenchmarkIntsCallbackIterator 500 3478962 ns/op
BenchmarkDataCallbackIterator 500 4437885 ns/op
BenchmarkIntsChannelIterator 10 186095017 ns/op
BenchmarkDataChannelIterator 10 188627451 ns/op
BenchmarkIntsBufferedChannelIterator 20 90941766 ns/op
BenchmarkDataBufferedChannelIterator 20 90175550 ns/op
BenchmarkIntsClosureIterator 500 5580257 ns/op
BenchmarkDataClosureIterator 500 6183472 ns/op
BenchmarkIntStatefulIterator 1000 2653265 ns/op
BenchmarkDataStatefulIterator 500 3582051 ns/op
BenchmarkIntStatefulIteratorInterface 200 7516778 ns/op
BenchmarkDataStatefulIteratorInterface 200 8250702 ns/op
ok _/Users/ryszard/Projects/golang-iterators-benchmark 33.717s
As you can see, the struct version is the fastest of the lot: 2653265 ns for ints and 3582051 ns structs (versus the callback version with 3478962 ns and 4437885 ns, respectively). The interface version is slower, but still in the same ballpark as the callback and closure based ones, while being much more readable (but that's only my personal opinion). The not-so-stellar performance of interfaces is a bit disappointing, but that is a known issue.As for Kukliński, being a Pole myself, I have mixed feelings. I very much prefer that my country is in the American sphere of influence (and not the Soviet as it used to for almost 50 years). However, if WW3 had happened, we would've been be on the Soviet side. Zbigniew Brzeziński said that Kuklinski’s information had permitted them to make counterplans to disrupt command-and-control facilities rather than only relying on a massive counterattack on forward positions, which would have hit Poland. However, I have no dellusions that anybody in the US would have any doubts about turning Poland into a radioactive wasteland if that served the American interests of the moment...
Also, the Polish government after the fall of Communism wasn't very eager to pardon Kukliński. That happened only after Clinton's administration threatened to block Poland's NATO accession if he weren't exonerated.
Also, there are some details that leave me a bit confused... For example, they mention they use ZooKeeper for Paxos, while ZooKeeper uses a different protocol, ZooKeeper Atomic Broadcast.
At YouTube (which is a predominantly Python shop) we use Go for some elements of our infrastructure, and I spend approximately half of my time working in each language (main project in Go, integration tests in Python). In my experience easy things (say, split and massage some strings) are more complicated/annoying in Go than in Python (and much more verbose). However, difficult things usually end up being much simpler in Go than in Python – especially if they involve concurrency (Python threading is a trainwreck). The difficult parts of our code consume most of our brainpower, so that's a net gain from our point of view. What is more, for some weird reason Go code seems to be less susceptible to bitrot (go fmt FTW).
We moved to the Bay Area when I got a job at Google a year and a couple of months ago. We really like it in California: my job is super interesting, the weather is nice, and the people are amazing. I cannot imagine any place in the world where I could have a bigger impact being a programmer. However, going back to Europe is a topic of our everyday conversations. Why?
My wife is one of the smartest people I know. She is the webdesigner you would love to work with (you know, those who can actually code their stuff in a way that works with all browsers, use source control, and are not afraid of using the command line). She worked as a project manager and her team loved her. She has interesting things to say about startups, business models, and Goedel's theorem. She used to have a career back in Europe, but in the US she's almost a non-person. She can live here, yes, she can drive a car, but she doesn't even have her own SSN. She cannot do any productive work, and getting an H1 visa if you are not a software engineer is extremely hard (we had this conversation with a couple of immigration lawyers).
I have my dream job, but at the same time I cannot help the feeling that I am ruining my wife's life.
If I understand correctly, the client can connect to any instance and its request will get routed appropriately. Let's assume that you take a master offline and promote one of the replicas to be a new master. Won't that lead to a window in which (from the point of view of different instances) there are two masters at the same time and some writes are sent to the wrong instance?
EDIT:
One solution for such things is to use something like Zookeeper (or some other system whose documentation mentions "Paxos" ;)). Have you considered that? How does what you are doing compare with that?
1. How much data can you put in one instance before seeing performance degradation? I know that you still working on good benchmarks – but do you have any ballpark figures?
2. How does replication work? Is it closer to row/document or statement based (or something completely different)? How fast is the replication?
3. What is your envisioned used of the replication? Are replicas supposed to serve read traffic, or their goal is to keep the data safe in case of a catastrophe?
4. Can you tell me something more about cluster configuration propagation? The Advanced FAQ answer doesn't get into much detail.
5. Am I correct to assume that you are using protocol buffers? What motivated your choice?
[1] http://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard
This case was an automatic audio match. Somebody from BMF has looked at it, and the claim has been released. Note that this happened around 5 hours after the dispute, and less than 8 hours after the automatic claim was created, which I believe is a pretty great turnaround time on a weekend.
"Clippy was crippled by MS when they implemented the working research project into the broken version used in Office. (http://robotzeitgeist.com/2009/08/lumiere-project-origins-an...) The original implementation was deemed "too cautious" by PHBs, and thus a stupid kludge was added to make clippy appear more often. (http://lesswrong.com/lw/7wt/funny_even_clippy_can_be_blamed_...) (Interestingly that URL mentions siri before it was released)."
YouTube has deals with major content producers (music labels, movie studios, etc.) which work in the following way: whenever we discover a video that infringes their copyright, they can choose to either block it, monetize it or track it. What blocking means is quite obvious; monetizing means that we put ads in front of the video and share the revenue; tracking means no ads are shown, but the owner can access analytics about the video (how often it is uploaded, how many people watch it, where from, and so on). You can read more about it here: [1].
As you may imagine, this system changes the incentives for copyright owners. When they decide to block some video, all they achieve is making some YouTube uploader unhappy. If they decide to monetize, on the other hand, they start making money from the upload, and the clip becomes, effectively, a marketing tool for their product. If you, say, watch clips from a TV series on YouTube, that may be a signal that you like the series and will eventually watch it on TV or iTunes. What is more, uploaders try to select clips they find interesting and think other people would like to watch – so this in some way turns YouTube into crowdsourced advertising.
(Disclaimer: I work as a programmer at Google and I work on YouTube.)
In Poland, I would classify myself as maybe a little bit above the average in terms of the sort of honesty described in the article (and that mostly with people I knew very well). Here, if I don't control myself I end up being the awkward says-before-thinking guy...
What bothers me most, however, isn't not being able to speak my mind; it's the lack of feedback from people around me. I am always left wondering if stuff like "I really like your other glasses" isn't actually code for "you look like an idiot in those glasses, and I am embarrassed to be seen with you on the street." I can only hope that with time I will be able to calibrate my sensors for California...
(On a side note, I feel really glad to be married. Dating must be hell in California ;)
For example: http://en.wikipedia.org/wiki/New_York_dialect#History (that article quotes the
So, I am very happy about Pinboard.in being successful, but I think it's a bit of a shame that such frivolous endeavors take Maciej's time from writing his blog :P
(A bit more seriously, it's really nice to find a compatriot doing something cool in more than one domain.)
The thing is done in Django+PostgreSQL+jQueryUI and uses the Wordnet 2.0 thesaurus which comes with OpenOffice. My wife was kind enough to make it look not ugly.
[1] http://www.ironicsans.com/2008/07/idea_thsrs_the_shorter_the...
(But thanks for the link to cloud9, I didn't know about it and it looks interesting.)
EDIT: meh, it was actually 4 browser based editors :(
There are not many good, scriptable editors for programmers. Actually, I would consider only 3 for serious use: Emacs, Vim and TextMate. Of these, only one has really good integration with OS X.
If I was considering switching editors, the language that is used to extend it would be one of the most important factors (I love Emacs, but Emacs Lisp is seriously broken). The fact that Kod uses node.js means two things:
1) It's JavaScript, so it's high level, has nice semantics and it's extremely popular;
2) It uses a reasonably fast dialect of JS, and has the necessary infrastructure, like CommonJS modules and access to the filesystem.
So, Node.js is the thing that makes this topic actually hacker-news-worthy.
Having an editor that I could extend in a real programming language (and JS is actually very nice once you grasp stuff like prototype inheritance and learn to avoid the... uhm, bad parts) would be simply awesome. And if it was pretty and integrated with OS X I would be willing to pay hard cash for it.