Tested: The truth behind the MacBook Pro's 'terrible' battery life - <AUTHOR> http://www.macworld.com/article/3157392/laptop-computers/tested-the-truth-behind-the-macbook-pros-terrible-battery-life.html <comment><USER2> So far none of the reviews (including this one) have been that relevant for makers/hackers.

I have the new MacBook Pro and yes the battery isn't great. On average you're pressed to get 3-4 hours of realistic development use. I say "realistic" because all the test I've seen have been very artificial and don't mirror a typical hacker's environment (using Chrome/Firefox with a zillion tabs open) multiple electron based apps (hear: Slack, Frontapp etc), with sublime and terminals running.

This contrasts the 7-9 hours of realistic use I'd get with a 13" MacBook Air (which I still think is Apple's best machine ever made, in spite of it's non- retina screen).

Just a heads up the changes to the keyboard are terrible (especially the arrow keys layout). Surprisingly the virtual escape key hasn't bothered me as much as I thought it would, even in vim.

The other thing you should be aware is that this is the first MacBook where I get unintentional input on the touch pad when typing. It's really annoying to be writing and have the mouse jump the cursor position to another part of the doc. This is something that I experience all the time on non-apple HW (and scoff at), and it's really sad to see Apple's once perfect touch pad drop to that level.

If you're thinking of buying the new MacBook Pro, my short answer is "don't", see what you do about hanging out until the next revision or possibly switch platforms.

<comment><USER3> Give Safari a shot. For me, it increases battery by at least 25% vs. Firefox or Chrome with many tabs open, probably more like 50%+ sometimes.

Cutting the Electron apps might also help a lot.

I can't imagine having many terminals open takes any appreciable CPU, unless you're using them to continuously run compilers or something.

You can also try reducing the display brightness, turning off bluetooth, and poking around in the Activity monitor to see what other processes are using lots of CPU time.

<comment><USER2> I actually do/did! I much prefer Safari for the iCloud Keychain syncing with the iPhone. (Apple actually stuffed thr keychain app up too recently where on the macs with touch bar keychain takes a few seconds to do a query). I have been a huge proponent of Safari but currently there is a real annoying bug where the URL/Search input won't register the "return/enter" key press for a URL or query. This happens once every 20 or so times and to get round it I need to close the window, reopen it and paste my query.

I've nuked the caches and removed extensions to no avail.

<comment><USER4> That annoys me too :/

</comment></comment></comment></comment><comment><USER5> This sounds about right. They improved the efficiency of the machine overall and they felt that they could decrease the size of the battery and retain the same unplugged runtime under "normal use."

Add a "pro" workload with more frequent CPU or GPU intensive tasks, then those efficiency gains count for less and you start to notice the smaller battery.

Did they make the right choice? The smaller battery does make the machine lighter and probably contributes to the additional thinness they were able to achieve, but you can also make a good argument that for pro users, heavy workload battery life matters more.

<comment><USER6> You would think they would've tested the battery life of a "Macbook Pro" for "pro" work loads, wouldn't you?

If Apple has seen that most people buy their Macbook Pros as Facebook machines, then maybe launch a new line that actually targets the pros, and give it another name for differentiation purposes.

<comment><USER7> At max CPU it's 15min less battery life. That's really not that much different for any real purpose.

</comment></comment></comment><comment><USER8> I got a non-touch bar 13" MBP and the tests back up what I've experienced over the past couple weeks. Normal usage the battery is stellar, do something high CPU bound for a long time and you'll suffer.

Coding I've been doing in my spare time (Euler problems) the battery life has been 10 - 12 hours with medium brightness. Stellar compared to anything I've had before,

Using the coconut battery app though I can see when my CPU is taxed (churning out truncated harsahd numbers or w/e) I see the estimated battery life go down to about half that.

I think that's pretty fair for the machine, and I doubt any other small notebooks would fair much better under intensive tasks.

Looks like what really ate them was the 15" model could get the discrete GPU stuck on without cause, which __kills __the battery.

<comment><USER9> I have been using gfxCardStatus [https://gfx.io/](https://gfx.io/) for years. It offers a finer level of visibility and control over what's going on with my GPUs.

<comment><USER10> Yep, gfxCardStatus comes highly recommended. I still don't understand why Apple has a "Keep the dGPU on always" option in power settings but not "Never use the dGPU".

There are also a lot of people with bad VRAM or a busted GPU that use it to keep their machines from kernel panicing.

</comment></comment></comment><comment><USER11> I have a new 15" MacBook Pro with touch bar and can confirm that this OS X update (10.12.3) made a very noticeable improvement on my battery life. It went from 4 hours on moderate usage to at least 8... This relieves the majority of my anxiety with the new MBP and I'm now really happy with my purchase.

<comment><USER12> Seems crazy that a software update can make that big of a difference. It almost makes me think they held this back on purpose.

<comment><USER11> Extremely doubtful, considering how much negative PR they've gotten on their new line of MBPs because of this... The costs must far outweigh the benefits.

</comment></comment></comment><comment><USER13> Do many people do "pro" workloads on a battery? I always have a charger with mine and frequently lots of peripherals; USB keyboard, mouse, monitor, external HD, etc. and if I'm running 4 docker containers and a full stack of software, it's getting pushed pretty hard. Not sure I'd really expect much of the battery when you're whipping the machine like that.

<comment><USER14> Do you commute? I often run unittests and re-compile whilst on the train.

Depending on the tech stack, these things can be heavy, or unexpectedly heavy.

<comment><USER13> I hadn't considered that. Commuting by bike there's not a whole lot of unit testing going on for me

<comment><USER15> I have actually seen someone using a laptop while biking. Not that I'd advise it.

</comment></comment></comment></comment><comment><AUTHOR> My Google-foo isn't working so I can't provide the link, but I read somewhere that USB-C does't provide enough power so it will actually discharge your battery _while plugged in_ if you run it under heavy CPU/GPU load for an extended period of time.

Can anyone confirm this?

<comment><USER16> I can't confirm from my own experience, but popular tech reviewer MKBHD tweeted something similar[0].

[0] [https://www.twitter.com/MKBHD/status/827182930954973185](https://www.twitter.com/MKBHD/status/827182930954973185)

<comment><USER17> If you read his followup tweets, he wasn't charging with the MBP charger, but off of his monitor.

<comment><USER16> Ah I hadn't read that far down. Thanks!

</comment></comment></comment></comment><comment><USER18> Mimics what I've seen on a maxed out 15" MBP. Author killed the battery in 83 minutes running a CPU benchmark and in 81 minutes with the GPU on Tomb Raider.

Browsing the Internet, I easily get 4-6+ hours of battery life. If I switch to coding (RStudio IDE seems to be very intensive) or similar, battery life drops precipitously.

I still dislike the keyboard after a few weeks of using it; I briefly switched back to my old MacBook Air to move some files a few days ago, and it was really much nicer.

Migrating from a MacBook Air, the biggest improvement (by far eclipsing anything else) was the screen. It's incredible, although I can't compare it to the previous generation MBP. The touch bar feels like a gimmick; I rarely use it. At least it doesn't get in the way, and the virtualized escape key is totally fine. I've also had palm rejection issues with the enormous touchpad that I never had with my MacBook Air.

The weirdest issue I am having is that programs crash after resuming from sleep. RStudio crashes almost 100% of the time. It's hard to interpret the error messages, but I believe it might be due to a bad RAM chip ("memory not mapped"). No Mac I've ever owned has done this before. I'd really appreciate it if anyone had advice for this! It's getting to be problematic.

<comment><USER19> I'm a heavy rstudio and Python user and have been wondering how the new MBP would perform with those apps rather than just video, thanks for posting

<comment><USER18> Python seems fine generally, but I don't use a Python IDE

</comment></comment></comment><comment><USER20> I get at least 8-10 hours on my tMBP 15". I don't mind the keyboard. I this point it seems like hating on the MBP is 'free karma' and the 'in-thing' to do on HN. My experience has been otherwise.

<comment><USER2> I wish I could get those numbers! I only ever achieved those on a 13" MacBook Air.

>> 'free karma' and the 'in-thing'

I hate to admit it but I have an "Apple Problem" purchasing pretty much everything they've made. I'm event wearing right this moment a WWDC Apple cap! What I'm trying to say I'm naturally much more biased towards Apple. It's safe to say that this is literally one of the worst Macs I've had (stability/battery/experience wise), and man I've had many! The device as a whole seems really retrograde, and I'm hoping they can get it sorted out via firmware/software.

Here's an example of the bugs I've seen:

\- Kernel-panicking when unplugging it from the LG 5K display. \- Not waking up from sleep after unplugging it from the LG 5K display. \- Randomly restarting when in sleep mode

I haven't seen the above issues "overly reported" like the battery issue is.

</comment></comment><comment><USER21> After going through a few of these articles, this is my very general takeaway summary:

"The new MacBook Pro's battery life is not as good as the previous generation but is still decent for its class. The decrease in battery life, compared with the older model, is mostly due to a brighter screen, better cpu/gpu, and slightly smaller battery. Ultimately, it is up to the user and the user's use case to gauge the actual battery life and tradeoffs of upgrading to the new MBP."

<comment><USER22> My only caveat is that the improvements to cpu/gpu typically result in _lower_ power consumption requirements. The screen is also lower resolution (compared to 4k) and with brightness user-configurable, not sure how much it is to blame.

I think the bulk of the issue is the almost 25% smaller battery (as noted in the article). So the real trade off is thinness and weight for battery life, not performance for battery life which is more typical of competing laptops.

I don't think the new MBPs are _bad_ machines, but I probably won't be upgrading my current one to one of the new ones.

But sales figures seem to indicate the thinness trade off appealed to a broader range of buyers...so ultimately it was probably the right business decision for Apple.

</comment></comment><comment><USER23> Video playback is no longer a benchmark with Hardware video decoding units that let CPU practically shut down 80% of die space. People actually expect to USE the laptop like a computer, not like a movie watching on a toiled tablet. As the last test shows using CPU shows new laptops to be worse than the 2015 models.

Btw Did this macworld.com writer run out of bytes on the page? was that the reason he had to split this article in two? or was it just for additional ad impressions?

<comment><USER10> Yeah, I'd say video playback is no longer a benchmark because if I'm going to watch video, I'll be doing it on my iPad, not on my laptop.

Or if they're going to make video watching a benchmark, at least make it use modern streaming services like YouTube and Netflix. Who downloads a movie to their drive and watches it from there anymore?

</comment></comment><comment><USER24> I'm not a Mac user, but bravo to the author for doing a really good analysis. I run a skylake-based Asus running Ubuntu with Gnome and it performs well, but the battery life does vary more than my Lenovo/haswell did. I'm able to get minimum 5h of dev, max 10h, depending on a variety of factors, without using powertop tuning. This post reminded me that my suspicions about Gmaps are worth investigating. Try to always close maps... But now I will be more careful!

</comment><comment><USER7> I'm going to throw something out there that I think might not be agreeable to many, but I stand behind it either way.

Old Mac line

MacBook Air - "light" workload

MacBook Pro - "pro" workload

\---

New Mac line

MacBook 12" \- "light" workload

2016 MacBook Pro - "pro" workload

If you think of it in this light, the "Pro" moniker is very fitting. The 2016 MBP is very much the Pro version of the 12" MB.

Yes, it's not as good as older MBP for many, but it still very much earns its name vs the 12".

</comment><comment><USER25> I'm surprised nobody has yet brought up the update that just came through which fixes issues in graphics card switching in new MBP's. If it preferentially uses the discrete graphics more than it needs to then, well, you know, battery drain problems.

<comment><USER26> Nobody other than page 2 of the article you mean?

</comment></comment><comment><USER27> I've been using one of the new 15" with the touch bar for about 2 weeks now.

I agree there's a lot more hate in user forums than on professional review sites. I don't know that either are 100% honest... but I think it's because for so long Apple set the bar so high. My biggest gripe with my 2016 MBP is that it doesn't feel like there's any room to grow. Every MBP I bought to date felt like it was way ahead of the curve. The new ones... meh, they are fine. Just nothing special. (I wouldn't have bought it for myself, but since work was paying...)

1) I don't notice the battery life being any better (or worse). When I'm just surfing the web / doing emails... it lasts a good 4-5 hours. I always plug in when I'm at my desk and I can certainly go between meetings fine. When I play a video, fire up a game, or do a site crawl (for a 250k+ page site) the battery doesn't last. The old ones didn't either.

