Slashdot Mirror


Ask Slashdot: Which NoSQL Database For New Project?

DorianGre writes: "I'm working on a new independent project. It involves iPhones and Android phones talking to PHP (Symfony) or Ruby/Rails. Each incoming call will be a data element POST, and I would like to simply write that into the database for later use. I'll need to be able to pull by date or by a number of key fields, as well as do trend reporting over time on the totals of a few fields. I would like to start with a NoSQL solution for scaling, and ideally it would be dead simple if possible. I've been looking at MongoDB, Couchbase, Cassandra/Hadoop and others. What do you recommend? What problems have you run into with the ones you've tried?"

61 of 272 comments (clear)

  1. Do you need a database? by tubs · · Score: 2, Insightful

    Do you need a database to do what you're trying to do? Why not just write the information to a text file (csv or tab seperated?), and use other programs to query the data?

    --

    try to make ends meet, you're a slave to money, then you die

    1. Re:Do you need a database? by Anonymous Coward · · Score: 5, Funny

      Excel Spreadsheet, maybe?

    2. Re:Do you need a database? by mwvdlee · · Score: 5, Insightful

      Basically the question is; what's the expected volume of records and fields per records?

      A solution for 100 records a week with 4 fields each would be different from 1000 records per second with 30 fields each.
      1000 records/sec with 4 fields would be yet another solution.

      --
      Slashdot social media options: AIM, ICQ, Yahoo, Jabber and Mobile Text. Why no MySpace?
    3. Re:Do you need a database? by Richard_at_work · · Score: 3, Interesting

      Theres probably an element of multithreaded access that needs to be taken into consideration here - writing to a single text file may get you into issues if the receiving webserver is multithreaded, meaning the threads will either have to queue for write locks, or write to a different file.

      Database engines don't have this issue, so while it may be overkill, there may be reasons to have one irregardless.

    4. Re:Do you need a database? by FyRE666 · · Score: 5, Insightful

      Please don't do this (use a flat file) to store data for a web app that's likely to be accessed by more than one device at a time. Unless you implement your own file locking mechanism, you'll eventually end up with corrupt entries. Even if you do implement your own locking scheme, it's probably not going to be as efficient as using a DB. It's a 5 minute job to set up a new MySQL DB and associated query to push data in, then you can filter and report on it much more easily. It's something DBs are very good at!

      Unless you have a specific need to scale horizontally, it's generally better to stick with a SQL DB for web apps. I've used MySQL, PostgreSQL and Oracle for this. MySQL is by far the easiest to work with, hence its popularity. I don't actually know of any advantage to using PostgreSQL; it doesn't perform any better, and is (or at least used to be) much less user friendly.

    5. Re:Do you need a database? by DarkOx · · Score: 4, Informative

      I disagree, he is concerned about scaling. The last thing in the world he should do is use a bunch of flat files, unless he really just needs to store the data, but he already said he needs to do reports and totals on it.

      Also he is working in Ruby. The smart thing for him to do IMHO is write his program against ruby/DBI. It isn't the pretty database api, but it supports plenty of different backend options and it does not sound like his program needs especially complex database operations or queries. He can start working with something like SQLite as the database "server", and move up to something else, perhaps Postgress (which can be every bit as fast as the NOSQL solutions unless you are getting highly highly custom) without needing to alter his program.

      --
      Repeal the 17th Amendment TODAY! Also Please Read http://www.gnu.org/philosophy/right-to-read.html
    6. Re:Do you need a database? by Richard_at_work · · Score: 5, Insightful

      I think many people get stuck in thinking "one single database, thats it, my initial decision condemns me forever", when in-fact theres no shame in having many databases.

      Stick the raw data into one database, choose the database that suits that.

      Transform the data from the raw database into something you can use day to day, thats well structured etc, choose the database for that.

      Transform the data from the day to day schemas into something that more suitable for archiving and long term reporting, again choose the database for that.

      You don't have to have one single database type, every particular one has its strengths, so use them!

    7. Re:Do you need a database? by nctritech · · Score: 2

      Create a table, get a POST, Insert contents of POST into table...I don't really see how this isn't the best way to do it.

    8. Re:Do you need a database? by jythie · · Score: 2

      *gasp* a sensible solution using readily available mature tools? *faints*

    9. Re:Do you need a database? by Anonymous Coward · · Score: 2, Informative

      >For storing and querying arbitrarily-structured data, which is what the submitter seems to be wanting
      I dunno. I read TFS and it looks more like he wants rows of tabular data. Were this a STX site, I'd vote to close as too broad since he hasn't actually said anything useful about what he's storing.

      So default answer to "Which NoSQL database should I use?" is always "Don't use NoSQL."

    10. Re:Do you need a database? by DorianGre · · Score: 3, Informative

      We are looking at 99% incoming data, 10-12 fields, 1000-2000 per session per week, X as many users as we can get.

    11. Re:Do you need a database? by boristdog · · Score: 4, Insightful

      As someone who is currently trying to convert a 20 year-old, multi-million-entry flat files DB into a real DB for a major corporation without bringing the corporation to its knees I heartily concur with NOT using flat files if there is ANY chance of this growing beyond a few hundred entries.

      By now hundreds of applications are using the old flat file DB, I have so much re-coding to do that I will probably retire before it is all complete.

    12. Re:Do you need a database? by squiggleslash · · Score: 5, Insightful

      Then perhaps he should use a real database, rather than embrace a fad started by people who don't like databases?

      --
      You are not alone. This is not normal. None of this is normal.
    13. Re:Do you need a database? by NatasRevol · · Score: 2

      So, 10-20 thousand data points, per customer, per week?

      Or, at 100 customers, 50-100 million data points per year?

      Get a real database. And some real horsepower.

      --
      There are two types of people in the world: Those who crave closure
    14. Re:Do you need a database? by tubs · · Score: 2

      When I read the post the first thought that came to me was "log files" - you mention date & time, a "number" of fields and "few" fields for reporting. It still sounds like a log file from everything that is said. Indeed, just change from POST to GET and you can use the web server logs :-)

      But, why not build into the design that you may change the "backend" database without having to worry about what is at the backend?

      --

      try to make ends meet, you're a slave to money, then you die

    15. Re:Do you need a database? by Anonymous Coward · · Score: 2, Informative

      "Irregardless" is not a word, you nigger."

      Merriam-Webster:
      irregardless

      irregardless
      adverb \ir-i-gärd-ls\
      Definition of IRREGARDLESS

      Usage Discussion of IRREGARDLESS
      Irregardless originated in dialectal American speech in the early 20th century. Its fairly widespread use in speech called it to the attention of usage commentators as early as 1927. The most frequently repeated remark about it is that “there is no such word.” There is such a word, however. It is still used primarily in speech, although it can be found from time to time in edited prose. Its reputation has not risen over the years, and it is still a long way from general acceptance. Use regardless instead.

    16. Re:Do you need a database? by funwithBSD · · Score: 4, Funny

      You ain't supposed to use it.

      --
      Never answer an anonymous letter. - Yogi Berra
    17. Re:Do you need a database? by flipperdo · · Score: 2

      The problem with choosing the best database (or technology in general) for each corner of each application is that before long you've got yourself a maintenance/support nightmare. Better to stick with what you know, provided it's sufficient for the job at hand. Only when there's a compelling reason should you bring in something new. For example, there aren't many use cases for which PostgreSQL isn't sufficient...

  2. Use PostgreSQL by Anonymous Coward · · Score: 5, Informative

    If you need to store less than a few hundred million rows just use PostgreSQL.
    It supports JSON and transactions.

    1. Re:Use PostgreSQL by Lennie · · Score: 4, Insightful

      Yes, that is what I would wanted to point out too.

      Also in PostgreSQL 9.4 it has jsonb which is, in certain tests less than a year ago, faster than MongoDB.

      --
      New things are always on the horizon
    2. Re:Use PostgreSQL by Lennie · · Score: 2

      Also if you want a key/value store, there is also http://symas.com/mdb/ from a company of some of the OpenLDAP developers.

      Which really seems to be have the fastest read performance of them all.

      --
      New things are always on the horizon
  3. Sounds like you need a database by Anonymous Coward · · Score: 5, Insightful

    You might want to consider a SQL database.

  4. Please specify a better scenario by prefec2 · · Score: 2

    Based on your information no one can give you solid advice. It highly depends on the load you expect and on the data model you will use. for a simple twitter, you can use a log file, or any NoSQL technology. If you only have a few transactions and not billions of entries, you could use PostgreSQL or even MySQL. However, PostgreSQL scales better. If you want to make complex interpretations on graph like data you may consider Neo4J as a graph DB.

    1. Re:Please specify a better scenario by OzPeter · · Score: 4, Insightful

      Based on your information no one can give you solid advice.

      IMHO the question is deliberately designed to be vague. iPhones and Android devices, PHP and Ruby On Rails .. that is such a shotgun blast of specifications that are totally unrelated to the DB use on the back end that the entire question smells of click bait to me.

      --
      I am Slashdot. Are you Slashdot as well?
    2. Re:Please specify a better scenario by khchung · · Score: 5, Insightful

      Based on your information no one can give you solid advice.

      IMHO the question is deliberately designed to be vague. iPhones and Android devices, PHP and Ruby On Rails .. that is such a shotgun blast of specifications that are totally unrelated to the DB use on the back end that the entire question smells of click bait to me.

      Either that, or the OP simply have no idea how databases work at all.

      If OP has any idea how database (any database, not just relational) works, he would be talking about data and transaction volumes, access patterns, transactional requirements, data integrity constraints, retention and housekeeping requirements, etc.

      Instead, as you said, he talked about devices platforms, communication protocols, language and runtime environment which are all irrelevant to choosing database. (ok, the last may be a bit relevant depending on which database used)

      --
      Oliver.
  5. NoSQL? by aaaaaaargh! · · Score: 5, Insightful

    I would like to start with a NoSQL solution for scaling

    And there it is, the proverbial premature optimization ...

    1. Re:NoSQL? by mwvdlee · · Score: 2

      Being able to scale from 1 billion records a day to 10 billion a day does not a premature optimization make.

      The simple fact is that there's not enough information to give any reasonable advise.

      --
      Slashdot social media options: AIM, ICQ, Yahoo, Jabber and Mobile Text. Why no MySpace?
    2. Re:NoSQL? by gnoshi · · Score: 4, Funny

      Shards! It has shards!

    3. Re:NoSQL? by Sarten-X · · Score: 5, Insightful

      As an expert (relative to most of Slashdot) in NoSQL databases, with a significant amount of experience in Hadoop and HBase systems, I agree wholeheartedly.

      NoSQL solutions can be ridiculously fast and scale beautifully over billions of rows. Under a billion rows, though, and they're just different from normal databases in various arguably-broken ways. By the time you need a NoSQL database, you'll be successful enough to have a well-organized team to manage the transition to a different backend. For a new project, use a RDBMS, and enjoy the ample documentation and resources available.

      --
      You do not have a moral or legal right to do absolutely anything you want.
    4. Re:NoSQL? by VortexCortex · · Score: 3, Funny

      Shards! It has shards!

      Heal The Dark Crystal, Gelfling!

      Only then can the two be made one!

    5. Re:NoSQL? by Anonymous Coward · · Score: 2, Insightful

      As an expert (relative to most of Slashdot) in NoSQL databases, with a significant amount of experience in Hadoop and HBase systems, I agree wholeheartedly.

      NoSQL solutions can be ridiculously fast and scale beautifully over billions of rows. Under a billion rows, though, and they're just different from normal databases in various arguably-broken ways. By the time you need a NoSQL database, you'll be successful enough to have a well-organized team to manage the transition to a different backend. For a new project, use a RDBMS, and enjoy the ample documentation and resources available.

      Agreed. I used a NoSQL database on a project I'm working on at the moment, and stick by that decision even though I don't even have millions of row, but my situation is somewhat different to the OP's: my data model is very difficult to map to SQL (I have hundreds of different entity types, each of which has different field storage requirements, and need to be able to associate between entities of different types according to a variety of rules, meaning that some entity types may have hundreds of different types of entity associated with them; SQL quite simply sucks for this kind of data, but thankfully applications where you end up with this kind of data are few and far between). OP's data sounds like an ideal candidate for storage in a relational database; he has one basic entity type, no need to make any kind of connection between entities, and apparently no complicating factors at all.

    6. Re:NoSQL? by Sarten-X · · Score: 4, Interesting

      "Why not" is because the cost/benefit analysis is not in NoSQL's favor. NoSQL's downsides are a steeper learning curve (to do it right), fewer support tools, and a more specialized skill set. Its primary benefits don't apply to you. You don't need ridiculously fast writes, you don't need schema flexibility, and you don't need to run complex queries on previously-unknown keys. Rather, you have input rates limited by an external connection, only a few entity types, and you know your query keys ahead of time.

      --
      You do not have a moral or legal right to do absolutely anything you want.
  6. MongoDB by timkofu · · Score: 2

    These guys are committed, meaning mongo has a future. 2.6 that came out the other day has some nice new features and many bug fixes.

  7. light by invictusvoyd · · Score: 3, Insightful

    SQLite is a relational database management system contained in a C programming library. In contrast to other database management systems, SQLite is not a separate process that is accessed from the client application, but an integral part of it.

  8. Database Scaleability. by tonywestonuk · · Score: 5, Insightful

    "I'll need to be able to pull by date or by a number of key fields"

    So, in other words, you have already decided on key fields. If you use a database, this has things call index's, that can search billions of rows for a key field in a fraction of a second.
    If you don't use something with INDEX's then you can't do this.

    Where has this idea that Databases can't scale come from? - The world runs on Database for heaven sake. Do you think when you take money out of an ATM, its going to MONGODB? - And yet there are millions of ATM's and you can take money out of your VISA account in almost all of them anywhere in the world. That is called scale.

    1. Re:Database Scaleability. by cyber-vandal · · Score: 4, Insightful

      Where has this idea that Databases can't scale come from?

      Salesmen

    2. Re:Database Scaleability. by Raumkraut · · Score: 3, Informative

      MongoDB has indexes.
      MongoDB also lets you store and query arbitrary data, in addition to any "key fields", without having to pre-define all the possible fields. Which it seems is what the submitter asked for.

      Where has this idea that "NoSQL" means "not a database" come from?

    3. Re:Database Scaleability. by janoc · · Score: 5, Insightful

      Databases don't scale for people who don't understand SQL, don't understand data normalization, indexing and want to use them as flat files. Unfortunately, a way too common anti-pattern :(

      The second group are too-cool-to-learn kids using the latest development tool fad on the market to build yet another Facebook/Twitter/Instagram/whatever clone ...

    4. Re:Database Scaleability. by mbourgon · · Score: 2

      And Developers. Anything to keep those damn DBAs away.

      (Yes, I'm a DBA)

      --
      "Sometimes a woman is a kind of religion, she can save your soul & set you free from all your sins" - Bad Examples
    5. Re:Database Scaleability. by Bacon+Bits · · Score: 4, Insightful

      God forbid someone make them think about their data structures and how the end user might need to query them with their own reports.

      --
      The road to tyranny has always been paved with claims of necessity.
    6. Re:Database Scaleability. by Kjella · · Score: 2

      Where has this idea that Databases can't scale come from? - The world runs on Database for heaven sake. Do you think when you take money out of an ATM, its going to MONGODB? - And yet there are millions of ATM's and you can take money out of your VISA account in almost all of them anywhere in the world. That is called scale.

      Of course you can with lots of money in hardware and software and top notch database administrators, architects and query designers but it's a lot of hard work and expensive. The sales pitch for NoSQL is that it's built for horizontal scale-out by design, just throw more servers at it - mainstream servers, not the extremely expensive high-end servers and it'll scale almost indefinitely without having to rework everything. There's a lot of people in the "when we go viral we must be ready for it" category, with highly variable degrees of realism. And social media has been the big buzzword lately where social media feeds of various forms are almost ideal for NoSQL, nobody cares if the feed is perfectly consistent or updated with the last two seconds of posts from your friends. To the tech-unsavvy, "They did that why can't we?"

      --
      Live today, because you never know what tomorrow brings
  9. MariaDB by Anonymous Coward · · Score: 2, Insightful

    I would consider using the latest release of MariaDB.

    You can use it as a standard MySQL server, but they also have Cassandra NoSQL as an engine for it now (since the release of 10)... So you would be easily able to play with things on different database types and see what suits your situation better.

  10. Short Intro by emblemparade · · Score: 5, Informative

    It's a mistake to think that "NoSQL" is a silver bullet for scalability. You can scale just fine using MySQL (FlockDB) or Postresgl if you know what you're doing. On the other, if you don't know what you're doing, NoSQL may create problems where you didn't have them.

    An important advantage of NoSQL (which has its costs) is that it's schema-free. This can allow for more rapid iteration in your development cycle. It pays off to plan document structures carefully, but if you need to make changes at some point (or just want to experiment), you can handle it at the code level. You can also support older "schemas" if you plan accordingly: for example, adding a version tag or something similar that can tell your code how to handle it. So, even ignoring the dubious potential of better scalability, NoSQL can still be beneficial for your project.

    More so than SQL, NoSQL database are designed for different kinds of applications, and have different strengths:

    MongoDB is a really good backend engine that gives programmers lot of control over performance and its costs: if you need faster writes, you can allow for eventual integrity, or if you need faster reads, you can allow for data not being the absolute freshest. For many massive multiuser applications, not having immediately up-to-date data is a reasonable compromise. It also offers an excellent set of atomic operations, which from my experience compensate well for the lack of transactions. Furthermore, MongoDB is by far the most feature-rich of these, supporting aggregate queries and map-reduce, which again can make up for the lack of joins. It also offers good sharding tools, so if you do need to scale, you can. Again, I'll emphasize that you need a good understanding of how MongoDB works in order to properly scale. For example, map-reduce locks the database, so you don't want to rely on it too much. The bottom line is that MongoDB can offer similar features to SQL databases (though they work very differently), so it's good for first-timers.

    Couchbase is very good at dispersed synchronization. For example, if parts of your database live in your clients (mobile applications come to mind), it does a terrific job at resynching itself and handling divergences. This is also "scalable," but in a quite different meaning of the term than in MongoDB.

    I would also take a look at OrientDB: it's not quite as feature rich as MongoDB (and has no atomic operations), but it can work in schema-mode, and generally offers a great set of tools that can make it easy to migrate from SQL. It's query language, for example, looks a lot like SQL.

    The above are all "document-oriented" databases, where you data is not opaque: the database actually does understand how your data is structured, and can allow for deep indexing and updating of your documents. Cassandra and REDIS (and Tokyo Cabinet, and BerkeleyDB) are key-value stores: much simpler databases offering fewer querying features: your data is simply a blob as far the engine is concerned. I would be less inclined to recommend them unless your use case is very specific. Where appropriate, of course simpler is better. With these kinds of databases, there are actually very few ways in which you can create an obstacle for scalability: simply because they don't do very much, from a programming perspective.

    There are also in-between databases that are sometimes called "column-oriented": Google and Amazon's hosted big data services are both of this type. Your data is structured, but the structure is flat. Generally, I would prefer full-blown "document-oriented" databases, such as MongoDB and OrientDB. However, if you're using a hosted service, you might not have a choice.

    It's also entirely possible to mix different kinds of databases. For example, use MongoDB for your complex data and use REDIS for a simple data store. I've even seen sophisticated deployments that very smartly archive data from one DB to another, and migrate it back again when necessary.

    1. Re:Short Intro by mrpoundsign7072 · · Score: 3, Insightful

      And any text file can be transnational if you write your code right. We can keep going down this road about how you don't /need/ X technology, but nobody wins. It's really OK to see the good in different technologies.

  11. Just Use SQL by Anonymous Coward · · Score: 5, Insightful

    I just felt I have to comment on this. So many developers start with the phrase "I need NoSQL so I can scale" and almost all of them are wrong. The chances are your project will never ever ever scale to the kind of size where the NoSQL design decision will win. Its far more likely that NoSQL design choice will cause far more problems (performance etc), than the theoretical scaling issues.

    Take for example two systems I've been involved with for managing WiFi access to large scale networks (100,000+ concurrent users, 1000's of APs), one uses MongoDB the other based on PostgresSql. The MongoDB based solution has very real performance problems, its reporting takes a very long time to run taking very large amounts of system ram (24G in some cases) and that performance is only degrading as the system grows, there are also many other performance issue. These issues are not just mongo issues but simply that NoSQL is not well suited to the task. The system has been rewritten using an SQL backend and now works much better but importantly it's scaling but better. Growth in the system is no-longer degrading performance and the point where we need hardware upgrades or extra servers etc are now much more predictable so we can predict cost base growth in relation to user growth.

    NoSQL does not guarantee scaling, in many cases it scales worse than an SQL based solution. Workout what your scaling problems will be for your proposed application and workout when they will become a problem and will you ever reach that scale. Being on a bandwagon can be fun, but you would be in a better place if you really think through any potential scaling issues. NoSQL might be the right choice but in many places I've seen it in use it was the wrong choice, and it was chosen base on one developers faith that NoSQL scales better rather than think through the scaling issues.

  12. Big mistake by msobkow · · Score: 5, Insightful

    Telecommunications data is eminently suitable to schema table storage in any relational database, which with a little work, will let you index by the keys you intend to query by.

    NoSQL solutions are better for unstructured data that doesn't come in predictable formats or value sets.

    You need to take a step back and look at the problem before you decide on a solution. Don't be one of those idiots who tries to use a hammer to drive a screw.

    --
    I do not fail; I succeed at finding out what does not work.
  13. Re:S3 better than files on disk by xelah · · Score: 2

    Now scale that. Or just lock it properly.

    If you want simple, scalable and low sysadmin overhead and all you need are key -> value lookups then Amazon's S3 can be an excellent choice. You don't need to manage it, you don't need to work out how to add servers and its well proven at extremely large scales.

    However, like a lot of other posters, I'm very sceptical that NoSQL is the place to start. SQL databases can do a LOT for you, are very robust and can scale very considerably. As your requirements grow you might find yourself wanting things like indexes, transactions, referential integrity, the ability to manually inspect and edit data using SQL and the ability to store and access more complex structures. You're likely to give yourself a lot of pain if you go straight for NoSQL, and even if you DO need to scale later combining existing SQL and new NoSQL data stores can be a useful way to go.

  14. Which luxury yacht after my new project? by BlackPignouf · · Score: 5, Funny

    "I'm working on a new independent project. It will soon become the new Facebook, and I'll be billionaire next quarter. The only problem is that I don't know which luxury yacht to buy with all this money. I've been looking at Lady Moura, Christina O, Pelorus, Venus and others. What do you recommend? What problems have you run into with the ones you've tried?"

    1. Re:Which luxury yacht after my new project? by coofercat · · Score: 5, Funny

      Pff! All that soon-to-have money and yet no imagination, huh? Buy an old diesel Navy submarine and have it refitted. Maybe cut some windows into the hull - that'll mean you can only go down to maybe 50 metres instead of 350, but that's still plenty, and if you get lost you can just look out of the windows to see where you are without having to worry about using sonar.

      I'd imagine surfacing your submarine in Monaco's marina will turn far more heads than your ridiculous yacht moored a mile offshore ;-) (besides, a submarine is phallically shaped, so works better in metaphorical dick measuring competitions)

      Oh, and be sure to use Postgres or MySQL for your on-board systems - it'll scale plenty well for a long time before you need to go all 'web scale' with a NoSQL DB.

  15. Two words by ledow · · Score: 2

    Premature Optimisation.

  16. Re:CouchBase by grcumb · · Score: 2

    CouchBase/CouchDB is probably the easiest and most available one out there. It's particularly well suited for app backends too, as both the backend and mobile apps can talk to the same database, in theory eliminating the need for the backend to handle data syncing.

    Those are good reasons, and it's also true that CouchDB will use a lot less resource overhead than a full-bore RDBMS under load. Depending on the use case, it might also prove decidedly easier to scale.

    But the place where NoSQL really shines is storing amorphous or heterogeneous data. Because you have no constraints about what goes into a given record, you can record more or less name/value pairs at your whim. As with Perl, though, freedom comes at the cost of potential disorder.

    But honestly, with the tiny amount of detail provided, it seems like it's really six of one and half a dozen of the other. If it's just call data being recorded, and the same call data every time, it won't make a huge difference if you use a full-blown RDBMS or a NoSQL database. Either one has its costs (individual PUTs and POSTs in CouchDB for example, can be expensive, whereas queuing and write contention might cause headaches at extreme scales in PostGres or Oracle).

    Both an RDBMS and a NoSQL database will deal with replication fairly well, though my personal inclination is to prefer the simplicity of replication in CouchDB right up until the noise level gets out of hand.

    --
    Crumb's Corollary: Never bring a knife to a bun fight.
  17. Re:2 comments, both useless by Anonymous Coward · · Score: 2, Informative

    NoSQL is a good solution for horizontal scaling, CSV and SQL DB are not.

    I'd like to dispute this. Based on the OP's description of his application, two things come to mind:


    •    
    • His application is mostly-write-only. He probably does not need instant query ability, but may need to be able to handle a very large number of inserts per second (assuming he's justified in his assertion that he needs scalability). For this kind of application, logging your incoming data to a plain text file (or sequentially-appended binary data file, or any other write-only plain file approach) can be a significant performance improvement. This files can then periodically (e.g. every hour, every minute, whatever time frame suits) be pulled of local storage, merged, and inserted into a central database as a batch from which read queries are performed. Single batched updates are much more efficient than large numbers of small updates.
    •    

    • His queries are easily parallelized. He needs to perform only two operations: selecting data based on simple criteria, simple numerical summarization. Both of these are trivially scaled horizontally by using systems with local SQL databases and a simple service running on the machines as nodes in a map/reduce architecture.

    Blanket statements like yours above can't really be made without reference to the intended application, as some applications scale much more easily than others, and OP's sounds like it's one of the easy kind.

  18. HBase by scorp1us · · Score: 2

    First. everyone who is pointing out your premature optimization is probably right. You can get a lot of scalability out of existing databases, particularly if you optimize your data schema with indexes. Even if you store all possible 9,999,999,999 phone numbers, the log base-2 of that is 34. So you'll need a b-tree 34 levels deep. That's big, real big, but b-trees are fast. Worst case you are reading 34 blocks from disk, which is ~16kB.

    Next, don't choose databases by name. Choose them by their features because you use features, not names. That said, HBase is probably what you want. It's a blend of distributable hadoop and tables. You don't need atomicity (it doesn't sound like) which is one thing you give up when leaving SQL behind.

    --
    Slashdot's rate-of-post filter: Preventing you from posting too many great ideas at once.
  19. Perhaps you should abstract your persistence model by Assmasher · · Score: 2

    ...so that you simply write an adapter for pushing/pulling data.

    Then you don't have to worry so much about making what appears to be an extremely premature optimization.

    In other words, have your backend web services (presuming you're using them and not manually POSTing from a socket yourself to your own socket server) instantiate an instance of iMyDBAdapter and use it.

    Later, when you find out that you actually do need MongoDB, PostgreSQL, sharded MariaDB, whatever, you can simply write another adapter class that simply has to satisfy the iMyDBAdapter interface.

    The reason this works so well is that it will force you to separate your business logic from your underlying DB implementation (which requires a lot of discipline to do otherwise, especially when you just want to get something 'done'.)

    Also, as another poster pointed out, you're much more likely to suffer from other issues relating to scaling (and issues better solved elsewhere) than a modern database.

    My advice, stick rigidly to the interface/adapter mechanism and implement an adapter for whichever DB you're most comfortable with right now.

    --
    Loading...
  20. Solution looking for a problem by luis_a_espinal · · Score: 5, Insightful

    I would like to start with a NoSQL solution for scaling,

    This is a solution looking for a problem. Or more precisely, you are looking for an excuse to use a piece of technology or paradigm. Don't get me wrong, your systems requirements might indeed be best served using a NoSQL solution, but what exactly has your analysis shown regarding this?

    Scaling is not just a technical feature (NoSQL, SQL, Jedi mind-meld tricks). Scaling is a function of your architecture. You can NoSQL the shit out of your solution, but if your software and system architecture is not scalable, then having NoSQL will mean chicken poop as solutions go.

    and ideally it would be dead simple if possible.

    If you want simple, put a simple RDBMs schema (a properly normalized that) in place, and have your code use a simple, technology-agnostic persistence layer that maps your domain-level artifacts to database artifacts. If you ever had to replace the back-end, then you can do so with minimal changes to the API that domain-level artifacts use to persist themselves with the persistence layer.

    Design your domain solution around domain-specific artifacts. Persistence technology is typically a low-level design/implementation detail, an important one obviously (and a critical one for some classes of systems).

    But for what you are describing, the choice shouldn't even be coming into the picture without first having an architectural notion of your solution.

  21. If you have to ask ... by ehiris · · Score: 2

    It means you don't have any big data requirements so you're better off sticking with MySQL or something easier to manage at a small scale.
    If growth is high or you have a lot of data to analyze, you can look into importing data into Hadoop using sqoop and query it with Hive and HBase. But you most likely won't need that for at least a couple of years.

  22. Make it fast, don't marry first... by NotesSensei · · Score: 2

    and get to know it later :-). Fast here: your prototype creation, not primary the database I/O. The general comments are right: there is no one-fits-all solution and the database might change. It looks very much like you also haven't decided on the server platform: Ruby, PHP... you could look at node.js or vert.x too - server side JavaScript is at least neat for prototyping (I'm not making a statement that is is *only* neat for prototyping - that's a completely different discussion). We did a number of super rapid prototypes with datasets roughly in the range you describe using CouchDB (not CouchBase!). There we took advantage of CouchApps - the ability to store the application itself inside the database - works like a charm when replicating data and you need a http server (Apache, NGix) for the URL mapping (which is already kind of optional) and CouchDB. You can authenticate with OAuth or via the Webserver and it replicates - so you can have local data easily (gold for testing). Since you can specify the direction I usually replicate all data from the server into local, but not the design. So I can try new app features local against the live dataset. It also does Map-Reduce using JavaScript. Give it a shot. If it can handle the data from CERN you also have quite a growth path. One fun project we did: run it on a Rasberry Pi to collect weather data from Arduinos all mounted in a small sail boat (the Pi in the cabin, the Arduinos on the masts). Occasionally when the Wifi or 3G shield picks up a network, it replicated back to a cloud server.

  23. MongoDB by GameMaster · · Score: 2

    Use MongoDB, it's web-scale. They produce kick-ass benchmarks by piping all your data to /dev/null.

    --

    Rules of Conduct:
    #1 - The DM is always right.
    #2 - If the DM is wrong, see rule #1
  24. Can you separate data collection from reporting? by Anonymous Coward · · Score: 2, Interesting

    If the goal really is just to amass data and then do offline reports on it (not completely clear from the question) then I can report that at my company we've been doing this at scale for over five years. Here's how:

    * A bunch of web servers accept data and append it to a local disk file.
    * Every hour, that "log" is pushed from each host into HDFS and a new log file started. (HDFS as in the Hadoop Distributed Filesystem)
    * Querying is done later, using Hive with a custom deserializer that natively understands our on-disk format. (You could also just make sure your on disk-format is the delimited text format Hive natively understands, of course. We had some unique needs here.)
    * An hourly task runs a small set of Hive aggregation queries (Hive presents a SQL-like interface to defining and running MapReduce jobs) on the raw "table" to produce some smaller datasets that can return aggregate-based results faster than the raw data, including copying some of the smaller aggregates into a MySQL database for online access via some reporting applications.

    At this point our daily dataset is a few terabytes in size, when considering the sum of all of the collecting servers across all of the hours. (There are some peak hours due to the nature of our business, so the volume isn't even across the whole day.)

    The only thing we've ever disliked about this system is the delay between data arriving and it being available to query. For a little while experimented with using Apache Storm to with realtime log streaming, and produced a working prototype that was shown to work for a one-tenth sample of the data, but ultimately we concluded that the need for faster data wasn't strong enough to justify the additional complexity and stuck with the above design. Therefore I can't speak to how far that solution would scale, but if real-time analysis isn't a requirement -- and scaling up in data size is -- then I can certainly recommend the above design.

  25. If your only tool is a (NoSQL) hammer... by akubot · · Score: 2

    ... then everything looks like a (NoSQL) nail. Who says you need NoSQL? Nothing against using cool, newish stuff, but as others have pointed out, you didn't describe the scale of your project. Don't blindly pick trendy technology just because you want to sit with the cool kids at lunchtime. If this is an alpha or beta product with under 1 billion records, use a regular database and be done with that. Move onto the interesting parts of your project and fix the plumbing later if you need to.

  26. Depends on the situation by samwhite_y · · Score: 2

    I have used Oracle, MySQL, and Mongo in prod situations. I have looked at Cassandra for evaluating it for potential usage in prod.

    I can imagine situations where I could recommend any of the above. For example, if you are large financial company with billions of rows, I would go with Oracle. If you have smarts but not money and didn't need somebody to sue if something went wrong, then maybe Postgres would do . If I were a simple web based app with simple form submits, I would go with MySQL. If I had complex unpredictable data blobs and unpredictable needs to do certain types of queries against the data, I might recommend Mongo. If I have large amounts of data on which I want to do analytics I would use Cassandra.

    Cassandra wins when you have a lot of data and not a lot of complex real time queries against it. It is especially good at scaling up on cheap data storage (think 100s of terabytes). It also has an unreal "write" throughput (important for certain types of analytics which write out complex intermediate results) though that is not relevant for the case described.

    The problem generally with noSql solutions is that they increase the amount of storage to store the equivalent amount of information. You are essentially redundantly storing schema design with each "record" that you store. This really matters more than some might suspect, because when you can put an entire collection into memory, the read performance is much higher. You usually need 1/5th to 1/10th as much RAM to do the job with a traditional relational database (especially since MySQL and their brethren handle getting in and out memory better than mongo). This isn't so much the case for Cassandra because of its distributed storage nature, but it really isn't usable for real time transactions.

    My recommendation, use a traditional database -- if in a Microsoft shop use SQL Server, otherwise I like postgres or mysql. If however, you have complex data storage needs that a noSql solution is perfect for, then I would go with that. If you are into back end analytics, copy the data as it comes in and put into a Cassandra (or one of its similar brethren) as well.