Better HN
topnewbestaskshowjobs
Log inSign up

wireprotocol

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

Submissions

comment 14y ago · link · parent

"Cascading replication looks interesting - does it support the topology that I mention where the master has a subset of the [tables??] from the slaves and the slaves can be written to?"

No. Cascading replication basically means that you can replicate from slaves to other slaves, rather than always replicating from the master. That allows you to form hierarchies, which is I thought what you meant by "tiered".

The current built-in replication is a form of phsyical replication, meaning that data pages are (more or less) identical on the master and slave. What you want is logical replication, which is being actively worked on now as a part of core postgres.

In the meantime, there are external logical replication systems like Slony, Bucardo, and Londiste. Slony is deserving of a reputation for being complex, but it's being actively developed and can be used for everything you mention (based on the very high level descriptions that you gave). I understand that "not in core, and hard to use" are pretty damning for a lot of cases, but it really does get the job done. And hopefully there will be in-core solutions in later versions of postgres.

"I don't mean this to be MySQL vs PostgreSQL, but MySQL has had these features for over 10 years and the kinks are already worked out."

I'm glad to hear that it's working for you.

"My X,Y, and Z list has been unchanging for 5 years"

For future reference, all of these features will fall under the heading "logical replication". When you see that, if it doesn't have all of the features you need, then they are probably going to arrive soon.

Postgres has had external logical replication (e.g. Slony) this whole time, which I think has somewhat reduced the demand to invest huge amounts of work in core. It looks like it fell short for your use case, unfortunately; and hopefully the current logical replication in core project will not.

comment 14y ago · link · parent

First of all, the success of postgresql and mysql are not mutually exclusive. Postgres operates in a lot of markets that MySQL doesn't (as far as I know) like telecom and finance. Postgres gets entirely new users with a variety of use cases, as well as people from Oracle, SQL Server, MySQL, and even some converts from people who tried NoSQL and found it lacking in some way.

An undeniably, there is a shift happening, even in parts of the market that were a MySQL stronghold. Heroku and their customers use postgres for multi-tenancy. Instagram uses postgres for photo-sharing.

I think MySQL has been very complacent because they are the default for a lot of simple web apps, and that keeps their numbers high. They aren't really breaking into new markets -- postgres is winning the geospatial market big time, and is always coming out with new features to break into new markets (personally, I am trying to advance postgres into the temporal database space).

comment 14y ago · link · parent

The main reason to do that is licensing. You either need to get a redistribution license, or the client needs to work out their own licensing deal -- and either way, you don't want to be beholden when negotiation time comes.

That also applies to MySQL, because it's GPL.

That does not apply to Postgres, because you can just ship it with the app.

I exaggerated a little, there certainly are times when you just don't care what database system you use and would rather have simple migrations at the expense of owning more code. But I think these reasons are weighted much too highly, particularly in the context of postgres.

comment 14y ago · link · parent

"What are the scaling differences between MySQL and PostgreSQL?"

The best advice I have is that using a different database system, particularly ones as different as MySQL and PostgreSQL (which are essentially opposites) is like going to a foreign country. You'll find things you like and things that you don't like, and it will have a real impact on your quality of life, but it's hard to say in a few words the things that will really matter to you. You don't have time to live in every country in the world, but you owe it to yourself to at least visit a few that come highly recommended.

Whatever you do, don't try to make the new country into your old country. You will just be disappointed.

The same goes for database systems.

comment 14y ago · link · parent

I see it as a major success story.

Postgres was developed over a long period of time with careful attention to architecture, robustness, and extensibility. It also focused on both external and internal documentation and cleanliness. And, it followed the traditional database system model with a cost-based optimizer and everything else.

As a result, we see a very robust developer community. It's a real machine -- churning out high quality releases every year with a great mix of newsworthy features. Enterprises and startups alike are flocking to postgres for a huge variety of use cases.