2) Keyboard took some getting used to... but I do like it now. I really didn't at first. And I didn't like it until I went back to use my old computer and the old keyboard just felt soft and loose -- the old-style keys had more give to them, now typing on that feels like trying to drive a car with huge tires on.

3) Dongles... I miss the MagSafe power plug... I really wish Apple would have left that. But I bought a little hub for all my USB products and it's fine. I have another dongle for HDMI cords. I don't love the new ports, I see no benefit to them... but, I get it -- Apple wants to push the envelope where it can. I carry a lot more dongles with me now that I have at any point in history. Not a fan of this situation at all. I don't want to carry a bag full of wires with me.

4) My old MBP had an upgraded graphics card, and the new one is just stock. I think my 2013 with the upgraded card handles games better than the stock 2016... but that's not fair since I boot to Windows on my old computer. Macs aren't for gaming... I know. But like... sometimes shooting a few aliens in XCOM is a good way to kill time when a client bumps the meeting back. =P The fact it can't run games from 2012 at max settings... this does bug me because of how expensive this computer was. It handles "medium" settings about as well as my 2013 with the upgraded graphics card did...

5) I don't use the touch bar. I just have it set to show function keys most of the time. I miss a tactile "esc" key. I don't know, it's not really something that I think about or have a gripe with. It's just different, but I can't say it's better or worse than the old physical function key row.

6) The new touch pads are way too big. I'm still bumping it when I don't want to. I have no idea how I'm supposed to use a touch pad this large... the old ones were perfect, this was a clear case of "fixing what ain't broke."

<comment><USER28> >1) I don't notice the battery life being any better (or worse). When I'm just surfing the web / doing emails... it lasts a good 4-5 hours. I always plug in when I'm at my desk and I can certainly go between meetings fine. When I play a video, fire up a game, or do a site crawl (for a 250k+ page site) the battery doesn't last. The old ones didn't either.

That's actually sort of surprising to me, I get like 15-16 hours just web browsing.

<comment><USER27> Sorry I wasn't clear -- I always plug it in when I'm at my desk, and I'm hardly ever away from my desk for more than 4-5 hours. So I know it works that long at least. Past that... I mean I haven't deliberately not plugged it in just to test...

I got through a movie and a handful of Rick and Morty episodes while on a flight... Drove home from the airport late so I just went to sleep... hit the "Lower Power Mode" warning as soon as I opened it the next day. It wasn't plugged in that night... Battery life seems reasonable. It doesn't seem amazingly better than my old MBP.</comment></comment></comment>


JSRs: What Lies Beneath - <AUTHOR> http://www.infoq.com/news/2010/09/what-lies-beneath

<comment><USER2> The example of the complication involved in making Strings in switch statements efficient intrigues me. The point is that implementations are more complicated than they might first seem. But it looks in this case like the additional complication was (in part, at least) a choice.

I don't see why the initial implementation couldn't be simpler. Wouldn't the simple implementation have similar performance to the status quo (i.e. using if statements), with the immediate benefit of cleaner syntax? In fact, why should this level of optimisation be part of the JSR at all? It sounds like something the JVM implementers could optimise without any change to the way the switch works. Tying it to the JSR makes the spec more complicated, delays an initial version and forces this optimisation to be prioritised over others.</comment>


The Socioeconomics of Parenting: Why Rich Parents Don't Matter - <AUTHOR> http://online.wsj.com/article/SB10001424052748703954004576090020541379588.html <comment><USER2> I'm not qualified to comment on the fuzzier elements of psychology here, but rich parents _do_ matter in some pretty practical ways.

Most dramatically:

Rich parents know interesting people. In many cases, wealth is a function of trust combined with ability. You don't (usually) get wealthy by hiding in your basement and never talking to anyone. So along the way, you meet good people and build relationships.

Conversely, the less wealthy a parent is, the less likely they are to form relationships with people who can benefit their children. At the extreme end: if your mom is a fry cook at McDonald's, what benefits are her colleagues able to offer you? How many of those connections can benefit your future?

On the other end, if your mom is Marissa Mayer, you're in much better shape. 14 and want a summer job? I bet she knows someone who could give you some interesting, mind-expanding paid work. 19 and looking for a college gig that can help you get a great job after your graduate? etc.

It's anecdotal, but growing up in a household that wasn't at all wealthy, I can point to this as the greatest disadvantage I faced. I wanted to learn programming, but we didn't know anyone who knew anything about that. I wanted to know anything at all about computers, and I was on my own. Not an insurmountable problem – I taught myself. But I know access to mentorship at an early age could have made a huge impact.

<comment><USER3> Sure, but these rich kids also face pressure to do whatever the family tradition is.

I know a girl who had big trouble with their family because she wanted to study medicine and become a surgeon (!) instead of studying business and managing the family investments.

Rich entrepreneurs are often not very intellectual, except for maybe tech and financial entrepreneurs. The grass is always greener on the other side.

Edit: That girl did become a surgeon after all, though.

</comment></comment><comment><USER4> "How much do the decisions of parents matter? [...] the home environment pales in comparison to the power of genes and peer groups."

Parents often get to decide who's in the peer group, though. Especially in the early years and especially for parents with money.

</comment><comment><USER5> This is a misleading headline, in that the obvious interpretation is not the intended one. Something more like "Why variation among rich parents doesn't matter" would be better.

<comment><USER6> More specifically "Why variation among rich parents' behavior doesn't matter"... because rich parents' genetics are shown to be extremely important: it's just that essentially all rich parents seem to do enough for their kids to see diminishing returns on doing more/different things.

</comment></comment><comment><USER7> "These results capture the stunning developmental inequalities that set in almost immediately, so that even the mental ability of 2-year-olds can be profoundly affected by the socio-economic status of their parents. As a result, their genetic potential is held back."

<comment><USER8> "By the age of 3, children from wealthier households hear, on average, about 500,000 encouragements and 80,000 discouragements. The ratio is reversed in households on welfare."

