Slashdot Mirror


MEAN Vs. LAMP: Finding the Right Fit For Your Next Project

snydeq writes: LAMP diehards take note: The flexible simplicity of MongoDB, ExpressJS, AngularJS, and Node.js is no joke and could very well be a worthwhile stack for your next programming project, writes InfoWorld's Peter Wayner. "It was only a few years ago that MongoDB, Express.js, AngularJS, and Node.js were raising eyebrows on their own. Now they've grown up and ganged up, and together they're doing serious work, poaching no small number of developers from the vast LAMP camp. But how exactly does this newfangled MEAN thing stack up against LAMP? When is it better to choose the well-tested, mature LAMP over this upstart collection of JavaScript-centric technologies?"

28 of 175 comments (clear)

  1. The Fuck? by OverlordQ · · Score: 4, Insightful

    >This isn't a problem if every single entry fits into exactly the same format, but how often is the world that generous?
    > What if two people share the same address but not the same account?

    You dont make it a unique field?

    > What if you want to have three lines to the address instead of two?

    You have an empty field?

    > Who hasn’t tried to fix a relational database by shoehorning too much data into a single column? Or else you end up adding yet another column, and the table grows unbounded.

    Yeah, I cant read this crap considering the very next section is 'Disk space is cheap'. If it's cheap, who cares about 1 extra field in the database.

    Remember guys MongoDB is webscale

    --
    Your hair look like poop, Bob! - Wanker.
    1. Re:The Fuck? by MightyMartian · · Score: 4, Insightful

      It's almost as if the writer doesn't understand what a relational database is.

      --
      The world's burning. Moped Jesus spotted on I50. Details at 11.
    2. Re:The Fuck? by wonkey_monkey · · Score: 5, Funny

      I enjoyed this gem:

      If you write code for Node and decide it’s better placed in AngularJS, you can move it over with ease, and it's almost certain to run the same way.

      Yes, if there's one thing professional programmers (and their PHBs) love, it's code that's almost certain to work.

      --
      systemd is Roko's Basilisk.
    3. Re:The Fuck? by darkain · · Score: 3, Funny

      "MongoDB is webscale"

      For those that have not seen it yet: https://www.youtube.com/watch?...

    4. Re:The Fuck? by rockmuelle · · Score: 4, Insightful

      And the author hasn't looked at a relation database in the last few years, either. PostgreSQL, Oracle, MySQL, and I'm sure the other big ones all have JSON (or similar) column types now that let you attach semi-structured elements to your records. You get all the benefits of a RDBMs (ACID, referential integrity, 40 years of history) _and_ all the benefits of NoSQL.

      Seriously, there's no good reason not to start with PostgreSQL and only add MongoDB if you really have a good use case for it (you know, you suddenly need to be Web Scale). Personally (and professionally), I use both, with PostgreSQL as the main DB for everything and MongoDB for read-only collections of indexed data.

      My challenge to devs out there: spend the hour it takes to learn SQL and understand what you can actually do with it. And, stop pretending that an RDBMS won't scale to meet your needs (spoiler alert: it will).

      -Chris

    5. Re:The Fuck? by jbolden · · Score: 4, Informative

      I know SQL pretty well. I agree with you it handles most stuff. That doesn't mean it handles everything.

      SQL engines are often slower.
      SQL engines have problems with massive parallelism (i.e often at around 12 CPUs you stop gaining much at all by adding addition CPU).
      SQL engines have problems with complex in document (i.e. in blob) searches
      etc...

    6. Re:The Fuck? by drakaan · · Score: 4, Insightful

      Not to be rude, but what the hell are you talking about?

      SQL engines are often slower than what? In what scenario? Operating on what hypothetical database schema with how many records spread across how many tables?

      SQL engines have problems with massive parallelism? Why? Which ones?

      How well do you *really* know SQL in general and the capabilities of different database engines in particular? I suspect you may know less than some people who know SQL *really* well (as opposed to *pretty* well).

      I apologize for the tenor of this post, but that portion off the article was ridiculous, and thus far all of the comments in support of it have demonstrated a similar lack of familiarity with actual databases, their operation, or performance tuning.

      --
      "Murphy was an optimist" - O'Toole's commentary on Murphy's Law
    7. Re:The Fuck? by shutdown+-p+now · · Score: 3, Informative

      The last few years in this case is more like the last decade. Before JSON, there were (and are) XML-typed columns, and any decent RDBMS will let you use XQuery or similar to query on them directly within your SQL query (and will use special indices to optimize such queries). SQL/XML spec, that standardizes this, was published in 2003. Oracle shipped preliminary support of the then-draft spec in 2002; Microsoft shipped it in SQL Server 2005 in, well, 2005; and Postgres shipped it in 8.3 in 2008.

    8. Re:The Fuck? by 0100010001010011 · · Score: 3, Funny

      Hush, the 20 year olds think they invented something.

      “When I was a boy of 14, my father was so ignorant I could hardly stand to have the old man around. But when I got to be 21, I was astonished at how much the old man had learned in seven years.”

      Once you get a B.S., you think you know everything. Once you get an M.S., you realize you know nothing. Once you get a Ph.D., you realize no one knows anything!

    9. Re:The Fuck? by narcc · · Score: 4, Funny

      Ruby

    10. Re:The Fuck? by Anonymous Coward · · Score: 4, Insightful

      What's really concerning is that I've had "new school" web devs completely laugh at me when I suggest they ask their resident DBA questions about database performance, etc. Apparently, a DBA is just someone who makes images and restores backups now. "Hey guys, let's make a business that's completely reliant upon reliable data, and then completely ignore getting someone who's entire knowledge specialization is data management and arrangement... Yeah, fuck those dba guys..."

    11. Re:The Fuck? by Anonymous Coward · · Score: 3, Funny

      Just an FYI, jbolden works for Microsoft. So his experience and comments would be related solely to SQLServer.

    12. Re:The Fuck? by jbolden · · Score: 4, Informative

      SQL engines are often slower than what?

      Than engines designed for massive parallelism in dealing with workloads which can be effectually processed in parallel.

      Operating on what hypothetical database schema with how many records spread across how many tables?

      Generally NoSQL engines use schema on read techniques not schema on write. The table structure comes during the read. To get some sort of fair comparison something like a typical star schema with a much too large fact table (think billions or trillions of rows) and a half dozen dimension tables.

      Or if you really want to make it worse. The same query where the table is getting 1m writes / second and you want an accurate stream.

      SQL engines have problems with massive parallelism? Why? Which ones?

      Because SQL by its nature operates on the table not the individual rows. Older database technologies that were row oriented like what you see on a mainframe on in SaS work better when the ratio of table size to computation speed is low. Today because disk storage size per dollar has gone up so fast, we disk we face many of the same problems systems in the 1980s faced with tape.

      And the next question is pretty much all of them. The big data SQL engines have the least problems though and via. their execution plans turning into map-reduces might present a viable long term solution.

      How well do you *really* know SQL in general and the capabilities of different database engines in particular?

      Assume I don't know anything. Oracle, which has the best engine and SQL people on the planet has a guide for hybridization to handle things their engine can't handle well. IBM which probably comes in second and invented the relational database produces their own Hadoop / R to handle queries that DB2 (which is BTW far better than Oracle at stream) can't handle. Teradata's engine which was originally written specifically for larger amounts of data for a decade has had specific features of another subsystem to do enhanced big data, they also have guides for hybridization for things even their enhanced engine can't handle And Microsoft which writes the 3rd most popular engine has spent many millions on hybridization strategies. Enterprise DB (postgres) fully supports the IBM strategy.

      I don't know anyone in the space who does agree with the /. "SQL can do everything" attitude.

      but that portion off the article was ridiculous, and thus far all of the comments in support of it have demonstrated a similar lack of familiarity with actual databases, their operation, or performance tuning.

      The article was ridiculous I said as much in another response. However the comment I was responding to went much too far in the other direction. As for performance tuning -- performance tuning is designed to avoid full table scans and expensive joins. To goal of many hybridization strategies is to take a raw data flow and convert it into a relational ETL using a big data engine which can take advantage of indexing and a better execution plan. It doesn't do much good when the initial goal is to do a full table scan.

    13. Re:The Fuck? by jbolden · · Score: 3, Informative

      You are correct, I've never worked for Microsoft I don't even sell much Microsoft. Mostly when I'm dealing with SQLServer datasets they have been no problem for RDBMS. My company has helped do connector work for Azure on Hadoop / SQLServer mixtures.

      I suspect the reason AC thought I worked for Microsoft was I thought the Windows 8 (and early new interface for Office) migration program (i.e shift the x86 ecosystem) that Balmer / Office group was pushing made a lot of sense and defended it.

      there are very few scenarios extreme enough that Oracle cannot handle the database workload as well as any NoSQL solution

      Oracle is excellent. Oracle has problems with massive parallelism though. The Oracle engine works well at 10 CPUs handling versatile workloads. It doesn't at 1000 CPUs focusing on one big table scan for one query.

      But god help those novice developers using the NoSQL database set up by a novice DBA when they don't comprehend what they are giving up by saying "no thanks" to ACID compliance.

      If you aren't using relational you better be using old fashioned block type strategies (i.e. full table writes like you do in COBOL) or not be doing transaction processing at all. That's one of the things you are giving up when you go non-relational. Data changes become much trickier.

      But that's not a problem for most NoSQL where you just write the data out, process it for X time and changes are handled via appends if at all. A good relational analogy to the append structure is how RDBMS handle materialized views and data changes.

  2. Great comparison by Anonymous Coward · · Score: 5, Insightful

    Which is a better tool for outdoor work, a lawn mower or a snowblower?

    1. Re:Great comparison by wonkey_monkey · · Score: 4, Funny

      Your mama was a snowblower!

      --
      systemd is Roko's Basilisk.
  3. Different types of terms by markdavis · · Score: 4, Funny

    Never heard of "MEAN" before now, but that doesn't align with the term "LAMP" which describes the entire server/platform. "LAMP" includes the operating system (Linux) and web server (Apache) in the name https://en.wikipedia.org/wiki/...

    While MEAN does not https://en.wikipedia.org/wiki/...

    So would it be "LAMEAN" perhaps? :)

    1. Re:Different types of terms by laffer1 · · Score: 4, Insightful

      I think the who problem with LAMP or MEAN is that it's trying to define one web stack. The world has moved on. Some companies deploy nginx now instead of apache or in combination with it. Netflix sends 33% of all Internet traffic on FreeBSD rather than Linux. I've seen so many people replace the P in LAMP to be python. We can't even agree on the P.

      My current stack at work is FATAPJ - FreeBSD, Apache, Tomcat, AngularJS, PostgreSQL, Java

    2. Re:Different types of terms by Penguinisto · · Score: 4, Funny

      As long as they don't replace it with Erlang, because then it would just be LAME.

      --
      Quo usque tandem abutere, Nimbus, patientia nostra?
    3. Re:Different types of terms by mr_mischief · · Score: 5, Funny

      Something other than Node is likely used for the static parts of a site or for caching. Apache or Nginx are likely candidates. There are endless stack names, and they can be as silly as we want and someone could still build something useful on them. LAMP got coined because the stack was so popular together, with the 'P' being /P(erl|HP|ython)/ in many camps. That doesn't mean they'll all catch on as common, popular stacks.

      Some people use BAPP -- BSD, Apache, PostgreSQL, Perl/Python/PHP. Some people use specifically FreeBSD: FAPP. Some people use FreeBSD, Apache, Perl, and SQLite...

      Here are some other less common web stacks:

      MongoDB, ExpressJS, Linux, AngularJS, NodeJS, Groovy, Erlang
      MELANGE

      Scala, Python, AngularJS, Zope
      SPAZ

      Clojure, Linux, Oracle DB, WebGL, Nginx
      CLOWN

      PostgreSQL, io.js, Scala, Solaris, Erlang, D
      PISSED

      SQLite, Ubuntu, C, korn shell, io.js, TCL
      SUCKIT

      Lighttpd, io.js, C, Kadmelia
      LICK

      Apache, Mumps, io.js, R, Ingres, Twitter API, Enterprise JavaBeans
      AMIRITE

    4. Re:Different types of terms by Anonymous Coward · · Score: 3, Funny

      Well, at least it isn't FreeBSD, Apache, Tomcat, AngularJS, Lua, Bash, Emacs, Ruby, and TypeScript.

  4. Angular by pr0nbot · · Score: 5, Interesting

    I can't comment on the other technologies, but Angular has transformed how I build the interactive parts of web pages.

    When you first approach Angular it seems like an over-engineered, incomprehensible edifice, and the tutorial throws you straight into writing your whole website as a single-page application. But once your realise that you can use a small lump of it on a single page to bind some UI elements to javascript state objects, you find yourself using it all the time even for small things. For me at least, it's as much a revelation as jquery was.

  5. So much stupid by geophile · · Score: 5, Informative

    Among the great revelations of relational databases was the JOIN command. With JOIN, we could save disk space by removing repeated fields like city, state, and ZIP code. By storing this frequently accessed and repeated data in separate tables that can be included in future results through a JOIN, we keep our database tidy and our disks slim. But JOINs can be tricky for some and hard on RAM, and though it's still a good idea to isolate and access data in separate tables through JOINs, there's not as much need to save disk space now that disk drives are measured in multiple terabytes. The space is so cheap that some database designers end up denormalizing their data because the JOINs are too slow.

    This is just so wrong. If you store, let's say, city/state/zip redundantly, then you run the risk of having the copies, that should be kept synchronized, diverge. This is especially true in the absence of all-or-none transactions. And not to mention the fact that having to update the "same" datum in multiple places is going to affect performance.

  6. Jepsen by Wizy · · Score: 4, Interesting

    Remember folks, MongoDB has failed the Jepsen Test multiple times.

    https://aphyr.com/posts/322-call-me-maybe-mongodb-stale-reads

  7. Relations by pigiron · · Score: 3, Insightful
    What if two people share the same address but not the same account?


    Then you need an account table, a customer table, and a relational table that contains instances of paired keys from each. Learn some elementary set theory for chrissakes! The article is full of other stupidities as bad as this. /. keeps getting dumber and dumber. "Gee, my My SQL table has too many columns."

    I'll bet it does, you nitwit.
  8. MongoDB is so 2003. by EmperorOfCanada · · Score: 4, Informative

    There is exactly a zero percentage chance that I will ever use MongoDB in another project. On the surface it was great. I evangelized my friends about it and the whole NoSQL thing. But as time went by I realized that it wasn't made for people to use. Almost nothing was intuitive. For each new feature that I wanted I had to look up a tutorial and generally found a list of gotchas. If you design your project around MongoDB then it will work. But if you try to wrap MongoDB around your project then you are completely screwed.

    Basically MongoDB halved the initial quarter of data storage design and programming. But as the project progressed the time spent screwing with Mongo went up exponentially until the project was shoved out the door and primary feature in version 2 was the complete removal of MongoDB.

    I could make a mile long list of places the project stumbled. But a few key ones would be that there are no good data management tools for accessing a MongoDB. The second was that huge schema screwups were way too easy. It was very hard for programmers to get a mile high overview of how data being stored was being structured. That is a data layout was easy but putting the results into your head was really hard.

    I am finding other NoSQL approaches are far superior. Things such as use of JSON, memcaches, MariaDB (or the excellent PostgreSQL) working together allows the project to dictate how things function instead of Mongo very quickly shaping the project architecture because of its marked strengths and weaknesses.

    Redis is the environment presently being explored for version 4 and so far it is looking very interesting. But I am not joking when I say that at this point I would use access on windows as my backend datastore before I would use MongoDB.

  9. Normalization by Frankie70 · · Score: 3, Insightful

    The fool thinks the only reason for normalization is to save space.

  10. I can't believe no one mentioned Meteor by Daniel+Hoffmann · · Score: 3, Informative

    Meteor ( https://www.meteor.com/ ) is a javascript framework that runs on top of Nodejs and it is GREAT. It is a full stack solution, it has a view engine (Blaze templating language, based on handlebars), a server (Nodejs) and a database (MongoDB) all bundled up and it just works out of the box, no configuration required. From the meteor website:

    "Really, you'd like to use a combination of packages that have been not just tested individually, but tested together, since so much of the complexity in a large software project comes not from its individual pieces but from how they're integrated. Rather than leaving your package system to select the "best" combination of package versions, which could change every day and could be a totally new combination that nobody else has ever tried, you'd like to use a set of packages that has been comprehensively tested by professional release engineers that really know the platform.

    That's what the Meteor Distribution provides. Similar to a Redhat or Ubuntu distribution, the Meteor Distribution is a set of package versions that have been tested and recommended for use together."

    And that is just one of the great features that Meteor provides. Another great feature of Meteor is that your Javascript code runs both on the server and on the client _at the same time_. Whatever action you make that triggers a state change (change in the database) will run both on the client and on the server, the client has something called MiniMongo that caches the result from the server database and the changes happen without a roundtrip to the server. If the server state is not consistent with the client state Meteor takes care of synchronizing everything. So the application looks like is running locally there is no lag at all.

    This drastically reduce the code necessary for example, you don't write form validation code twice, you write it once and show a popup message on the client and throw an exception on the server if something is wrong. Really everything in Meteor works great, there is a really good automatic deploy system (it even deploys to phonegap, also I believe you can deploy your mobile apps to app stores automatically), the API is really small, the meteor packages work great (check out the Velocity testing framework, it is awesome!) and so on

    There is one big caveat though, you can't migrate parts of your existing application to Meteor, the only real optional part of Meteor is the View layer, you can discard Blaze and run your own solution. I have had a great time using React with Meteor for example.