Slow and steady wins the race (and it doesn't hurt to be 5 tons and have tusks) and isn't tired afterward. And in databases, it's good to play for the long term because that's how long the data will last.

I wouldn't trade that for some first-to-market popularity.

comment 14y ago · link · parent

Your concerns are constructive and well-placed. It happens that they are all either done or actively being improved, but that's not obvious unless you follow very closely, so keep 'em coming.

"a scalable replication model that allows tiered replication"

They do in 9.2 (currently beta), it's called cascading replication.

The other replication features you mention are under active development by a team of reputed hackers.

"That, and the ability to reliably upgrade your binary without performing a massively time-consuming dump and reloading."

pg_upgrade has been available and you can upgrade from 8.3 to the latest without the dump/reload cycle. It has been a little rocky (by postgres standards) and some people have been hesitant, but it gets the job done and it's been improving a lot. A talk at a recent conference spoke quite highly of pg_upgrade despite running into some challenges (like a library versioning issue related to some perl functions they had and some multibyte characters I think). Not for the faint of heart, but if you really need this and don't mind reading a little (or hiring a consultant), you can make it work.

Every issue or every missing feature seems like a showstopper if you don't step back for a minute. No DBMS is perfect. Everyone has their list of "postgres is missing X,Y, and Z". The funny thing to me is that X, Y, and Z change with each release because the previous X and Y were added (often with greater flexibility than originally imagined), and there's a new alternative to Z.

Postgresql puts out a very high quality release every year with major features. Usually, it's a good balance of features requested by (potential?) users like you and new innovative features that move the database world ahead.

comment 14y ago · link · parent

Semantic changes in configuration files are problematic in MySQL for the same reasons they are problematic in PHP (the only other language that seems to do that):

* Your application then no longer works properly on a default install. Possibly in very subtle ways that you won't notice.

* Upstream will never make your settings the default. It would break too many applications, so you are on your own with those settings pretty much forever.

* Few users use non-default settings, so you are more likely to run into strange behaviors that are either bugs or can't be readily explained in a forum.

* Just imagine if you are trying to support multiple applications that each have their own settings they prefer. Especially if you want to integrate your data together at all, which is one of the main purposes of a database system.

comment 14y ago · link · parent

"it's a matter of reducing the complexity of migration"

You put the code in your application so you can switch out the database, but why do you want to switch databases?

You can't switch out the database for one with more features, because then you're not using the lowest common denominator any more, and you can't switch back.

It can't be licensing costs, because postgresql licenses are free.

The only other reason I can think of is performance. But trying to avoid database features just because you might want to migrate to a less-featureful database later seems more likely to result in performance problems than prevent them.

I agree you don't want to go out on a limb with crazy features just because you can. But those features are there for a reason, and might drastically simplify portions of your application if you use them. And a lot of them are SQL standard, just not supported properly in all database systems.

Also, I'd like to point out that database migrations themselves are quite rare once they become established in an organization. You might be able to migrate one fairly simple application if you bend over backwards trying to use only the simplest features; but once a few applications are depending on it, it's just too expensive.

comment 14y ago · link · parent

"Often the case for using custom data types, for example, is quite weak..."

Lots of people come to the postgres community because of PostGIS, which is (among other things) a custom type distributed separately from postgres.

Using custom types is not bad, the mistake is thinking that making a new type is easy. For a non-trivial custom data type, you need to tie it into the indexing system (GiST+KNN, GIN, SP-GiST, BTree, Hash) as well as the optimizer (have some good stats functions) -- not to mention the basics like a good representation and a well-thought out set of functions and operators.

Custom data types are really one aspect of an extension, albeit a crucial one. So don't think about it as "hey, I'll make a new phone number type because it sounds cool", think about it like "we need better support for genomic data in postgres, let's sit down and plan a serious extension".

If you want a special type for a phone number, use a domain over text with a check constraint. And that's SQL standard, too.

comment 14y ago · link · parent

He opened up the response with an analogy about cells.

For an analogy to have any use at all, it must illustrate a contrast between two relevant ideas.

The article is entitled "Why OO Sucks" and written by the author of Erlang.

I "projected" that the comment to which I replied was defending the non-suckiness of OO by using the cell analogy to contrast with erlang. Are you saying that was a leap?

What you are saying makes sense: there is more than one useful model. But that point should be made in the context of Joe Armstrong's specific criticisms; not claiming that OOP is as modular as a cell and erlang is not.

comment 14y ago · link · parent

"The people who originally came up with OOP knew what they were doing. The inspiration [of OOP] was the cell, which hides immense mechanical complexity behind a simpler interface..."

I think you are making two mistakes:

(1) Assuming that any good API/interface must be object-oriented; and

(2) Assuming that, when using object-oriented programming, that good APIs/interfaces come naturally.

Cells are obviously a very successful kind of module. What does that really mean? It's just an analogy. Erlang, the "non-OOP" language under discussion, seems to resemble cells at least as well as "OOP" languages (perhaps more so, because you don't have to synchronously wait for a response for every interaction).

