Better HN
topnewbestaskshowjobs
Log inSign up

wireprotocol

7,244 karma · joined Sep 25, 2010 (16y ago) · 2,593 submissions

Submissions

comment 11y ago · link · parent

"has gone through legal contortions to get programmers into the the US, where they then paid them the same as they'd have paid an American. Why would they go to extra trouble to get programmers for the same price?"

I agree with the essay in general, but this seems like a fairly dumb question. Supply and demand says that a greater supply will tend to drive prices down. That may not really apply in this case, because a greater supply might result in a greater demand (for various plausible reasons); but the question just seems like a poorly-argued part of the essay.

comment 11y ago · link · parent

Is intrinsic motivation something everyone is born with? Or does it need to be learned and reinforced with positive outcomes?

One potential problem is that people may never really develop an intrinsic motivation to work if they aren't given a push early on. Basic Income may eliminate that first push, which I think is crucial.

Let's say you are 16. If you get a job, the expectations are low and your needs are low, so you take the first thing to come along. That puts you in a mild discomfort that encourages you to seek better opportunities as they come along, and you are likely to develop a strong intrinsically a motivated work ethic.

With Basic Income, your needs are already met, so it's easy to rationalize it away and just say you'll get a job after you graduate from college. By then, the expectations are much higher and your needs are much higher, so you hold out for a better job that may never come because you have no experience. So, you just stay in your comfort zone forever.

comment 11y ago · link · parent

"the rate of false accusations is low"

I didn't read the study, but how could anyone know this? I suppose you could assume that a conviction means that the accusation is true, and that exoneration means that accusation is false, but there are a lot of cases where it's not known one way or another. I would be surprised if 90%+ of accusations result in a conviction, so the study must be assuming that any accusation is true if the accused is not exonerated.

There are also other, like if one party believes an assault took place and the other does not, or if the accusation is true but the perpetrator is misidentified.

Please correct me if I'm wrong, but my guess is that the statement above (alone, out of context) is not well supported by evidence.

comment 11y ago · link · parent

This article is reckless. The author throws out a mathematical model regarding a very sensitive subject with no evidence that the model reflects reality.

In effect, it just gives a mathematical veneer to the author's guesses. Similar to how wearing a lab coat while stating your opinion makes it seem scientific.

(The most obvious issue is non-independence, but there are plenty of other problems.)

comment 11y ago · link · parent

This is a bad business plan. Sure, they make a lot of money now, but they are curing all of their customers. Soon they won't have any left.

Typical shortsighted focus on profits this quarter, without a sustainable business model.

comment 11y ago · link · parent

For the time I've been interested in rust, it's been quite focused on a very practical problem: safe, without requiring a GC.

comment 11y ago · link · parent

Can the documentation or user experience be improved to prevent that issue from happening to someone else?

comment 11y ago · link · parent

The license for ZFS is still CDDL

comment 11y ago · link · parent

I rarely see anyone consider that the American system has at least one fundamental advantage: it's closer to a binary system, rather than decimal.

Why do we want a decimal system? The only reason for a base of 10 that I can see is that we have ten fingers. But binary systems map better to a lot of real-world problems.

If baking, are you more likely to take a recipe and halve it or cut it by a factor of ten? In construction, are you more likely to subdivide an area into two, or ten? If you split a stock, are you more likely to split two-to-one or ten-to-one?

The answer, in all those cases, is the former, which is favored by a binary system. Forcing decimal upon us is what leaves us with numbers like 0.125 rather than 1/8.

So rather than move to metric, let's come up with a more consistent base-two system, and then we can all use that. (Just saying that to make a point; not a serious proposal.)

comment 11y ago · link · parent

PostgreSQL supports true serializability, while maintaining good performance and concurrency:

http://www.postgresql.org/docs/9.4/static/transaction-iso.ht...

It's based on fairly recent research by Michael J. Cahill, et al.

It's simple. If you are confused, then set default_transaction_isolation=true. You will get errors if there's a data race.

Given that, what's the point of the article? That sub-SERIALIZABLE modes have complex semantics? Yes, that's true, but they are still much more likely to help you then the NoSQL "you're on your own to avoid races" approach.

If you want to avoid lots of really challenging problems, PostgreSQL is often the best bet by far.

comment 12y ago · link · parent

