Live data from Hacker News

Evernote blog: WhySQL?

blog.evernote.com

41–50 of 77 posts

Re: Evernote blog: WhySQL?

#41

The notebook/note example is weak - in a nosql database you need to design your data structure appropriately to get the level of atomicity you require. Storing an entire notebook in a single document would be the most obvious. I use postgres all the time and sql is great, but poo-pooing nosql because it wouldn't work with your relational structure is not the best idea. Also - I have found a hybrid between nosql (mong…

Storing an entire notebook in a single document would be the most obvious.

The cost of course being that a change to any note in a notebook yields a save of the entire document. Not a problem in simple cases, but that sort of mass-write-amplification can kill you (talk to Digg about that).

Also - I have found a hybrid between nosql (mongodb) and sql (postgres) is ideal - who says you need to use a single database?

Simplicity. Coherency. Maintainability. And on. Sure, it might make sense, but if you already have you toes in the "SQL" world, it is usually worthwhile to dunk your whole foot in. Many SQL products also offer the document functionality of MongoDB, for instance. SQL Server, as an example, lets you store XML documents to your hearts content, which you can index and intelligently query upon, etc. Your scheme is boundless, and on and on.

Re: Evernote blog: WhySQL?

#42
post #34

Can anyone explain the following bit: "They’re cleanly partitioned into 20 million data separate data sets, one per user." Does it mean they have a database per user? That can't be right is it?

Not likely, but they can very easily have a database holding all users with id starting with 'a'

That's a really bad method of sharding. Names do not distribute equally over the alphabet.

Re: Evernote blog: WhySQL?

#43
post #34

Can anyone explain the following bit: "They’re cleanly partitioned into 20 million data separate data sets, one per user." Does it mean they have a database per user? That can't be right is it?

Why not have a database for each user? Evernote's data is partitioned perfectly for that. Notebooks and notes are accessible to one user or are public. There is no sharing notes between users.

Re: Evernote blog: WhySQL?

#45
post #13

The notebook/note example is weak - in a nosql database you need to design your data structure appropriately to get the level of atomicity you require. Storing an entire notebook in a single document would be the most obvious. I use postgres all the time and sql is great, but poo-pooing nosql because it wouldn't work with your relational structure is not the best idea. Also - I have found a hybrid between nosql (mong…

What about when you want to find all notes that was made a specific day last month (say for a report)? Traverse all notebook documents and look at each notes date? Good luck with that.

Many nosql databases support queries. If you are using one of these then you are in a better place for features like that than you are with heavily shaded SQL.

Re: Evernote blog: WhySQL?

#46
post #30
post #26

Earlier quoted context omitted.

It's amazing how when you use recent technology that has been designed and engineered from the ground up for the demands of modern web apps, you can devote a lot of other resources to the actual product and usability.

Is it possible that a) not all code written is for web apps b) that said recent technology also only fits a niche for modern web apps? I think you view on what constitutes modern web apps or software in general is biased in favor of some examples who benefit by using mongo/couch/redis whatever. (And are very vocal about it) [EDIT: spelling, and to add that I have tremendous joy in playing with couch, redis, node late…

[deleted]

Re: Evernote blog: WhySQL?

#48
post #34

Can anyone explain the following bit: "They’re cleanly partitioned into 20 million data separate data sets, one per user." Does it mean they have a database per user? That can't be right is it?

Why not have a database for each user? Evernote's data is partitioned perfectly for that. Notebooks and notes are accessible to one user or are public. There is no sharing notes between users.

There is sharing notes between users though - I have several shared notebooks, each holding shared notes.

Re: Evernote blog: WhySQL?

#49
post #28

There are other reasons to choose NoSQL For example, when Craigslist was using mySql and they had to change their schema, it took MONTHS to facilitate the change across all their slaves. You can also have a mixed strategy of using both RDBMS and NoSQL to achieve consistency while being able to be flexible to architecture changes. Lastly- have you looked at total overal cost? Setting up a large cluster with mySql will…

Doing data migrations up front in a NoSQL system means you've changed the fields around in your document types, then you're done. Now 95% of your documents are wrong, missing those changes. Maybe you have linkages between different types of document (akin to a foreign key) - now a lot of those might be pointing to nothing. In this model, it's the application's job to anticipate and work around these inconsistencies.…

I think the problem is that when you change a table structure in MySQL, it takes quite a bit of time to do the actual writes. Adding a column tends to force a rewrite of the table. Braindead I know....

I think the problem is that MySQL isn't really a standard SQL-world db. It has some of the advantages of one, but not all of them and some very annoying gotchas.

Re: Evernote blog: WhySQL?

#50
post #4

Does anyone have a link to a decent comparison between MySQL and PostgreSQL? I'm really wondering why so many people use MySQL, even though it supports a lot fewer SQL features than PostgreSQL.

In addition to the other factors listed here, Postgres's default configuration was tuned to a dramatically underpowered machine for many years. Yes, that meant that the occasional user who did have that kind of machine saw acceptable performance out of the box, but the other 9/10 systems burned a lot of the DBA's time tuning the system. I think that's a big reason why Postgres has a reputation for difficulty in some quarters.
Post reply on HN