This is part of the reason that people call erlang an OOP language. So clearly there is a major confusion over terms here, because the creator of erlang didn't originally consider it to be OOP.

OK, so let's assume that we're actually talking about something that is as non-OOP as I can imagine: haskell. Let's also assume that haskell doesn't resemble cells as much as OOP does. There are still problems:

* Many interfaces in haskell are very well-designed, so it's hard to argue that OOP has a monopoly on good interface designs

* It's not clear that the goals you mention, such as unexpected dependencies, are actually reduced by using OOP.

* It's not clear that a superficial similarity with cells really translates to anything meaningful. If nothing else, evolution of cells takes place on million-year timescales, and doesn't drive toward any one particular kind of outcome other than self-perpetuation; which are not a good set of properties when it comes to project management.

comment 14y ago · link · parent

It's hard to argue against trying to make the policies more objective and consistent.

But the reasoning you are using to get there seems to be pushing wikipedia to be more like google (keep pretty much all of the content and let pagerank sort it out) and less like wikipedia. There's nothing wrong with google, but it already exists, and we don't need another one.

Wikipedia is fundamentally based on editing. Deleting pages is just one aspect -- what about removing paragraphs? I think my paragraph is important, so I add it near the top of a page. You think the paragraph is completely useless and want to remove it entirely. What do we do? Remove the paragraph, keep it, or move it down the page?

You also don't address a lot of obvious problems, like namespace issues. If the policy is not to delete anything, then there will be more articles and greater ambiguity. I like the fact that, when I use wikipedia, it usually goes to the right place immediately or offers a short list of ways to disambiguate.

comment 14y ago · link · parent

Censorship is when you try to prevent a class of ideas or knowledge from being communicated in any medium. Dictators try to stop criticism, regardless of whether it's by pamphlet or radio broadcast. That is not the issue we're talking about at all.

We're talking about editing a specific body of work (Wikipedia) to exclude things deemed unfit. In fact, the motto of the NY Times is "all the news that's fit to print". That's editorial control, not censorship, because they don't try to prevent Small Town Weekly from printing a story about a lost dog, they just refuse to print it in the NY Times.

comment 14y ago · link · parent

You forgot the bug: "doesn't do what you want, but does it perfectly".

comment 14y ago · link · parent

I generally agree with the sentiment, but I'm not convinced at all by deathbed regrets.

It's easy to say you wish you spent less time working and more time doing the things you love, because it's easy to forget how working hard enabled you to do the things you love.

comment 14y ago · link · parent

Coming up with applications of the Higgs Boson can make it easier to discover. If the thing works, that indicates that the theory is correct.

comment 14y ago · link · parent

One thing he may be referring to is a cost-based optimizer (CBO). Dismissing the significance of a CBO is a mistake.

For one thing, it's not an optimizer like gcc at all. It doesn't take your existing algorithm and speed it up, it chooses a better algorithm. How does it know which is better? It collects statistics and runs them through a cost model.

This is what allows something like PostgreSQL to offer nested loop joins, merge joins, and hash joins. Without a CBO, how would it know which to choose? Similarly, it can offer multiple ways to use the same index (normal index scan, bitmap index scan) and multiple ways to aggregate (Sort+Group or HashAggregate).

Those are just a few of the many algorithms postgres offers that are chosen in a principled way by the CBO.

comment 14y ago · link · parent

I don't think the point of the article was seriously about the details of performance in MemSQL versus MySQL. I took it as a criticism of the irresponsible reporting of benchmarks.

comment 14y ago · link · parent

I tell you that you have "foo" apples. Write the number of apples you have on a piece of paper. What did you write?

comment 14y ago · link · parent

Similar arguments are made regarding campaign finance: "We're not regulating your speech, we're regulating your money.".

comment 14y ago · link · parent

In other news: "Why getting punched in the face matters, even if you heal".

