7,244 karma · joined Sep 25, 2010 (16y ago) · 2,593 submissions
comment 11y ago · link · parent
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
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
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
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
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
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
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
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
"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
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
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
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
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
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.