I often wonder how much of it is environmental. Why are the parents poor in the first place? Is this directly related to education? If so, it doesn't surprise me that children of parents that aren't educated (and don't stress education) are affected by this.

<comment><USER9> _Why are the parents poor in the first place?_

Because they prefer leisure to work, even if it means they have less money. The poor have a labor force participation rate about 1/3 that of the non-poor (20% vs 65%) and a full time labor force participation rate of about 1/5 that of the non-poor (10% vs 55%).

<http://www.bls.gov/cps/cpswp2007.pdf>

A significant amount of the extra leisure time is spent watching TV.

<http://www.bls.gov/news.release/atus.nr0.htm>

[edit: Hi downmodders, sorry for providing inconvenient facts.]

<comment><USER10> > _Because they prefer leisure to work, even if it means they have less > money._

Who takes bus at 4 in the morning to clean the toilets at your office and leave before you arrive at 8? The poor. Who does two different, hard and unfulfilling jobs to make end meet? The poor. Who has to spend 12 hours far from home but is paid only 3 hours? The poor. The poor have it much less easy than you and I, and your self-satisfied condescending attitude is sickening.

<comment><USER11> It really depends on what _easy_ means here. Poor people might have to work more often and might have less physical comforts or conveniences available, and those things can certainly ease a subset of life's problems, but I wouldn't say that money automatically makes one's whole existence or life _easier_. I've known several individuals more affluent than myself whose lives, at least in my estimation, are much more difficult.

Money can take care of some things, and the things it helps are nice, but I think it's important for us to have some perspective.

Wealth comes with its own worries and some of those that don't have these worries ought to be grateful that they don't. Beneath its luster, wealth is often regarded as a destroyer. Think about it: of the the few that are capable of obtaining wealth, fewer still are able to bear it without destroying their own life or the lives of many surrounding. Wealth comes with burdens. Can you bear it?

<comment><USER9> Actually, in terms of physical comforts and conveniences, they don't lack that much.

See this fantastically interesting document - if you want to know how many poor households (or non-poor households) have (e.g.) a "Porch, Balcony or Deck", exposed wiring or have AC, the answers are all here.

<http://www.census.gov/prod/2008pubs/h150-07.pdf>

The poor have it a bit worse than everyone else, but it's not that dramatic. Most of the poor have a house with plenty of space, a car, etc.

</comment></comment></comment></comment></comment></comment><comment><USER12> Hate it when they don't tell you who the authors are or the title of the paper. <http://www.psy.utexas.edu/>

</comment><comment><USER13> The thinking in this article is entirely wrong headed. All that is being observed is a hygiene factor. As soon as home life reaches a good enough childcare baseline, other factors such as genetics predominate.

</comment><comment><USER14> How much does diet matter?</comment>


Hot Mess at Techcrunch Disrupt 2013 - <AUTHOR> http://www.youtube.com/watch?v=ZVhwXXxvgyE&feature=youtu.be

<comment><USER2> The idea is good, but the way you communicate it is inefficient, if you fix that it can easily become successful. Replace the App by a anonymous web- service that uses firebase or websockets to communicate to users near you. People can sign-up by e-mail + gravatar, but sending private messages should be possible anonymously. If that doesn't work good enough, integrate it with Path/Foursquare.

<comment><AUTHOR> This is fantastic advice. I appreciate it. We were looking into setting up some kind of proximity location and communicating that way but, in 24 hours, settled on what we knew. Long term, though, this is a good idea. Thanks!

<comment><USER2> Would you please keep me updated and tell me, if you're successful with the startup or not? How can I reach you?</comment></comment></comment>


Safe Financing Documents - <AUTHOR> http://ycombinator.com/safe/ <comment><USER2> Neato. Is this new? Are there any companies that have financed using SAFEs?

</comment><comment><USER3> As mentioned in another thread, I like this. Instruments that look like debt (terms and interest rates) generally are the instruments of lower risk investors. Linking them to equity is the game of wall street arb desks. Turning the instrument into a warrant is more in lines with high stage early equity investing - giving folks an option on a potentially large upside.

</comment><comment><USER4> I would have used these a few years ago, and would in the future. This is now my convertible notes worked out so far, in practice - we offered to pay them back, or let them continue indefinitely, after they expired.

They were written as classic notes, for just friends and family, but we haven't raised yet. We dealt with the expiration in a non-official way, via email - basically like a SAFE, but still accruing interest. If my investors weren't as close as they are, or if it would have been more money, this might have been an expensive issue to deal with.

</comment><comment><USER5> Not starting your new company with 250k in debt sounds great. It will be interesting to see how fast this takes off.

<comment><USER6> Er, this doesn't make a lot of sense. Personal debt and corporate debt are not the same thing.

</comment></comment><comment><USER7> Even without formal interest, some incremental benefit over time, if a funding takes longer to convert than expected, seems justified.

Has anyone considered a gradually _decreasing_ cap as a way to simulate the time-varying rewards usually delivered via interest? (That is, decay-the-cap rather than grow-the-principal.)

</comment><comment><USER8> after reading these documents, sounds like a safe is basically a refundable security deposit.</comment>


Say hello to Liliputing's new commenting system - <AUTHOR> https://liliputing.com/2017/03/say-hello-liliputings-new-commenting-system.html <comment><AUTHOR> TLDR: "I would have been happy to become a paying Disqus customer. But not without local database synchronization… and not with the level of non-support I've received over the past few weeks."</comment>


Peerflix Hits the Replay Button (Again)--Wants to Become an Ad Network - <AUTHOR> http://www.techcrunch.com/2007/11/13/peerflix-hits-the-replay-button-again%e2%80%94wants-to-become-an-ad-network/ <comment><AUTHOR> if at first you don't suceed...</comment>


Ask HN: Is There A Steam-Like Service For Publishing Software? - <AUTHOR>

I was thinking that Steam is the go-to multi-platform game selling/publishing service, and that every major platform has it's own software publishing store (e.g. Mac App Store, Ubuntu Software Center). Yet, is there a multi-platform service similar to Steam that allows you to publish software? <comment><USER2> Well, Steam sells software now. Not exactly the answer you were looking for, but they began selling regular software packages awhile back.

I don't know how multi-platform their software offerings are, though.</comment>


How complex systems fail (2002) [pdf] - <AUTHOR> http://web.mit.edu/afs.new/athena/course/2/2.75/resources/random/How%20Complex%20Systems%20Fail.pdf <comment><USER3> _The system practitioners operate the system in order to produce its desired product and also work to forestall accidents. This dynamic quality of system operation, the balancing of demands for production against the possibility of incipient failure is unavoidable. Outsiders rarely acknowledge the duality of this role. In non-accident filled times, the production role is emphasized. After accidents, the defense against failure role is emphasized. At either time, the outsider's view misapprehends the operator's constant, simultaneous engagement with both roles._

So much this. I coach and train my clients (Fortune 500) in extreme programming (unit testing, TDD, CI, CD, etc). The duality these developers live with and managements obliviousness to their own detriment create a toxic and anxiety inducing work environment. It's very upsetting to me how these developers live with the manager/stakeholder constantly breathing down their necks to cut corners and "get it done" meanwhile holding them accountable for any mistakes.

<comment><USER4> jdjebc82747's dead comment: >"get it done" meanwhile holding them accountable for any mistakes. Sorry, is there an area of business that is not like this?

It's not that other areas of business _aren 't_ like this, it's that management creates an environment where mistakes are more likely (and in some cases almost certain) to happen, and then penalizes people when they happen.

An example: Bosses refuse to provide funding for materials and time to automate the test framework (embedded systems). So testing is done mostly manually, this consumes a great deal of time _or_ tests don't get conducted due to the lack of time or capability (I can't flip a switch 10 times in a second, or at a particular and precise time). So either we don't have enough time to take the test feedback and correct the system, or we never get the test feedback (because some tests aren't done) in order to correct the system. Errors are virtually guaranteed to slip into production if you're operating on either short schedules or complex systems under these circumstances.

Management expects perfect results, but ties the engineers hands too much so that they aren't able to execute effectively, and then blames (and often dismisses) the engineers as a result.

</comment></comment><comment><USER5> This all looks spot on from my experience, except I have this nagging voice in my head that says the methods they are criticizing, seem to be exactly what the airline industry has done for decades in the wake of plane accidents. The result has been an ever-improving safety record, without preventing normal operation; although it is a pain to get through security at the airport, people do in fact continue to get from here to there. So, how do the methods they criticize here, differ from the airline industry's, or if they don't what's the flaw in this analysis?

<comment><USER6> I know nothing of the industry, so everything that follows is guesswork.

I'd say airlines are a sweet spot because we are probably near a technological local-optimum. We are not constantly evolving new paradigms for the industry, rather just incrementally improving the old one.

If post-mortem culture in the industry results in "fighting the last war", then that probably does little harm, at worst it adds in incremental cost. In the mean-time there is still incremental techonolgical improvment giving us more head-room in the cost vs. safety trade-off.

<comment><USER5> Well this makes some sense, since the speed of sound pretty much stopped technological progress toward every-higher speeds a few decades past.

<comment><USER7> Really?