Seriously, out of all of the human emotions, why do we constantly feel the need to justify the desire for privacy?

comment 14y ago · link · parent

The problem with incentives is that it's hard to tell that someone who avoided the traffic jam would have (but for the incentive) driven during the traffic jam.

In other words, let's say someone doesn't do the traditional 9-5, but works nights, or from home, or doesn't work at all, or lives 3 states away, or whatever. Do they get the incentive? If you bring them into the pool, then all of a sudden the budget would need to be a lot bigger.

There are some roundabout ways to try to measure this, but it seems much easier to just charge people for driving at peak hours. But that creates other problems, like installing tracking devices in peoples' cars.

comment 14y ago · link · parent

While your advice may be prudent, that does not excuse poor security.

comment 14y ago · link · parent

Up-front and clear fees, directly based on the product or service offered, are the most efficient way for a market economy to work. In this case, this should mean simple fees for the classes, and book prices based on the original content in that version divided by the number of people who demand that original content.

This patent describes a means to make the prices of things -- like a class -- much more obscure and indirect, which is obviously a perverse market. It's not really about piracy though; it more closely resembles a toll booth on the door to the classroom, or charging students to keep the lights on so they can read the chalkboard. This just happens to resemble a copyright issue, so it triggers that particular response from people interested in copyright.

So why are such perverse systems so common? Because we demand them. It's not some conspiracy. We like to play games with prices, and overestimate our ability to outplay our opponent, and think we can get the best of them (in reality, practical matters take over and we just end up paying more on average).

Take cellphones. You can buy an unlocked google phone for a simple, direct price based on the quality of the hardware and the support that you expect to receive from google (or the manufacturer). Then, you can get a prepaid service plan for cheap (I pay $30/mo for a good smartphone plan) that is based on the level of service you expect from the carrier for as long as you feel like being their customer. I will save hundreds per year over getting a contract and a discounted phone (let's say a typical smartphone plan is at least $60/mo, so I save $30/mo or $720 over a 2-year contract, but lose at most $400 from lack of a discount, netting me $320). I also have greater flexibility and choice.

Yet almost everybody in the U.S., including those reading this comment, are under a 2-year contract right now. Why? I don't know. Economics is about what people actually do though, not what they should do. And given a choice between clear pricing and obscure pricing, people choose obscure pricing.

EDIT: And after people get predictably tired playing pricing games with a large company, and end up just paying more, they complain.

comment 14y ago · link · parent

> Some of the suggestions make PostgreSQL seem less mature than InnoDB, still: "[don't put] sessions in the DB", "[don't put] constantly-updated counters in the database", and "[don't put] task queues in the database."

It's not that you can't do them in postgresql, or even that it will perform slowly. But when you have the chance to offload work from the database server that doesn't need to be there, it's often a good idea to do so.

I wouldn't have worded it the way the author did, either --it's certainly situation-dependent whether those are a good idea. But I wouldn't take it as a "postgres isn't up to the task".

comment 14y ago · link · parent

"Anything above 8GB exceeds what it is designed to handle and can cause major performance problems, such as the database becoming unresponsive for 1-2 minutes."

Can you please expand on that? What version did you test, on what hardware, and what workload?

comment 14y ago · link · parent

postgresql.org seems to have the AAAA record.

My linode seems to have an ipv6 address, but I can't ping6 any of the hosts you mention above from it. Haven't investigated beyond that.

My home router doesn't seem to support ipv6. I think my ISP (comcast) does though.

comment 14y ago · link · parent

Every data model is just a degenerate special case of every other data model ;)

comment 14y ago · link · parent

I attended a talk by Instagram post-buyout. That's where I got the impression that sharding was not a huge obstacle for them (though it was significant). Keep in mind their entire data management team was 2 people I think.

My point was that sharding is not an absolute "have it or not". Some features require major engineering efforts to get anywhere at all, but sharding is not one of them.

But if you think the overall effort is less with MongoDB then go for it.

comment 14y ago · link · parent

"That said, if your site grows in some way you didn't originally anticipate and you get to a point where you need to shard, but can only do so by changing data stores, then it's sad."

I think you're being too absolute. For instance, Instagram used sharding in postgres, and they didn't have to throw anything away or dedicate any huge engineering team to solve it.

1
798081
87