I think it goes beyond syntax sugar, but perhaps there's a transformation between them that I'm not aware of.

comment 12y ago · link · parent

No:

https://news.ycombinator.com/item?id=8690389

But they are similar... Kind of like correlated subqueries in the from clause. But they allow a few new twists in the semantics.

comment 12y ago · link · parent

Did you actually try in postgres? If so, please provide an example.

comment 12y ago · link · parent

The author specifically claimed that using a safer system like postgres would not have prevented the problem. But the evidence only says that it may not have prevented the problem.

It still looks to me like they would have stood a better chance with poatgres.

comment 12y ago · link · parent

Your example of poor SERIALIZABLE performance is from a MySQL user. Have you tried SERIALIZABLE in PostgreSQL? The implementation is based on fairly recent research, and performs quite well for a lot more use cases.

And the point about ORMs is valid, but still not enough to back up your unqualified claim that using postgres would not have solve the problem. It might not have, but postgres offers a lot of tools to solve this problem (we didn't even discuss SELECT ... FOR UPDATE), and even inexperienced users are at least more likely to have stumbled into one of those solutions.

I very much agree that isolation issues are subtle traps for many users, even in SQL. I would like to see SERIALIZABLE become more common, and eventually the default, in postgres. I also like the fact that you're writing real tools to check up on these in a formal way.

But please be a little careful when making statements like that, because it can turn people away from the systems most likely to help them.

comment 12y ago · link · parent

I strongly rebut the following claim, which is central to the article:

"Internet commenters, in their infinite wisdom, were quick to point out that if you’re dealing with money, you had better use an ACID database. But there was a major flaw in their argument. Most so-called ACID databases — for example Postgres, MySQL, Oracle or MS SQL Server — would not have prevented this race condition in their default configuration."

I hesitate because I don't really understand the details of the situation the exchange faced. But, going by the linked references here:

https://bitcointalk.org/index.php?topic=499580 http://www.reddit.com/r/Bitcoin/comments/1wtbiu/how_i_stole_...

it appears that the pattern in question, if translated very unnaturally to SQL, is something like:

    CREATE TABLE account(id int8, balance numeric);
    ...
    BEGIN;
    SELECT balance FROM account WHERE id = 123;
    -- application sees 100, subtracts 90, sees that
    -- it's still positive and does:
    UPDATE account SET balance = 10 WHERE id = 123;
    COMMIT;
Technically speaking, running that in postgres in the default configuration (read committed) is prone to a race, and you'd need to use repeatable read or serializable mode to protect you.

But that's ridiculous. Anyone using SQL would instead do:

    CREATE TABLE account(id int8, balance numeric, check(balance >= 0));
    ...
    UPDATE account SET balance = balance - 90 WHERE id = 123;
And that is not prone to a race. Try it in any version of postgres, in any configuration. You can't get double withdrawls (where only one takes effect), and you can't get it to go below zero.

So, the author is technically right: (a) if you translate the NoSQL-isms into SQL in an unnatural way; and (b) don't bother to use SERIALIZABLE mode, which costs very little in most situations.

I agree with the author that isolation is tricky, and developers should not be expected to understand the nuances. And I applaud the development of a testing framework to really understand the various kinds of isolation and how they apply to different products. But the example is a bad one, because it actually does work just fine in postgres, and probably many other systems.

comment 12y ago · link · parent

I know, in general, about various kinds of serialization anomalies, and I know (in moderate detail) how all of the isolation modes are implemented in postgres.

What I don't know is about the particular problem the exchange encountered, and why postgres's isolation would not have prevented it. Based on the very brief descriptions of the problem that I've seen, it seems like postgres would have prevented it, but I don't have enough information to say for sure.

comment 12y ago · link · parent

But that will not happen in postgres on any version in any configuration with any isolation level. It just can't happen.

comment 12y ago · link · parent

"...able withdraw more money than they had in their account...Most so-called ACID databases — for example Postgres, MySQL, Oracle or MS SQL Server — would not have prevented this race condition in their default configuration."

The author didn't really show that this was true. He obviously understands isolation well, so I would tend to believe him, but it would be nice to see an example.

In a simple case (not sure that it matches the exchange's case), postgresql in any configuration will prevent this problem:

    CREATE TABLE account(
      id int8,
      balance numeric, check (balance >= 0)
    );
No matter what concurrent activity you have going on, it's impossible (as far as I know) to end up seeing a balance less than 0. That's actually true in any isolation mode that postgres supports (read committed, snapshot isolation, and truly serializable).

Does someone have a counterexample, or more details about the case at the exchange that would not be solved by postgres?

I'd also like to point out that the postgres's implementation of true serializability performs quite well and there isn't much of a cost to using it over snapshot isolation.

comment 12y ago · link · parent

The problem described in this post is beyond just a buffer overrun. It's about pulling in huge numbers of libraries for a few conveniences.

Rust can't save you from that; pulling in libraries makes it way too easy to increase the surface area of your code by several orders of magnitude. Even assuming rust offers an order of magnitude better security than C/C++, it still can't keep up. Sure, it mitigates things a little, but only until the next whiz-bang library gets linked in (even if it's written in rust, it will have some flaws).

In other words, the security of a program is based on the absolute number of bugs in it; but a programming language can't do much more than reduce the ratio of bugs to program size.

The OS is in a much better position to address the problem.

comment 12y ago · link · parent

"people shriek"

Can you expand on that?

comment 12y ago · link · parent

"Liberal," like fairness, means different things to different people. In America, where this forum is based, it means significant government involvement. But I could have been less ambiguous.

comment 12y ago · link · parent

Even the most liberal of economists must be thinking: "this sounds like a job for... the market!"

comment 12y ago · link · parent

Historical revisionism is not honest and it raises serious credibility issues.

That's bad for science. It's quite similar to adjusting your hypothesis to fit the data. Not as bad as manipulating the data, but not ethical, either.

comment 12y ago · link · parent

That's not huge compared to their other contributions. Look here:

http://en.wikipedia.org/wiki/Google.org

comment 12y ago · link · parent

Perhaps today, that's true. Five years from now, civil trials, where one party is the government, might be used regularly as a way to circumvent the protections afforded criminal defendants.

comment 12y ago · link · parent

In my opinion, you should be provided an attorney in those cases, as well.

comment 12y ago · link · parent

The same way that growing a plant on your own property for your own consumption became "commerce among the states".

comment 12y ago · link · parent

RDBMS have completely dominated in a way that few other technologies have. Especially for anything that might be described as business data (which is the prime value market for databases). Everything else is relegated to share a small niche. If you count SQLite as an RDBMS, the domination is even more complete.

So, my question to you is: why?

It can't be some kind of vendor lock-in, because there is no one vendor; there are several commercial vendors and open source projects available to choose from (each individual vendor might lock in their users, but that doesn't explain why they are still all RDBMSs and not something "better"). It can't be legacy, because SQL is as popular as ever; perhaps more so, as it seems that using a normal filesystem to store data is not very common any more.

So you need to explain why they are so popular yet so wrong; otherwise it just sounds like a case of "everyone is dumb except me".

comment 12y ago · link · parent

It can be stored twice, but I don't think that's the ordinary case. Pages that are hot in PG's buffer cache are likely to stay there, making the same page in the OS buffer cache cold (because there aren't many requests for it). That's not always true, because writes to hot pages will end up going through the OS buffer cache maybe a couple times per checkpoint cycle, but it's still not (on average) stored twice. I don't have empirical numbers here, unfortunately, so someone else can correct me and fill in details.

At least from the discussions I've seen, there isn't a lot of interest in using O_DIRECT or otherwise taking on the I/O scheduling problem into postgres. It's not particularly exciting to me, because

* Takes on the I/O scheduling problem, rather than the simpler method now of just handing pages to the kernel for lazy writing, and fsync'ing at checkpoint time.

* Requires a lot of new code, tuning, configuration, etc. with a high maintenance cost.

* Not portable, so it's easy to make a tweak that helps on kernel and HW configuration X but hurts on kernel and HW configuration Y.

* Not very strategic: it helps some workloads with a lot of real I/O by some small constant factor; which doesn't necessarily open up new use cases or market opportunities

In my opinion, it's much better to focus on innovative features, or more low-hanging performance gains (which exist in postgres), or scale-out features. All of those will be slowed down if the code becomes bulkier (making correct patches harder to write, especially for new developers) and the maintainers become distracted by I/O scheduling issues.

It seems more like something to do when innovation slows enough, otherwise it doesn't seem worth it.

1
575859
87