The ancient ones, the humans who lived before my birth - those who launched rockets to the moon and detonated city destroying bombs with atomic power, feats no country has matched in these declining years of civilisation - <USER2> also had faster than sound passenger aircraft.

Although it might be the tendency to exaggerate stories with time, rose-tinted glasses and the myth of the noble-savage.

<comment><USER8> There's a common theme amongst many of those heroic feats: They tended to occasionally catch fire, fall out of the sky and/or explode at inopportune times.

It's the difference between prototype and a production. The Saturn V rocket and the Concorde were both prototype-grade vehicles. The marvel of them is that they worked at all. Now that we've proved the point, we won't put either "into production" unless it's reliable enough to be boring.

<comment><USER7> 'Production quality' things spontaneously catch fire these days, too.

[http://www.theclever.com/20-dangerous-cars-with-the- highest-...](http://www.theclever.com/20-dangerous-cars-with-the-highest-risk- of-spontaneous-combustion/)

</comment></comment></comment></comment></comment></comment><comment><USER9> This episode is the most relevant, but see the whole series:

[https://www.youtube.com/watch?v=3HaqpSPVhW8](https://www.youtube.com/watch?v=3HaqpSPVhW8)

</comment><comment><USER10> TL;DR Spend 80% on expensive consultants qualified in "project management method" such as PRINCE2/V-Model and make a f __ __*g nightmare for the people who actually try to make it work.

A picture is worth a thousand words:

[https://upload.wikimedia.org/wikipedia/commons/8/8f/Systems_...](https://upload.wikimedia.org/wikipedia/commons/8/8f/Systems_Engineering_and_Verification.jpg)

<comment><USER11> It seems you've been hurt recently by a consultant :).

The institutional response to managing the risk of complex systems is often to introduce layers of approval and process that appear to be dealing with a problem ("this system can't fail, therefore please check with everyone involved in the system before making a change") but really have little real world value except driving everyone crazy and incurring enormous cost. They also shield individuals from real responsibility (how carefully do you review something you are the only approver on? What if there are 5 approves? What about 15?).

A better answer is to find ways to conduct real world tests with subsets of your system where you can roll back bad consequences. As far as I can tell This is the approach of google/Facebook and other newer tech companies with pushing small changes to subsets of customers for testing.

Legacy enterprise companies are woefully inequipped to do this for the most part, both technically and culturally.

Some industries have regulations that make this approach difficult (financial services) or human consequences to failure that make the cost of experimentation too high (medicine, airlines, etc)

</comment></comment><comment><USER12> If this is interesting to you, I highly recommend "The Field Guide to Understanding Human Error" by Sidney Dekker - it covers these points with examples. [0]

Another note, I wondered what the root cause of the financial meltdown was for a number of years, but looking at it from this point of view, it's obvious that a number of things have to go wrong simultaneously; but it is not obvious beforehand which failed elements, broken processes, and bypassed limits lead to catastrophe.

For your own business/life, think about things that you live with that you know are not in a good place. Add one more problem and who knows what gives.

This is not intended to scare or depress, but maybe have some compassion when you hear about someone else's failure.

0 [https://www.amazon.com/Field-Guide-Understanding-Human- Error...](https://www.amazon.com/Field-Guide-Understanding-Human- Error/dp/1472439058)

</comment><comment><USER13> Previous relevant discussion on similar papers :

[https://news.ycombinator.com/item?id=8282923](https://news.ycombinator.com/item?id=8282923)

[https://news.ycombinator.com/item?id=14127543](https://news.ycombinator.com/item?id=14127543)

</comment><comment><USER14> Here it is directly from MIT instead of the cancerous researchgate silo: [http://web.mit.edu/afs.new/athena/course/2/2.75/resources/ra...](http://web.mit.edu/afs.new/athena/course/2/2.75/resources/random/How%20Complex%20Systems%20Fail.pdf) (the 1998 version to be fair but the sole addition seems to be some infographic of the contents)

<comment><USER15> Thanks, we've updated the link from [https://www.researchgate.net/publication/228797158_How_compl...](https://www.researchgate.net/publication/228797158_How_complex_systems_fail).</comment></comment>


Offensive tech headlines: "Barely Legal", "Score That Whore" etc. - <AUTHOR> http://www.kernelmag.com/ In my humble opinion, the douche-dial on this site goes all the way to 11.  The combination of risque imagery and sexual innuendo crosses the line from 'spicy headline' to 'totally inappropriate'.
http://www.kernelmag.com/comment/opinion/3551/barely-legal/
http://www.kernelmag.com/features/report/3428/score-that-whore/
http://www.kernelmag.com/scene/3544/so-hard-right-now/ <comment><AUTHOR> In my humble opinion, the douche-dial on this site goes all the way to 11. The combination of risque imagery and sexual innuendo crosses the line from 'spicy headline' to 'totally inappropriate'.

<http://www.kernelmag.com/comment/opinion/3551/barely-legal/>

[http://www.kernelmag.com/features/report/3428/score-that- who...](http://www.kernelmag.com/features/report/3428/score-that-whore/)

<http://www.kernelmag.com/scene/3544/so-hard-right-now/>

</comment><comment><USER2> Are you really complaining that you found something offensive on the internet?</comment>


Ask HN: Does Apple Repair Butterfly Keyboards for Free? - <AUTHOR> Asking because my warranty expired 2 years ago, but over the last couple of months, I have had several buttons give up on me. And it's getting to the point where I feel like the keyboard is becoming unusable.
Has anyone got experience with repairing their butterfly keyboard out of warranty? Did you have to pay for a replacement?
Apple Live Chat was very defensive about this and didn't want to give me a clear answer. <comment><USER2> They _should_ do as the fault occurs as a result of a manufacturing problem rather than the result of usual wear and tear.</comment>


Show HN: 8 Tiers of English Football Mapped - <AUTHOR> https://hometown.football/fulham-fc <comment><USER2> It would be interesting to see this expanded to other footballing nations where even second division teams aren't available in FIFA 16. Curious about the technology stack.</comment>


Makefile hacks: print the value of any variable (2010) - <AUTHOR> https://blog.melski.net/2010/11/30/makefile-hacks-print-the-value-of-any-variable/ <comment><USER2> Eric (who wrote TFA) and I worked together at Electric Cloud on GNU make stuff. He took over from me writing a column called "Ask Mr. Make".

The columns I wrote are all available here: [http://blog.jgc.org/2013/02/updated-list-of-my-gnu-make- arti...](http://blog.jgc.org/2013/02/updated-list-of-my-gnu-make- articles.html)

Or, if you like, there's a book version: [https://www.nostarch.com/gnumake](https://www.nostarch.com/gnumake)

<comment><USER3> I started with your first article which begins with "There aren't any debuggers for Make" Actually Rocky's remake existed in June 2004 already. Bad, very bad...

        commit 60f9a6ab18f12802c79a977d1b6b65b106355c10
        Author: R. Bernstein <firstname.lastname@example.com>
        Date:   Sun Apr 4 01:38:36 2004 +0000

        Initial revision

<comment><USER2> Hmm. "Bad, very bad..." seems like an exaggeration. I wrote that article in June 2004. Although the initial commit for remake (which I covered in 2007) was in April 2004 the initial release was... at the same time as my article.

My article was published on June 27, 2004: [https://web- beta.archive.org/web/20080202093023/http://www.c...](https://web- beta.archive.org/web/20080202093023/http://www.cmcrossroads.com/articles/ask- mr.-make/printing-the-value-of-a-makefile-variable.html)

remake preparing for first release on June 12, 2004: [https://github.com/rocky/remake/commit/f9ad86874dae33ea89485...](https://github.com/rocky/remake/commit/f9ad86874dae33ea894853f48e87aeae6743bd1b)

</comment></comment></comment><comment><USER4> OT but make (GNU make specifically) is an amazing piece of software.

It seems every build tool since then has intentionally disregarded the file- based dependency graph that is the elegance of make. Crazy.

(There are modern Blaze-clones which continue the spirit, but with a steeper learning-curve.)

<comment><USER5> Make has some serious shortcomings though. Some that I can think of: it relies on timestamps instead of content hashes, it doesn't rebuild things when e.g. compiler flags change, its approach to header dependencies in C/C++ is clumsy, it needs to parse the Makefile each time (which for large projects takes non- negligible time), it doesn't have an integration with inotify (which means it needs to stat() every file to check its timestamp).

<comment><USER6> > it relies on timestamps instead of content hashes

If it relied upon content hashes, then make would have to hash the files each time it ran (taking time---checking the timestamp is faster). For a large project, this might be too excessive.

> it doesn't rebuild things when e.g. compiler flags change

Just make the Makefile a dependency on each target. That problem solved.

> it needs to parse the Makefile each time

Um ... of course. The only way around this is for make to compile into some easier format to read or some database type thing (perhaps a .makefile?) and it would need to track changes to Makefile to update the database type thing (well, make does dependency tracking so that shouldn't be too hard).

Just a question---do you have a project where reading the Makefile takes a non-negligible time?

> it doesn't have an integration with inotify

inotify is a) Linux only (make, and specifically GNU Make, runs on nearly everything) and b) it's an API, not a service that can be queried. Doing this implies that make will have to always be running checking all files for a project. Which project? All projects that have a makefile on my system? After a certain number of files being tracked, I'm certain that checking "inotify" (a daemon perhaps?) is the same as checking "stat()" for file metadata.

<comment><USER4> These are solvable approaches, though it's easy to see why make did what it did.

> hash the files each time it ran

Bazel & co relies on file hashes, but only checks then when the timestamp changes.

Downside: now you have to keep hashes as metadata somewhere.

> it needs to parse the Makefile each time

Many build tools run a long running process either in the foreground (SBT, new Maven) or in the background (Gradle).

Downside: Now you have to run a long running process...

> it doesn't have an integration with inotify

It could.

Downside: Not universal, uses memory, more complex.

</comment></comment></comment></comment><comment><USER7> Does this count as a make hack? I have (or had, can't seem to find it right now) a script to generate a makefile from a list of URLs of files to be downloaded. In this case, it was for when I needed to download hundreds or thousands of files. The makefile just called curl to do the downloading. But the beauty of using make was that I could easily control the download concurrency with -j, and of course that it would skip already downloaded files. I think I may have even made it properly resume partial downloads by checking for the temporary target file and using its size to send the right range request.

Anyway, it's been a few years, but I thought it was pretty clever at the time.

<comment><USER8> Yeah, I think it counts, though make was designed for general purpose jobs and not just compilation, so it gets a lot of credit for being a solid and general tool. Being able to resume jobs is awesome, and free concurrency is too. I've done the same thing and used make for batch downloads and batch image resizing and batch frame rendering, etc. etc. I did it enough times that I generalized my makefile so I could easily schedule resumeable parallel command line batches. I called it "mbatch" and was getting ready to publish it... but then I discovered gnu parallel. :P

</comment></comment><comment><USER9> Most folks don't use it as such, but make is a logic programming language, ala Prolog. It can use a long chain of translations without you telling it the sequence. For example, I could #include "foo.pdu.der.h" in a C file, and make figured out that it needed to find foo.pdu.xer, translate it from XER to DER as a "pdu" PDU, then hexlify it as an char array into foo.pdu.der.h.

It is a very flexible tool if you can get past the syntax (and always use --warn-undefined-variables).

</comment><comment><USER10> I had a similar need except I didn't which variable I was looking for. I think I found this on stack overflow:

        .PHONY: variables
        variables :
            $(foreach v, $(.VARIABLES), $(info $(v) = $($(v))))
            @echo

which prints all variables and their respective values.

</comment><comment><USER11> Here's a similar "hack", but it is not limited to gnu make:

      printvar:
              @echo $(VAR)

You can execute it like this:

      make printvar VAR='$(PWD)'</comment>


Jimmy John's Confirms Breach at 216 Stores - <AUTHOR> http://krebsonsecurity.com/2014/09/jimmy-johns-confirms-breach-at-216-stores/

<comment><AUTHOR> List of stores: [https://www.jimmyjohns.com/datasecurityincident/storedates.h...](https://www.jimmyjohns.com/datasecurityincident/storedates.html)</comment>


Building CockroachDB on top of RocksDB - <AUTHOR> https://www.cockroachlabs.com/blog/cockroachdb-on-rocksd/ <comment><USER2> Our in-house DB at Stream also runs on top of RocksDB + Raft. Its amazing just how much faster it is than anything else out there (especially compared to cassandra). Instagram uses rocksdb as storage for Cassandra, Linkedin and pinterest use rocksdb. As soon as you have the time to build your own db using rocksdb you get really finegrained control over performance.

[https://stackshare.io/stream/stream-and-go-news-feeds-for- ov...](https://stackshare.io/stream/stream-and-go-news-feeds-for- over-300-million-end-users)

<comment><USER3> Rocksdb is pretty good and we relied heavily on it at QuasarDB as well. Having said that, we are nowadays deploying more and more production setups with Levyx' Helium, which scales better and directly integrates with the hardware.

<comment><USER4> Given that Helium appears to be proprietary, what kind of perf benefit are we talking about here?

<comment><USER5> I haven't used Helium specifically, but 3-5x greater throughput would be completely believable in my experience. It is an open secret that high- performance closed source storage engines can have several times the throughput of their open source equivalents on the same hardware. High-end storage engines often have sufficient throughput to consistently saturate NVMe arrays for diverse workloads, which is not something you commonly see in open source. Consequently, it is common to see closed source storage engines for people doing high-scale sensor analytics work and similar.

The source of this performance gap is architectural. The current design of RocksDB precludes it ever being legitimately high-performance in most contexts, and most other open source storage engines use a similar design. Modern high-performance storage engines also use a common architecture implemented in minor variations, you just don't see this architecture in open source much. I realize that few software engineers have the skillset and experience required to design a top-notch storage engine, but I am still surprised by the dearth of open source examples given the large value in closing this gap.

I rarely use open source storage engines in the systems I build for this reason. The CapEx/OpEx implications of using them is far too costly at scale. Fortunately, I have the approximately free option of using my own storage engine implementations.

<comment><USER6> This technique is just more IO parallelism at the physical layer due to higher concurrency while submitting IO, correct? Since NVMe and new SSDs don't hit peak throughput until very high queue depths this doesn't surprise me.

<comment><USER5> I/O parallelism is necessary but far from sufficient. My own designs arbitrarily allow 64 reads and 64 writes to be in-flight concurrently per core. There is no science behind that limit beyond the fact it has worked brilliantly for many years across every type of storage. But I/O parallelism won't fix terrible scheduling.

A fast storage engine needs to eliminate most of the elements that will stall an execution pipeline. This means doing things like almost completely eliminating shared data structures and context switching. It also means designing your own execution and I/O scheduler to greatly reduce the various forms of stalling on memory ubiquitous in many designs. It is difficult to overstate the extent to which thoughtful schedule design can greatly improve throughput.

A state-of-the-art storage engine can drive 2+ GB/s _per core_ , and schedule things to keep the storage hardware performance close to theoretical while smoothing out transients. It is very easy to run out of storage bandwidth in my experience.

<comment><USER7> I'd love to learn more. I'm in need of a fast engine.

What proprietary engines do you know of that I can look at?

Do you have more details on your own designs? Anything you can share?

<comment><USER8> See scylladb. They're doing most of the grandparent is talking about (per-core sharding, async everything, disk/io/network scheduler, dpdk, custom filesystem etc).

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER9> RocksDB is a fork of LevelDB, which was [in]famous for its ease of corrupting data. Did Facebook ever do anything to ensure data wouldn't corrupt, or is that still a common thing operationally? (You find it more at larger scales)

Here's an example of how data corruption can suck, with (example) Riak and LevelDB. The leveldb data would corrupt often, which would leave you in a predicament. Say you had 10 nodes with a 3 node replication factor, and the whole cluster is humming away at a decent clip. Now one node's leveldb corrupts, and you have to rebuild it. If you have a huge fuckoff dataset, this can take a while. Now another node goes down. Now only 1 node has the data you need, and 2 nodes are down - so now 8 nodes are doing the work of 10, and if you have any more failures, your data might be gone. Now add replication, which will suck performance and bandwidth away from the regular work. And because it would corrupt so easily & often, there needed to be hash trees to quickly identify what data was corrupt, and then you needed to fix it and rebuild your hash trees. This would also suck away performance. Finally, you can't just add new nodes while rebuilding, because the extra load makes the cluster fall over. And the more nodes, the higher the likelihood of failures.

<comment><USER10> I never experienced this with several in production Riak clusters running for years. Can you explain how to reproduce or give a link to any public forum where this was discussed?

<comment><USER9> Sure. Build about 10 classes of clusters of varying sizes, each with a dataset ranging from 100GB to a petabyte or more. Run them on shitty oversubscribed openstack clusters with a combination of ephemeral, Ceph, and SAN disks. Do replication to similar-ish clusters in different regions. Handle data for about 100 different applications that process so much data at such low latency that cloud-based databases aren't even an option. Keep adding nodes and storage to existing clusters over time.

It turns out that really unstable hardware/networks like to expose bugs. It also wasn't discussed in public forums. We paid for support and even employed Riak developers, and still we hobbled on putting out fires. I'll bet other DBs go through the same crap and keep it quiet.

Also, read the Riak documentation and you'll find the corruption recovery documentation among other hints at common failures and limitations.

<comment><USER10> Thanks for confirming it wasnt a Riak issue. SAN disk really? As an architect i can tell you that SANs are almost always are antipattern for building reliable and scalable distributed systems.

<comment><USER9> I didn't know I was being interrogated about Riak failure modes. Ok, here's more verbiage on Riak failures.

First off, SAN was one of three different disk storage solutions. When you work for <BIG CORP>, the lowly product teams don't always get to pick and choose what infrastructure is available. They have to do the best they can with what they have, when they don't get what they ask for. If <BIG CORP> says to use a shitty openstack cluster, that's what you have to deal with, and you have to beg for all the ephemeral SSDs you can get. (Which then becomes a huge pain in the ass when you need to scale storage and your choice is (A) buy more machines and migrate nodes so you can upgrade ephemeral on the old machines or (B) start swapping disks in running hypervisors and cry yourself to sleep, or (C) use SAS or other array/volume on a SAN)

And thanks for blithely ignoring what I'm saying. Riak did have corruption bugs that should have been preventable - as I said, a major source of the problems _was LevelDB_ , and _Riak 's own documentation shows this to be true_.

You could look sideways at these things and the db would corrupt. A node with ephemeral storage, with no detectable errors on it whatsoever, would suddenly stop working. We would go look at it, and it had a single leveldb file corrupt... and nothing else wrong with it at all. Not only would it corrupt, it wouldn't make any attempt to fix itself, even though there was a documented fix.

Riak has anti-entropy intended to detect missing data and fix it, but it's the erlang equivalent of cron jobs and hash trees. The whole thing is designed to just go "dum de dum, I wonder if anything's broken after $INTERVAL?" and then perform some operation, which if the cluster is under load, may kick it over. So they added throttling (throttling is everywhere in Riak, as instead of simply rejecting operations because it's unsafe, they'd rather make everything go r e a l l y s l o w).

There was very little intelligence or event-driven programming for failure detection and remediation. When the db corrupted in a way that wasn't handled by anti-entropy, the node would just die, and we had to manually intervene (later by writing automation to intervene) rather than it, you know, just doing its own automation to fix the corruption. The AAE trees rebuild every $INTERVAL and there's no way to change when or how they rebuild other than to change the $INTERVAL, so there's no way to, for example, force them to rebuild when it is convenient based on lulls in application use.

Then there's Riak search, which has the nice habit of taking down your cluster due to god knows what (memory bloating, cpu starvation, unknown bugs in error logs, etc). Don't use Riak search.

Replication was also a joke. Any network interruption ( _hello, distributed apps have network interuptions_ ) would kill replication. We would have to detect replication had failed and queues were filling up, and re-start the replication until queues fell. But sometimes replication couldn't resume, because there were 1 of 1,000 different potential failure modes happening with 1 node in a remote cluster somewhere. So we had to resolve that node's issue and get the whole remote cluster healed before the replication queues filled up. If we didn't do that, we'd have to do a full-transfer to prevent potential data loss, which would take _days_.

We developed auto-healing scripts to deal with most of these situations, and the controls Riak added to slow down processing so it didn't kill the cluster from all the competing operations it was trying to do at once (kv processing, replication, hash regeneration, etc) were not enough for our automation to be able to efficiently control the nodes when they were unhealthy. Riak would just occasionally perform incredibly poor, or nodes would die randomly, and we'd get some unknown errors we couldn't diagnose. All our monitoring and investigation showed nothing wrong with the host - no resource starvation, no error messages, no spikes of client traffic. Riak was just having a bad day, and us being a very small team of not-erlang-programmers, had to just restart shit until it got better, and research fixes once things improved. Our postmortem incident queue was rather large.

This is a small sampling of production Riak issues. I'm not going to dig into my brain for every bug they have, but suffice to say that a distributed database should be able to recover from a single file corruption, and should be able to resist it from ever happening through various techniques that are 20+ years old. Their code is just lame, and proof that just because you write something in Erlang doesn't mean it's going to be stable. And in Riak's defense, the reason _why_ their code was lame was because they were a small company trying to juggle a lot of demanding engineering issues from different customers, and they didn't have much money or time. But lame code is still lame code.

</comment></comment></comment></comment></comment><comment><USER11> I noticed that RocksDB is used very often in OLTP scenarios. What's the OLAP equivalent of RocksDB in OLTP world? Apache Parquet? Apache Arrow? What would you use these days to create a high performance OLAP/OLHybridP engine ?

<comment><USER6> For analytics workloads, your best bet is using compression techniques that let you do operations on the data without decompressing it. A good example is dictionary encoding a set of sorted string keys so you can preform prefix queries by doing a greater than and less than comparison on the integers instead of examining every string entirely.

Once you've encoded the data into large enough blocks, you could use any storage engine and write the encoded blocks into it along with metadata for managing which blocks are a part of what tables and partitions of tables.

You can also just use something like Parquet or ORC, but that's not going to get you the best performance possible.

<comment><USER11> I know there are many techniques that used together give good performance (optimal memory layout, compression, vectorization, etc. etc.), however I'd like to use a package that does a lot of it, same what RocksDB (or SQLite) does for OLTP cases. Is there something like that? If not, what's out there that gives the best foundation for building OLAP functionalities on top of it?

<comment><USER12> Check out Druid [1], an open-source analytical database with tightly-coupled storage and processing engines designed for OLAP. In particular it implements a memory-mappable storage format, indexes, compression, late tuple materialization, and query engines that can operate directly on compressed data. There is a patch out to add vectorized processing as well, so you should expect to see that show up in a future release.

Its storage format and processing engine aren't designed to be embedded in the same way as RocksDB and SQLite are, but you certainly could if you wanted to, since the code is fairly modular. Or you could use it as a standalone service as it was designed to be used.

[1] [http://druid.io/](http://druid.io/)

<comment><USER13> There's also Clickhouse [1] which seems to scale much better than Druid, and has similar architectural decisions to make it somewhat general as a columnar store for OLAP uses. Cloudflare wrote an article in the past where they compared Clickhouse and Druid and they chose Clickhouse because they could get similar performance on the same workload with 9 nodes in Clickhouse which would require hundreds for Druid. They built all of the DNS analytics at CloudFlare on Clickhouse [2].

Disclosure: I work at Percona, and we've seen a lot of our customers make use of Clickhouse and have begun some of our own services work around it in Consulting. It's now a primary database talked about at our conferences, and we post about it regularly. [3]

[1]: [https://clickhouse.yandex/](https://clickhouse.yandex/) [2]: [https://blog.cloudflare.com/how-cloudflare- analyzes-1m-dns-q...](https://blog.cloudflare.com/how-cloudflare- analyzes-1m-dns-queries-per-second/) [3]: [https://www.percona.com/blog/2018/10/01/clickhouse-two- years...](https://www.percona.com/blog/2018/10/01/clickhouse-two-years/)

<comment><USER14> There is a very good article[1] by one of the Druid committers about Clickhouse/Drui/Pinot that goes into some details on why the Cloudflare tests turned out the way they did.

[1]:[https://medium.com/@leventov/comparison-of-the-open- source-o...](https://medium.com/@leventov/comparison-of-the-open-source-olap- systems-for-big-data-clickhouse-druid-and-pinot-8e042a5ed1c7)

<comment><USER15> That article is better than expected, and it matches my own experience with CH (it was a great match for our use-case, and some of those reasons are in the article; and also, we could have used an inverted index, would one have been available; surprisingly survived w/o it).

</comment></comment></comment></comment></comment></comment></comment><comment><USER16> Excellent article, very informative.

I just had to chuckle at this:

> Non-engineers: in a computer, a move is always implemented as a copy > followed by a delete

Yeah, that's really gonna help a non-developer understand the article better...

<comment><USER17> It's confusing altogether. For example, that's not how /bin/mv (usually) works.

<comment><USER18> Usually, that's because /bin/mv is just changing a link to the file, not moving the file itself. In cases where it's actually moving the file -- say across a file system boundary -- it does copy the file and then delete the old version.

<comment><USER16> I reckon it was meant in the context of compaction.

</comment></comment></comment></comment><comment><USER19> When a SQL implementation is built on a KV storage engine, how do tables, rows, and columns typically map to the underlying KV data model?

<comment><USER6> The CockroachDB blog post on this topic is a good summary. There is an additional trick that isn't directly KV related, but is important in a distributed environment when using a KV storage engine.

When defining a hierarchy of tables, such as customers -> orders -> order_line_items, you can make the primary key of the child tables contain the primary key of the parent table.

e.g. (customer_id) for the customers table, (customer_id, order_id) for the orders table, then (customer_id, order_id, line_item_id) for the order_line_items.

When this is stored on disk in a sorted format, it makes joins between these extremely cheap because the data will all be next to each other on disk.

CockroachDB calls this "interleaved tables".

<comment><USER20> Interleaved tables are best for 1:1 relationships.

<comment><USER6> Hard disagree. This is the only way in a distributed, sorted KV store to get any semblance of data locality. If Cockroach and Spanner didn't do this, they would constantly be doing 2PC for modifying data that is related but stored on different groups of machines.

<comment><USER20> We are evaluating it for production and the senior engineer we talked to from the company told us that. I'd think he knows what he's talking about.

<comment><USER6> I may be misinterpreting what you mean by a 1-1 relationship, but the documentation for Cloud Spanner, Cockroach, and the old FoundationDB SQL layer all use a similar schema to the one I described in their examples. Additionally, the F1 paper describes using it in the same way in Figure 2.

<comment><USER20> He said tables with a parent child relationship that is one to one meaning if I understand that right one parent ID mapping to one child ID. Its entirely possible either I'm misinterpreting him or he's wrong but that's what he said.

<comment><USER21> I think the data locality benefits would hold for one to many relationships too (that is, one parent with many children).

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER22> > If you surveyed most NewSQL databases today, most of them are built on top > of an LSM, namely, RocksDB.

Is this actually true?

spark, foundationdb, memsql, nuodb , citus . I am not sure any of these are built on top of rocksdb.

Which ones are actually built on lsm?

<comment><USER23> None of those are newsql other than MemSQL, which is an OLAP system that uses a custom rowstore format and parquet for columnstores.

In addition to CockroachDB there's also TiDB which runs on top of TiKV which uses RocksDB.

<comment><USER22> > None of those are newsql other than MemSQL

Why aren't citus, nuodb 'newsql'?

> there's also TiDB

One more example doesn't qualify the statement "most are built on rocksdb". I wasn't saying there is only one newsql db built on rocksdb.

Of the 14 examples listed here [https://en.wikipedia.org/wiki/NewSQL](https://en.wikipedia.org/wiki/NewSQL)

only 2 that you mentioned seem to be built on rocksdb.

<comment><USER23> I'm not disagreeing, RocksDB is not used by most. The statement in the blog post is not true.

</comment></comment></comment></comment><comment><USER24> If someone love LevelDB/RocksDB but want to use a pure-Go implementation, I have good thing about this library:

[https://github.com/syndtr/goleveldb](https://github.com/syndtr/goleveldb)

</comment><comment><USER8> Seems like few features: 1\. sstables as different files 2\. range delete (which is rare)

compared to LMDB (which is faster & more efficient): [https://symas.com/lmdb/technical/](https://symas.com/lmdb/technical/)

Still would be nice to see how LMDB would fare in a complex distributed DBMS (most of them are in rocksdb-type libraries).

But LMDB is supposed to stay small. So more features are in a fork: [https://github.com/leo-yuriev/libmdbx](https://github.com/leo-yuriev/libmdbx)

<comment><USER25> LMDB is already used in distributed DBs - such as LDAP. OpenLDAP performance is orders of magnitude greater than any RDBMS or other distributed DB.</comment></comment>


Functional Programming Doesn't Work (2009) - <AUTHOR> http://prog21.dadgum.com/54.html <comment><USER2> Flagged for bait-y title. This is one of those articles that contradicts its title in the first few sentences.

Better titles: "Purely functional programming doesn't work" or "sometimes functional programming doesn't work, but I'm still a functional programming advocate".</comment>


Read the Trump administration's draft of the executive order on cybersecurity - <AUTHOR> https://apps.washingtonpost.com/g/documents/world/read-the-trump-administrations-draft-of-the-executive-order-on-cybersecurity/2306/ <comment><USER2> FWIW, here are 3 executive orders related to cybersecurity that President Obama signed:

[https://obamawhitehouse.archives.gov/the-press- office/2013/0...](https://obamawhitehouse.archives.gov/the-press- office/2013/02/12/executive-order-improving-critical-infrastructure- cybersecurity)

[https://obamawhitehouse.archives.gov/the-press- office/2015/0...](https://obamawhitehouse.archives.gov/the-press- office/2015/02/13/executive-order-promoting-private-sector-cybersecurity- information-shari)

[https://obamawhitehouse.archives.gov/the-press- office/2016/0...](https://obamawhitehouse.archives.gov/the-press- office/2016/02/09/executive-order-commission-enhancing-national-cybersecurity)

</comment><comment><USER3> Not much interesting in there it seems. TL;DR: Let's all review everything and decide on ways to improve things.

<comment><USER4> >A review ... of the DoD, DHS, and NSA shall identify and initial set of capabilities needing improvement to adequately protect U.S. critical infrastructure.

This could potentially mean allowing NSA expanded capabilities. Not necessarily, though, I guess.

<comment><USER5> I don't think it goes either way. An argument could be made that the review ends up saying "Everything the NSA does is irrelevant, shut it down and give the money back to the shareholders".

Obviously I don't think that is actually going to happen either, but, nor do I think this means the NSA would be expanded here.

</comment></comment></comment><comment><USER6> So far nothing controversial. Let's hope he gets one thing right. Even a broken clock is right twice a day.

<comment><USER7> A stopped clock is right twice a day. A clock that mistimes a second will be right far less often, and a mis-set clock is never right. Likewise a Widlarized clock is never right, and that's as broken as you can get.

/pedantry

</comment></comment><comment><USER8> Is he demanding a review of government systems or of private systems as well? Like is the homeland security going to bring an army of security experts and start banging on Google's doors demanding access to their servers to see if they are above board?

<comment><USER9> " 3\. Denitions. As used in this order:

The term ?critical infrastructure? means systems and assets, whether physical or virtual, so vital to the United States that the incapacity or destruction of such systems would have a debilitating impact on security, national economic security, national public health or safety, or any combination of those matters.

The term national security system means any telecommunications or information system Operated by the Federal Government or any contractor on its behalf, the function, operation, or use of which?

involves intelligence activities;"

So it seems to not imply private systems.

<comment><USER10> The destruction of Google's, Apple's or Amazon's systems would obviously "have a debilitating impact on national economic security". All of them are also contractors of the Federal Government.

</comment></comment></comment><comment><USER11> I think it'd be good for everyone to read these executive orders, rather than jumping to conclusions and acting hysterically.

</comment><comment><USER12> That's one heck of a wordy security audit request.

</comment><comment><USER10> Some thoughts, sorry for the long quotes. Start with the second-to-last quote for what I personally find to be the most worrying.

        As a result of these changes, cyberSpace has emerged
        as a new domain of engagement, comparable in
        signi?cance to land, sea, air, and space, and its
        signi?cance will increase in the years ahead.

This raises the possibility of hacking being treated as an act of war, and the resulting actions. I'm not sure if that's the current status quo – I know there was discussion about it a few months ago.

        The term ?critical infrastructure? means
        systems and assets, whether physical or virtual,
        so vital to the United States that the incapacity
        or destruction of such systems would have a
        debilitating impact on security, national economic
        security, national public health or safety, or
        any combination of those matters.

This does notably seem to exclude anything related to elections.

        The term ?national security system? means any
        telecommunications or information system
        Operated by the Federal Government or any contractor
        on its behalf, the function, operation, or use of which:
             [...]
        is critical to the direct fulfillment of military or intelligence
        missions (but does not include a system used for routine
        administrative and business applications, including payroll, finance,
        logistics, and personnel management applications).

This seems to go out of its way to exclude "personnel management applications", which is curious considering exactly such a system was at center of the second-largest hacking scandal involving the government last year.

        Review Participants. The Secretary of Defense
        shall co?chair the Vulnerabilities Review with
        the Secretary of Homeland Security, the Director of
        National Intelligence, the Assistant to the
        President for National Security Affairs, and the
        Assistant to the President for Homeland Security
        and Counterterrorism.

The last three are Dan Coats, Michael Flynn, and Tom Bossert, respectively. It's a bit heavy on the military brass and leans towards the political side to the exclusion of anybody with technical credentials (I'd think someone from the NSA or even the private sector could possibly be useful). But I've always been critical when, for example, judges have been accused to be inadequate to adjudicate technical issue – smart people can and will get the information they need to make right decisions. So let's give them the benefit of the doubt.

Possibly relevant: it's two cabinet members vs three people reporting directly to the president. I don't know if these committees ever vote on anything, but that could be intentional to allow the President to keep full control over the direction of the investigation (Cabinet Secretaries being traditionally more independent than anyone in the West Wing)

        [..]the Secretary of Defense and Secretary
        of Homeland Security shall
        also gather and review information from the
        Department of Education regarding computer
        science, mathematics, and cyber security
        education from primary through higher education
        to understand the ?ll] scope of US. efforts to
        educate and train the workforce of the future. Th
        Secretary of Defense shall make recommendations
        as he sees ?t in order to best position the US.
        educational system to maintain its competitive
        advantage into the future.

I feel a bit uneasy about Secretary of Defense being authorized to change the primary school curriculum, especially considering the basically limitless scope of "maintain[ing] its competitive advantage into the future". It sounds like they want more math in school. But what if he concludes that the US has plenty of hackers, but they're just not patriotic enough and rather work for Apple (which is actually somewhat true)?

        [A review shall find ways to incentivice
        private enterprises to] invest in cyber
        enterprise risk management tools and services; and
        adopt best practices with respect to processes and
        technologies necessary for the increased
        sharing of and response to real-time
        cyber threat information.

This is once again pretty broad, but I thought it warrants inclusion because any sharing of data collected by private entities with government agencies has the potential to violate individuals' privacy.

Overall this isn't really specific enough to scare me, yet. The bit about education is what most effectively raises my blood pressure, while the focus on military systems at the exclusion of anything election-related is somewhat curious.

</comment><comment> guest-speaker-4 The part about Department of Education ensuring a competent workfore doesn't jive with haphazardly turning back permanent residents with PhDs and valid green card from reentering the country where they live. The US was made great when refugees from around the world were welcomed and then prospered for both themselves and the melting pot country. The rush to enact these sort of ignorant, brutal, arbitrary and uncivilized policy blunders further errode national security, the economy and international standing... also, the shitshow of a constitutional crisis is brewing where the various parts of government ignore the law and do whatever they want.

<comment><USER13> Except for Iran, most of the other countries didn't contribute to a large part of the US "intelligentsia" [people with advanced technical degrees]

Any deficit could be compensated by increasing quotas for people from alternate countries, India, Russia, China all which produce great numbers of people in technical fields and who don't always get choice work in their home countries.

<comment> guest-speaker-4 You missed the point entirely. Leaving out Irish, Italians, Syrias or the Jews (Godwin's Law exception) because of nativist hate toward disparaged peoples was/is shooting oneself in the foot... other, wiser countries will gain by taking in more people (either to bolster their fertility rates, tax bases and/or future world standing) because it's hard to select the good ones in an haphazard, politically-driven immigration process whose children, grandchildren, etc. have the greatest probability of being the next billionaire job creator, small business owner or at least high income-earning taxpayers.

<comment><USER14> Additionally people from other countries will see that and might decide not to come to the US. There's now a lot of opportunities for well educated people other than the US and the actions of Trump make the US seem like a risky choice.

</comment></comment></comment></comment><comment><USER15> The real joke is that all this information is already out there. Infrastructure has already been evaluated. The the enemy is well understood. But you do have to read the reports. You have to trust those writing the reports. You have to not yell them out of the room when they say something that offends your reality. This order is a call for new reports written by new people with the skills necessary to explain cybersecurity to large children.

"China bad. Big internet computer need antivirus."

<comment><USER16> The danger is that this is exactly what's happening, without the churlish conclusion.

This is a call for reports to be rewritten by staff sympathetic to the current president's cause. That's the first step to "securing our cyber borders" via VPNs, proxies, vetting of internet companies, etc.

<comment><USER15> I'm very serious about the language. When presenting to people like trump you must change your language. Take "VPN". I would never use that term in front of someone like trump. Never use an acronym that bossman might not understand. It pushes him into a corner. Someone like Trump wont ever ask to clarify a term because to ask suggests he doesn't know something, that he isn't the smartest person in the room. So he wont ask and instead just stare at you trying to be intimidating, a defense mechanism. Maybe he'll like your confidence, but even so you are wasting his time because you are using terms he doesn't understand and so the information isn't getting through. You wont be asked back.

If he asks what "VPN" means, you then say "Virtual Private Network" ... which he still doesn't know and must ask again, making him feel doubly stupid. So when presenting to such people you absolutely must start with baby talk. Instead of VPN start with "tunnels through the internet protected by encryption". If he recognizes this as a VPN he will interrupt you, making him feel smart. And don't mention servers. Say "computers". "Servers" will make him picture waitresses.

Not kidding. This speaking-to-the-idiot-bossman is a skill, especially in politics or military areas where bossman is appointed for reasons divorced from knowledge or background.

And "man" because I've never seen this behavior in a female leader. This is a macho male thing imho rooted in instinct and genetics.</comment></comment></comment>


Has Salesforce.com Understood The BPM Market Better Than The BPMS Vendors ? - <AUTHOR> http://processtheory.squarespace.com/blog/2010/3/19/has-salesforcecom-understood-the-bpm-market-better-than-the.html

<comment><USER2> I looked a bit at this (UML tools, etc.) a few years ago, but did not pursue it.

Anything interesting going on, or pointers to an overview of the state of the art ?</comment>


Why Aren't There More Engineers? - <AUTHOR> http://techcrunch.com/2012/04/28/they-aint-making-any-more-of-them-the-great-engineering-shortage-of-2012/

<comment><AUTHOR> It's funny - a lot of my classmates at Stanford who started out in non-CS programs switched midway or picked up coding skills later. There are three startups that come to mind, two of which are YC alums, where at least one co- founder did not initially major in CS but picked up enough technical chops to code an awesome product.

I think it's difficult to learn outside a college environment - without the educational support system of peers, teachers, structure, credentialing, and student loans - it's a tough choice to try and learn how to code later AFTER you've already majored in something else. There's no guarantee that if you learn how to code on your own that you're learning properly, or efficiently, or anyone will hire you or want to co-found a startup with you. I think there's A LOT we can be doing to improve the pipeline of software developers.

That said, personally, I'm probably going to learn how to code and forego a joint degree in an MBA program, even though I'm 26 and two thirds done with law school. Is this the right choice? I'm not sure, but among all my friends who are entrepreneurs, it seems like coding is something you really can't afford to not learn anymore.</comment>


Why I'm Putting All My Savings Into Bitcoin [2011] - <AUTHOR> http://falkvinge.net/2011/05/29/why-im-putting-all-my-savings-into-bitcoin

<comment><USER2> The scary part of the bitcoin bubble (and it _is_ a bubble) is that most of these people putting a lot of money into BTC are not going to be able to get their money back out in the event of a market downturn.

<comment><AUTHOR> The price has two main factors: exponential growth in its adoption, and a speculative bubble on top of that. As long as the growth continues, everyone who invests in it will make plenty of money in the long run. The bubble has already 'popped' 4 times or so in its history.

</comment></comment><comment><USER3> So how much is the author's BTC savings worth now?

<comment><USER4> From the article: "As of midnight UTC on May 29, 2011, the rate is USD 8,30 per bitcoin."

Assuming he bought at that price, it's worth roughly 120 times as much when it hit $1000/BTC.</comment></comment>


Teach a Dog to REST - <AUTHOR> http://blog.apigee.com/detail/restful_api_design/

<comment><USER2> Forward (<http://getfwd.com>) employs conventions like this between the template and model layers of an MVC style framework.

        get("/accounts") // collection
        get("/accounts", [limit => 10, page => 3]) // pagination
        get("/email@example.com") // single record
        get("/firstname.lastname@example.com/orders") // relations
        get("/email@example.com/orders/10234/items/6/price") // deep relations
        get("/accounts", [search => "john"]) // search
        get("/accounts", [fields => "name, email"]) // partials
        get("/accounts", [order => "name desc"]) // sorting
        get("/accounts", [login => [...]]) // special conventions
        post("/accounts", [alternate_email => $alt, ":validate" => [required => [alternate_email]]) // validation
        put(...) // pretty much what you expect
        delete(...) // same

The interesting thing about moving REST conventions to the model layer, is that you can suddenly create external facing APIs in various formats really easily. I'm hoping/expecting this will become a more common pattern.

</comment><comment><USER3> Does anyone else find the dual role of POST as a create verb and as "complex search criteria" verb problematic? The WebDav RFC defines a SEARCH verb; why don't we see it used in more REST HTTP APIs?

</comment><comment><USER4> I love that I've learned most of these best practices already because I use Rails. A good technology (or framework) teaches people how to do something better.

</comment><comment><USER5> This is a nice presentation about URL best practices, but it doesn't really get into the most relevant or interesting topic of RESTful API design which is resource design representation. I'd love to see more in these specific areas with concrete examples of the approach others have taken.

</comment><comment><USER6> .json in the resource identifier? "Verbs are bad", except when it's "search"? /v1/dogs/molly vs. /v2/dogs/molly ?

Colour me unconvinced! I don't really see how promoting this hacky form of REST moves us forward.

<comment><USER2> What do you propose as alternative to these issues?

<comment><USER6> Get rid of the .json, use a specific media type, if at all possible refer to a schema description in the metadata presented.

Search is a service, not a part of a resource. Whether a seperate search service aggregating all different REST resources is supplied or not is irrelevant in the example case as resource collections can be filtered, which the article highlights (the colour= parameter), for a dogs resource, or a phonebook resource etc. filtering on attributes (which can use wildcards or regexes as seen fit to do so) provides the necessary functionality anyway. Search is a diversion in these cases.

Go versionless.

<comment><USER2> I agree with going versionless (though I can see the case for it also depending on how the API is intended to be used).

Get rid of .json? Make it optional sure, but allow it if the client wants to be specific. Seems like a good feature in that sense (optional with a good default).

I agree that search should not be a resource, but perhaps a parameter for filtering in addition to explicitly named param filters.

Thanks for sharing your thoughts on it.</comment></comment></comment></comment>


Elixir: A Mini-Documentary [video] - <AUTHOR> http://doc.honeypot.io/elixir-documentary-2018/ <comment><USER2> Nice work! Great way to get to know some of the ppl behind the Elixir lang ecosystem.

</comment><comment><USER3> Awesome language and wonderful people

</comment><comment><USER4> Great video! Really enjoyed it!</comment>


Ask HN: Where can I learn to make websites for cell phone browsers? - <AUTHOR>

I live in Japan and do web development on the side occasionally; one of the things I'd really like to be able to do is make websites suited for cell phones here -- not for large touch-screen phones, which can usually use a normal site, but the standard Japanese phone that uses a mobile browser (for example, mine [Sharp SH003] uses Myriad).
I've noticed that some standard HTML tags don't work and that there are other, undocumented ones that allow you to do things like dial a phone number.
I've had a very hard time searching for this kind of information in the past, so if there are any keywords that stand out for this type of web programming, please let me know! <comment><USER2> I would try: [http://www.amazon.com/Building-iPhone-Apps-HTML- JavaScript/d...](http://www.amazon.com/Building-iPhone-Apps-HTML- JavaScript/dp/0596805780/ref=sr_1_1?ie=UTF8&qid=1296007573&sr=8-1)

Building iPhone Apps with HTML, CSS, and JavaScript: Making App Store Apps Without Objective-C or Cocoa [Paperback]

Despite its title, it was the perfect book for learning to make apps for the mobile platform. I was surprised at how much I learned and was easily able to apply instantly.

Hope it helps.

<comment><AUTHOR> Thanks for the suggestion, but I'm not looking to build apps (or anything specific to the iPhone, which still has very low market penetration here), but normal websites.</comment></comment>