Slashdot stories can be listened to in audio form via an RSS feed, as read by our own robotic overlord.

 



Forgot your password?
typodupeerror
Databases Programming

Moving From CouchDB To MySQL 283

Posted by Unknown Lamer
from the hep-cats-just-use-postgres dept.
itwbennett writes "Sauce Labs had outgrown CouchDB and too much unplanned downtime made them switch to MySQL. With 20-20 hindsight they wrote about their CouchDB experience. But Sauce certainly isn't the first organization to switch databases. Back in 2009, Till Klampaeckel wrote a series of blog posts about moving in the opposite direction — from MySQL to CouchDB. Klampaeckel said the decision was about 'using the right tool for the job.' But the real story may be that programmers are never satisfied with the tool they have." Of course, then they say things like: "We have a TEXT column on all our tables that holds JSON, which our model layer silently treats the same as real columns for most purposes. The idea is the same as Rails' ActiveRecord::Store. It’s not super well integrated with MySQL's feature set — MySQL can’t really operate on those JSON fields at all — but it’s still a great idea that gets us close to the joy of schemaless DBs."
This discussion has been archived. No new comments can be posted.

Moving From CouchDB To MySQL

Comments Filter:
  • Not getting RDMS (Score:5, Insightful)

    by Anonymous Coward on Wednesday May 16, 2012 @08:41AM (#40016041)

    And in another three years they will switch to whatever is the coolest up-and-coming storage solution. Incompetent developers will always be incompetent developers.

  • by Anonymous Coward on Wednesday May 16, 2012 @08:57AM (#40016213)

    That's actually a rather insightful point...

    If your application fits well with the methodologies of a traditional RDBMS, use a traditional RDBMS, and hire people who are trained and experienced in using those methodologies to their full potential.

    If you're dealing with the latest Big Data paradigms and designs, where you can sacrifice some of the rigidity of a RDBMS to gain some flexibility and cheaper scalability, use a NoSQL database, and hire people who aren't stuck in their old RDBMS ways.

    The real key is for the person doing the hiring to understand which of those of methodologies fits their application.

  • Anonymous Coward wrote:

    MySQL is not Webscale, because it uses joins.

    Then how does a non-webscale database power popular web sites such as Wikipedia and Slashdot? If you don't do joins in the database, you'll probably end up doing the equivalent of joins (using one value as the key in another table) in your application.

  • by sycodon (149926) on Wednesday May 16, 2012 @09:07AM (#40016323)

    RDBMS systems can be flexible also. It just takes a bit of planning, a good understanding of your data and a well designed application...which you should do/have regardless of your storage solution.

    Call me set in my old RDBMS ways, but if I'm supporting it then I want to know what the hell is gong on with the data.

  • In NoSQL systems such as MongoDB and CouchDB, what do you call the operation where you retrieve one document, pull an identifier out of that document, and use that identifier as the key to retrieve another document?
  • by gbjbaanb (229885) on Wednesday May 16, 2012 @09:24AM (#40016533)

    true, just reading their blog

    Things like SQL injection attacks simply should not exist.

    HTTP API. Being able to query the DB from anything that could speak HTTP (or run curl) was handy.

    so sql injection is real bad, bad design of SQL... yet allowing any old HTTP javascript queries is somehow ok. Yes, incompetent developers indeed.

    They also say

    Why are we still querying our databases by constructing strings of code in a language most closely related to freaking COBOL, which after being constructed have to be parsed for every single query?

    apart from the concepts of query caches - and stored procedures - so what if the language is related to COBOL, javascript is closely related to C which is almost as old. And that has plenty of relations to Algol which is even older.

    So yes, it sounds like they havn't really got a clue. Great advert for their business!

  • by gorzek (647352) <gorzekNO@SPAMgmail.com> on Wednesday May 16, 2012 @09:25AM (#40016557) Homepage Journal

    I think the main problem is application developers not understanding anything about database theory. The vast majority of databases I encounter are not normalized at all, and it's almost always because they were designed by a developer with no database background.

    Granted, I didn't come into this field with that background, either, but I made a point to learn it, and now I'm very cognizant of implementing sound database designs. This whole idea of throwing random strings of structured text into a database column, and then relying entirely on the program code to parse and use it... well, why the hell even use a relational database, then?

    Relational databases aren't suitable for every application, nor are "bigtable" and other NoSQL implementations. The problem is that developers use a particular kind of database without really understanding how to use it properly. If they can get data in, and get data out, that's basically all they care about. Never mind if they make it a maintenance nightmare in the process.

  • by h4rr4r (612664) on Wednesday May 16, 2012 @09:29AM (#40016623)

    Or use a better DB like Postgres. How the MySQL still is popular I will never know. I think it is a conspiracy to prove FREE DBs suck.

  • by Xest (935314) on Wednesday May 16, 2012 @09:45AM (#40016881)

    "Why are we still querying our databases by constructing strings of code in a language most closely related to freaking COBOL, which after being constructed have to be parsed for every single query?"

    I couldn't agree with you more, this quote makes me want to vomit. Is this really how low the average competence of today's web developer has stooped? Between PHP developers not getting why PHP is a pretty shitly designed and developed language and stuff like this, I barely get how the web even runs anymore.

    To answer the original quote, the reason we're "still querying our databases by constructing strings of code in a language most closely related to freaking COBOL, which after being constructed have to be parsed for every single query?" is because SQL is a language based on mathematically sound principles, and which is supported widely, and known widely, and is processed by database engines across the globe that have literally decades of stability behind them, data in them and so forth.

    There's absolutely no reason to change SQL, because if you build a new query language that is based on the same mathematically sound principles of relational algebra then it will er... look just like SQL. The fact the kiddie (I can only assume he's a kiddie due to his blatant lack of knowledge and/or experience in the field) who wrote that blog post doesn't get this suggests he should absolutely not be trusted with your data as he'll only lose it.

    This is a classic example of someone bitching about something not because it's bad, but because they simply don't understand it and believe that rather than learn about it properly, it's better to bitch and hope you can somehow effect change by bitching.

    The advantage of most SQL/RDBMS is that they do adhere to the ACID principles, and for people who want to be able to have some degree of trust in their data source that's pretty fucking important. It's no surprise that they've moved over to MySQL though as it's one of the few RDBMS that is completely shit at adhering to the ACID principles and keeping uptodate with solid, stable implementations of modern database functionality.

  • by SQLGuru (980662) on Wednesday May 16, 2012 @10:01AM (#40017119) Journal

    I completely agree. A lot of non-DB centric people think that they can do more in the app tier, effectively using their databases as glorified file stores. Why even have a database server in those instances? I'm not saying that everything should be done in the database, either, but take advantage of every tool you have.

    NoSQL has a place, so does relational. Learn their strengths and determine which is the best fit for your project. Then, learn how to use the tool to its fullest.

  • by gorzek (647352) <gorzekNO@SPAMgmail.com> on Wednesday May 16, 2012 @10:02AM (#40017143) Homepage Journal

    Yeah, it really depends on what you are doing. But any time you break normalization there should be a good reason. Performance is certainly a valid reason. "I'm too lazy to make a well-designed database," however, is not.

    If you find yourself breaking normalization all the time, then you've probably found a use case where a relational database isn't the best tool for the job.

    While there is a "right" way to use a given tool, there is no one tool that is right for every situation. People who get this backwards are zealots and will often make poor decisions.

  • by serviscope_minor (664417) on Wednesday May 16, 2012 @10:04AM (#40017155) Journal

    so sql injection is real bad, bad design of SQL...

    SQL injection actually has nothing to do with SQL.

    Exactly the same attacks happen in any system where you build up a string from user data and pass it off to an interpreter. SQL has nothing to do with it.

    Exactly the same thing used to happen with sudo shell scripts.

    Exactly the same thing happened with javascript injection in very early webmail systems.

    There are plenty of opportunities for code injection on poorly written PHP, too.

  • by serviscope_minor (664417) on Wednesday May 16, 2012 @10:12AM (#40017241) Journal

    The big benefit to a relational DB with lots of enforcement at the data layer is that you can have one or more applications reading/writing to it with minimal concern of data corruption.

    Not just that, but good use of relations and normalization makes whole classes of bug impossible.

  • by Nadaka (224565) on Wednesday May 16, 2012 @10:59AM (#40017823)

    COBOL can be a bad language, but the best paid jobs around here are for COBOL programmers.

    It's hard to find a position (someone must die in order to open up a position), but once you get it, it's for life. =]

    In the end, there can be only one.

  • by Anonymous Coward on Wednesday May 16, 2012 @12:08PM (#40018671)

    That's not how debate works. If you can't take a position and defend it against questioning, without resorting to "go away and learn more", then you have no position and shouldn't have posted in the first place.

What this country needs is a dime that will buy a good five-cent bagel.

Working...