Go reliability and durability at Dropbox
about.sourcegraph.com
about.sourcegraph.com
For comparison, public telephony systems aimed for five 9s. That was usually expressed as "20 minutes downtime over 40 years, combined hardware and software budget, for outages affecting more than 32 users." One software crash requiring human intervention would count for more than 20 minutes, so you were allowed <1 of these in 40 years system lifetime.
They calculate this through the odds that a single node fails, and then multiplying that odd out through all replicas. This covers the most easily quantifiable failure mode.
Obviously the real odds are somewhat higher when you consider that a rogue admin, malicious actor, or buggy code could delete multiple instances of replicated data at once. There's no way to estimate these odds though, and really they don't matter - they're big enough events that they could spell the end of Dropbox if they happened.
FWIW Amazon make a similar claim of 11 9s for data durability on S3: https://aws.amazon.com/s3/faqs/
"Go reliability and durability at Dropbox" "Dropbox hires engineers who care about reliability and durability"
for S3, in your link, there is very clear definition of the claimed durability, there is no similar definition in that dropbox article -
"(S3) designed to provide 99.999999999% durability of objects over a given year. This durability level corresponds to an average annual expected loss of 0.000000001% of objects."
And all of that is total bogus (the "aim", not your information), as no public telephony system (and surely not in my country) ever had anything close to that.
A few hours of downtime a few times a year is much more like it, although it has been getting better over time.
As I have a computer constantly connected to a server via SSH, and have to manually reconnect whenever it fails, I'd think I'd notice.
Nowadays, you can look into your router logs. And Telekom had serious issues with their VoIP stuff.
Likewise, even the apparently planned outages at my previous location exceeded the 30 minutes. (It's still good, but not that good.)
Yeah, they're starting to do maintenance here now, too (for introducing the 500/200mbps VDSL2), but I've never been with Telekom, and my existing ISPs never had real issues.
Sort of worst case: what it could mean is that every hour, the system reboots and this process takes 10^-12 of an hour, which doesn't seem like much, but you'd have to restart your client as well, which may take longer and is annoying, and you could lose data. So basically, the system would be useless :)
(* 1e-5 365.2425 24 60 4) => 21.038
(* 1e-6 365.2425 24 60 40) => 21.038Hum, I'm not sure what this means. Is it saying go is a productice language, or just that you'll master go quickly and reach peek go productivity quickly?
? Go is tiny. The tutorial takes an afternoon. A C programmer will be profecient within days.
Learning the keywords and basic Go syntax is simple, so in that sense days fits, but a C (or C++) programmer is probably also going to be writing unidiomatic Go code, falling back to unsafe too much, trying to recreate OOP with some kind of wonky self-rolled inheritance system, etc, for a few weeks before they really "get it".
This "hype" around go letting you be productive sooner is honestly just bullshit. I've been programming for 20 years, with C, C++, Ruby, Perl, Scheme, Haskell, Rust, Go, Java, and others I've surely forgot. Sure, I was able to start writing go within a day. But it was terrible go, and months later I was still dealing with the consequences of early bad decisions.
This isn't unique to go by any means. But if you go in thinking you're going to write a project that does some sort of non-trivial task and be able to rely on that later, you're going to have a bad time.
So it's 1 day of learning Go + 1 month of learning style vs 2 weeks of learning Rust + 1 month of learning style. [1]
[1] Note, I think that Rust has the best community when it comes to getting beginners up to par, whether in #rust-beginners or on /r/rust. It just is a hard and not forgiving language.
That is exactly my point, and I said as much in my post.
> So it's 1 day of learning Go + 1 month of learning style vs 2 weeks of learning Rust + 1 month of learning style.
More like 1 day vs. 1 week, with six months of ramp-up before you're writing anything approximating production-quality code. At which point, does it really matter that you were able to write garbage in one day rather than seven?
https://news.ycombinator.com/item?id=14934690
One way to get your correct answer is for me to propose a wrong or partial answer. How is this as a message to the past (i.e. I am guessing your answer to the above request):
WRONG/FAKE ANSWER:
"Note to past self: although you can write code that compiles on day 1 and day 2, before considering your code idiomatic and ready to build on top of (or even deploy to production), DO/LEARN THE FOLLOWING:
1) read and work through all of The Go Programming Language book. This teaches all idioms.
2) Practice and use Go's testing tools (built-in). Always use its reformat tool applied on every save from your IDE.
3) Begin using a better error and logging library than the built-in error passing idiom. Google this.
4) Use a debugger. Google this.
5) Security and versioning with go get is broken: Google this and learn vendoring with versions. Otherwise your code cannot go on production.
6) You control garbage collection frequency. Learn to set this. In emergencies disable it entirely to trade memory for latency to gain one or two milliseconds (approach hard realtime), for example when you are dropping requests. Then reenable when you can take the (very small) hit. Garbage collection is very efficient and low-latency.
7) Channels and concurrency (goroutines) do not work as described. Specifically:
- This link will solve your problems with channels: https://stackoverflow.com/questions/41200505/whats-the-best-...
Adopt it. Then they work as described.
For goroutines:
Follow this document - https://gist.github.com/pzurek/6642797
After incorporating the above specific changes, you are ready to commit to production and build on top of what you want to build.
"
is the above message completely wrong and bullshit? Then please correct it.
Your insight and experience are appreciated and I would love to read what you would write as a message to yourself in the past, to save those lost months. Thank you.
Sure, read books and blog posts. Test things. Learn debugging tools. But nothing really substitutes for actually working with a language. Having an experienced mentor helps, but only if they're advising you on why they chose a certain approach, or why a critiqued approach you chose was bad.
Remember: I didn't ask for a shortcut, I asked for specific sentences that you could have sent back in time to prevent this:
>months later I was still dealing with the consequences of early bad decisions.
Your sentences can be literally anything, specific to your specific situation, that could have prevented those bad decisions.
So, let's be clear. Your message to the past you reads:
"Hi - I am you from the future. I was asked to send back a message in time listing specific things you can do right now, having just learned Go, based on my having to deal with your code, that can prevent your bad decisions which you will be dealing with months later. It is impossible to put this into English words. So, I have no advice for you of any kind. Fuck you, past-me. And also fuck me - I'll just have to deal with your lack of understanding. I hope you have found this mentoring by me to be as helpful as I have. I don't believe in mentoring."
So, that's the new version of your message, based on your review of your own code and memory of your decisions and learning process at the time.
Well, okay. I guess I accept your viewpoint. (Note: if there's some other reason you don't want to answer publicly, such as not talking about your codebase, you can email me at the email in my profile.)
I am looking for specific architectural advice, using your experience as a case study.
You refer to:
>best practices, idioms, and understanding the pitfalls around concurrency and channels, which are nowhere near as "batteries-included" as people would lead you to believe.
Could you summarize these?
You wrote:
>Sure, I was able to start writing go within a day
If you could send back in time a brief note to yourself to prevent
>months later I was still dealing with the consequences of early bad decisions.
then what would you write? You can include links that the "day 1" version of you should have followed, or simply warnings.
I would be highly interested in more information on the above, from you or anyone else here.
Thanks so much!
Hi! (I got a downvote but this is serious - I believe you!)
Thanks for this useful information. Could I ask you (or anyone else) to write maybe a checklist of links/resources or steps a programmer could go through?
Thank you again!
* tour.golang.org
* gobyexample.com
* The Go programming language book. (If you're a C programmer, one of the authors might be familiar to you)
Personally I got hooked when I saw a talk by Andrew Gerrand where he created a working chat server in about 30 lines of code. I'd recommend this after gobyexample just to get a taste of what's possible - https://talks.golang.org/2012/chat.slide
I hope you enjoy it :)
Experience?
One does not get 'proficient' in a week in any given language. One can build up a program in a new language in a week, but that does not mean proficiency. It takes between many months and a few year to become proficient in a language: it is the outcome of a process of exploration, trials, mistakes, discoveries of better or more adapted ways, finding out the shortcomings an learning to work around them, picking a right balance between ease to write and ease to read, ease to write and performance...
So let's quantify what "proficient" means. How would you measure of someone is proficient in a programming language?
There is no shortcut where you can produce and distribute a binary so every damn user of your program will have to deal with Python versioning, installing dependencies etc.
So for the user, Python is not productive. It is time-consuming and bothersome.
I can see that an experienced Go developer would be more productive than an experienced C developer. But, based on my experience of writing Go, i can't see how they could be more productive an experienced developer in any other current mainstream(ish) language - by which i suppose i mean Python, Ruby, Java, Scala, Kotlin, and (modern) C++. Go's great strength is how fast it is to get up to speed with, not how productive it is once you are.
Some languages have a lot of mental overhead (JavaScript being an easy example), which I don't think matters how seasoned you are - I think it's pretty much a constant in that language. So even if you're a seasoned developer, I think it's very possible that there are other languages which are objectively more productive for seasoned developers.
So, which languages Go is more productive than is not something I can say - but I think it's a quantifiable thing. There is a nice middle ground between rigid safety of something like Rust, and careless abandon of some extremely dynamic languages. Go has a nice middle ground, but whether it's the "perfect" spot I'm not sure. Hell, I'm not even willing to say it's objectively more productive than X languages.
I will say that for me, personally, it's far more productive than JavaScript (Node) or Python. I can whack out more code in Python, faster, but any moderately sized project starts to run into maintenance overhead, and then suddenly I wish I was in a more rigid language. Middleground is good here, I think.
Though, I will say that if a language like Python gets some nice typing tools like they're working on - especially behavior based typing like Go's interfaces, Rust's Traits, etc - I think that language could really shine for larger projects. Prototyping speed and maintainability is a big boon.
Others mentioned overhead which is a big issue. Because Go is so simple the mental overhead of remembering how to do stuff, edge cases, etc. is much smaller than other languages. Sure, a Go dev and a Java dev can be just as productive in their respective languages. But as somebody who has to switch back and forth between Go, JS/TS, PHP, and Java Go is by far the easiest language to switch back to.
Style and maintainability still falls on the programmer, but Go code never "feels right" unless it's done neatly with as little magic as possible. I think that property is super beneficial in keeping a large and growing team/codebase effective and malleable enough.
Why is this such a huge benefit for code that typically works at the system level? Wouldn't you value reliability, consistency, etc when adapting system level functions over speed to deployment?
Cool that they use Go a lot.
It's like a more intense form of adding annotations in theory.
So while it requires a rewrite, a cost which you should not write off either, it can feel similar to Python but more verbose. Where Rust feels like Haskell and C++ had a child together and can be more jarring to switch to (in my experience as primarily Python/Django who uses Go in many side projects and tried Rust up-to and around 1.0).
(something something we're hiring)
(I work at Dropbox)
(But not vice versa: Go wont be able to handle the no-GC close-to-the-metal use cases).
The orthogonal fact that it's a much richer language also means that it will always be harder to learn, so Go has advantage in the niche of beginners' language, or second language, particularly for people who mainly work in an untyped language, and so don't already have type system instincts to lean on.
YMMV, but I think people just want something fast, productive, and safe by default. Normally you had to pick just two, but Go gives you 2.5 (Not as safe as it "could be") and Rust only gives you 2 right now (Not as productive, libraries too immature), but it is on it's way to giving all 3 as soon as libraries gain maturity.
On the technological side, I guess separate hostnames might make some ops things a little easier. But that alone can hardly be the reason. Easier and good looks can. Also: In a large scale outage, an about.x.com that is not running on your main cloud provider could be valuable for status updates, because far more people would know about about.x.com than about some status.x.com you might have if your "about" content was on the main hostname.
Is there a specific flag to enable ?
I'm skipping back and forwards through it, but the talk isn't in the same order as this article which is making it very difficult without watching the whole talk from start -> end.
Asking because debugging is a pain point I've been having with Go for a few months, so am surprised to see it described as mostly working well. I'd like to get my debugging experiences to at least that level of "(mostly) working well". :D
a) Pretty much any platform other Linux doesn't seem to work (for debugging). ;)
b) Breakpoints occasionally not firing even when running Linux (Fedora 25 in this case)
This is with CGO enabled code, which isn't optional as it's from the libraries we use (no choice).
Using Delve for debugging (though Gogland atm), as we're not yet in production.
Fairly worried about how things will er... go ;) in prod though when we get to rolling things out.
With Delve, it's apparently the state of the art with Go debugging. If something else actually works reliably though, I'm happy to try it. :)
> Data races are the hardest type of bug to debug, spot, fix, etc.
Exactly what Rust aims at preventing. Sad to see that the industry is not learning.
Sad that Rust advocates are not learning. This sort of comment is what drives people away from Rust. Stop ramming your stuff down other people's throats. Go build that exclusively Rust based Dropbox clone that outperforms Dropbox and show how well Rust performs in that situation.
Rust has trade-offs just like Go has trade-offs. Being honest about the deficiencies of ones chosen platform is a good thing, it helps to keep you sharp and to avoid problems associated with those deficiencies.
Besides having an over-zealous community that posts off-topic comments all over threads that have nothing to do with Rust, Rust has deficiencies too.
Note also that Dropbox is already using Rust in some places.
Pointing out your preferred language addresses one of the hardest problems in another language qualifies as "ramming your stuff down other people's throats"?
I find that hard to believe.
I really don't think I'm the only person noticing Rust fans being a little - to put it mildly - overzealous when it comes to this. I do not see the proponents of any other language doing the same thing.
That said, Go is the best of the C-style concurrency breed; having typed message passing and green threads built into the language.
http://catb.org/esr/intercal/ick.htm#Multithreading-using-CO...
https://blogs.msdn.microsoft.com/larryosterman/2004/04/28/wh...
Cut them some slack.
On the flip side, I have been frustrated particularly at linux.conf.au last year at how "not deep" many of the talks were. Having done quite a few talks over many years at similar conferences, it's actually quite hard to nail something technical and be entertaining for a presentation at the same time. Someone who nails that quite consistently is Aaron Paterson (from the Ruby/Rails world). Watch some of his talks on Youtube.. I aspire to produce more content on a level similar to his. To combine good entertaining presentation with actually educating an audience about the technical non-obvious details of something they probably didn't know -- and something that was relevant in a practical project he took on. Working on it, not there yet...
Ya'll too young to remember OG Gopher https://en.wikipedia.org/wiki/Gopher_(protocol)