Web
Article

SQL vs NoSQL: How to Choose

By Craig Buckler

SQL vs NoSQL

In the previous article we discussed the primary differences between SQL and NoSQL databases. In this follow-up, we’ll apply our knowledge to specific scenarios and determine the best option.

To recap:

SQL databases:

  • store related data in tables
  • require a schema which defines tables prior to use
  • encourage normalization to reduce data redundancy
  • support table JOINs to retrieve related data from multiple tables in a single command
  • implement data integrity rules
  • provide transactions to guarantee two or more updates succeed or fail as an atomic unit
  • can be scaled (with some effort)
  • use a powerful declarative language for querying
  • offer plenty of support, expertise and tools.

NoSQL databases:

  • store related data in JSON-like, name-value documents
  • can store data without specifying a schema
  • must usually be denormalized so information about an item is contained in a single document
  • should not require JOINs (presuming denormalized documents are used)
  • permit any data to be saved anywhere at anytime without verification
  • guarantee updates to a single document — but not multiple documents
  • provide excellent performance and scalability
  • use JSON data objects for querying
  • are a newer, exciting technology.

SQL databases are ideal for projects where requirements can be determined and robust data integrity is essential. NoSQL databases are ideal for unrelated, indeterminate or evolving data requirements where speed and scalability are more important. In simpler terms:

  • SQL is digital. It works best for clearly defined, discrete items with exact specifications. Typical use cases are online stores and banking systems.
  • NoSQL is analog. It works best for organic data with fluid requirements. Typical use cases are social networks, customer management and web analytics systems.

Few projects will be an exact fit. Either option could be viable if you have shallower or naturally denormalized data. But please be aware these simplified example scenarios with sweeping generalizations! You know more about your project than I do, and I wouldn’t recommend switching from SQL to NoSQL or vice versa unless it offers considerable benefits. It’s your choice. Consider the pros and cons at the start of your project and you can’t go wrong.

Scenario One: a Contact List

Let’s re-invent the wheel and implement an SQL-based address book system. Our initial naive contact table is defined with the following fields:

  • id
  • title
  • firstname
  • lastname
  • gender
  • telephone
  • email
  • address1
  • address2
  • address3
  • city
  • region
  • zipcode
  • country

Problem one: few people have a single telephone number. We probably need at least three for land-line, mobile and workplace, but it doesn’t matter how many we allocate — someone, somewhere will want more. Let’s create a separate telephone table so contacts can have as many as they like. This also normalizes our data — we don’t need a NULL for contacts without a number:

  • contact_id
  • name (text such as land-line, work mobile, etc.)
  • number

Problem two: we have the same issue with email addresses, so let’s create a similar email table:

  • contact_id
  • name (text such as home email, work email, etc.)
  • address

Problem three: we may not wish to enter a (geographic) address, or we may want to enter multiple addresses for work, home, holiday homes, etc. We therefore need a new address table:

  • contact_id
  • name (text such as home, office, etc.)
  • address1
  • address2
  • address3
  • city
  • region
  • zipcode
  • country

Our original contact table has been reduced to:

  • id
  • title
  • firstname
  • lastname
  • gender

Great — we have a normalized database which can store any number of telephone numbers, email addresses and addresses for any contact. Unfortunately …

The schema is rigid
We’ve not considered the contact’s middle name(s), date of birth, company or job role. It doesn’t matter how many fields we add, we’ll soon receive update requests for notes, anniversaries, relationship statuses, social media accounts, inside leg measurements, favorite type of cheese etc. It’s impossible to foresee every option, so we’d possibly create an otherdata table with name-value pairs to cope.

The data is fragmented
It’s not easy to for developers or system administrators to examine the database. The program logic will also become slower and more complex, because it’s not practical to retrieve a contact’s data in a single SELECT statement with multiple JOIN clauses. (You could, but the result would contain every combination of telephone, email and address: if someone had three telephone numbers, five emails and two addresses, the SQL query would generate thirty results.)

Finally, full-text search is difficult. If someone enters the string “SitePoint”, we must check all four tables to see if it’s part of a contact name, telephone, email or address and rank the result accordingly. If you’ve ever used WordPress’s search, you’ll understand how frustrating that can be.

The NoSQL Alternative

Our contact data concerns people. They are unpredictable and have differing requirements at different times. The contact list would benefit from using a NoSQL database, which stores all data about an individual in a single document in the contacts collection:

{
  name: [
    "Billy", "Bob", "Jones"
  ],
  company: "Fake Goods Corp",
  jobtitle: "Vice President of Data Management",
  telephone: {
    home: "0123456789",
    mobile: "9876543210",
    work: "2244668800"
  },
  email: {
    personal: "bob@myhomeemail.net",
    work: "bob@myworkemail.com"
  },
  address: {
    home: {
      line1: "10 Non-Existent Street",
      city: "Nowhere",
      country: "Australia"
    }
  },
  birthdate: ISODate("1980-01-01T00:00:00.000Z"),
  twitter: '@bobsfakeaccount',
  note: "Don't trust this guy",
  weight: "200lb",
  photo: "52e86ad749e0b817d25c8892.jpg"
}

In this example, we haven’t stored the contact’s title or gender, and we’ve added data which need not apply to anyone else. It doesn’t matter — our NoSQL database won’t mind, and we can add or remove fields at will.

Because the contact’s data is contained in a single document, we can retrieve some or all information using a single query. A full-text search is also simpler; in MongoDB we can define an index on all contact text fields using:

db.contact.createIndex({ "$**": "text" });

then perform a full-text search using:

db.contact.find({
  $text: { $search: "something" }
});

Scenario Two: a Social Network

A social network may use similar contact data stores, but it expands on the feature set with options such as relationship links, status updates, messaging and “likes”. These facilities may be implemented and be dropped in response to user demand — it’s impossible to predict how they will evolve.

In addition:

  • Most data updates have a single point of origin: the user. It’s unlikely we’ll need to update two or more records at any one time, so transaction-like functionality is not required.
  • Despite what some users may think, a failed status update is unlikely to cause a global meltdown or financial loss. The application’s interface and performance take a higher priority than robust data integrity.

NoSQL appears to be a good fit. The database allows us to quickly implement features storing different types of data. For example, all the user’s dated status updates could be placed in a single document in the status collection:

{
  user_id: ObjectID("65f82bda42e7b8c76f5c1969"),
  update: [
    {
      date: ISODate("2015-09-18T10:02:47.620Z"),
      text: "feeling more positive today"
    },
    {
      date: ISODate("2015-09-17T13:14:20.789Z"),
      text: "spending far too much time here"
    }
    {
      date: ISODate("2015-09-17T12:33:02.132Z"),
      text: "considering my life choices"
    }
  ]
}

While this document could become long, we can fetch a subset of the array, such as the most recent update. The whole status history for every user can also be searched quickly.

Now presume we wanted to introduce an emoticon choice when posting an update. This would be a matter of adding a graphic reference to new entries in the update array. Unlike an SQL store, there’s no need to set previous message emoticons to NULL — our program logic can show a default or no image if an emoticon isn’t set.

Scenario Three: a Warehouse Management System

Consider a system which monitors warehoused goods. We need to record:

  • products arriving at the warehouse and being allocated to a specific location/bay
  • movements of goods within the warehouse, e.g. rearranging stock so the same products are in adjacent locations
  • orders and the subsequent removal of products from the warehouse for delivery.

Our data requirements:

  1. Generic product information such as box quantities, dimensions and color can be stored, but it’s discrete data we can identify and apply to anything. We’re unlikely to be concerned with specifics, such as laptop processor speed or estimated smartphone battery life.
  2. It’s imperative to minimize mistakes. We can’t have products disappearing or being moved to a location where different products are already being stored.
  3. In its simplest form, we’re recording the transfer of items from one physical area to another — or removing from location A and placing in location B. That’s two updates for the same action.

We need a robust store with enforced data integrity and transaction support. Only an SQL database will (currently) satisfy those requirements.

Expose Yourself!

I hope these scenarios help, but every project is different and, ultimately, you need to make your own decision. (Although, we developers are adept at justifying our technological choices, regardless of how good they are!)

The best advice: expose yourself to as many technologies as possible. That knowledge will allow you to make a reasoned and emotionally impartial judgment regarding SQL or NoSQL. Best of luck.

More:
  • http://careersreport.com carolmorale

    Allow me to show you a excellent ways to earn a lot of extra !money by finishing basic tasks from your house for few short hours a day — See more info by visiting >MY___|DISQUS|___ID|

  • Ilya Geller

    Both SQL and NoSQL are obsolete and should not be used!

    SQL, Structured Query Language deals with queries only, searching for information into data. However, the queries have nothing to do with data itself, they stay aside, absolutely separately form the data.

    Indeed, what the query ‘does eternal love exist?’ means for a database of Pentagon on logistic at Middle East? But SQL and NoSQL use that query, they don’t see that the data is about ‘Pentagon on logistic at Middle East’ and not on ‘platonic love’.
    NoSQL adds to the queries some extra information, which NoSQL finds at, for instance, personal profiles using n-grams parsing. The n-grams are the barbaric handling of data: a big percentage of data is lost – what NoSQL can get from the crippled data if it’s parsed without Grammatical rules?

    I, however, discovered and patented how to structure any data without SQL, the queries – INTERNALLY: Language has its own INTERNAL parsing, indexing and statistics and can be structured INTERNALLY. (For more details please browse on my name ‘Ilya Geller’.)
    For instance, there are two sentences:
    a) ‘Pickwick!’
    b) ‘That, with the view just mentioned, this Association has taken into its serious consideration a proposal, emanating from the aforesaid, Samuel Pickwick, Esq., G.C.M.P.C., and three other Pickwickians hereinafter named, for forming a new branch of United Pickwickians, under the title of The Corresponding Society of the Pickwick Club.’
    Evidently, that the ‘ Pickwick’ has different importance into both sentences, in regard to extra information in both. This distinction is reflected as the phrases, which contain ‘Pickwick’, weights: the first has 1, the second – 0.11; the greater weight signifies stronger emotional ‘acuteness’; where the weight refers to the frequency that a phrase occurs in relation to other phrases.

    SQL and NoSQL do not see and cannot produce the above statistics! They are obsolete, no good and should be abandoned at once!

    To get that statistics my technology uses Grammatical parsing – I parse data by clauses – which provides me with 100% of data patterns.
    I also index by common dictionary and annotate by subtexts: I created the first ever truly automatic relational database.

    Please forget immediately about SQL an NoSQL?

    • boen_robot

      What do you call this new DB paradigm? Semantical database (not to be confused with “semantic web data”)? Lexical database? Linguistic database? Could you possibly at least tell us the name of your DB system, so that we could Google *it* instead of you?
      On a related note, Googling you shows me your social network profiles, from which there either isn’t a link to your system, or there was one link for a dead site…

      • Ilya Geller

        Good question… I don’t know… how to call it. Have no idea.
        I don’t like to reactivate my site – I have no Patent database as the proof. What sense does it make to show something without the proof? So far I have only patents and NIST TREC QA 2003.
        All details on the technology are at my IBM blog. If you have money – you can make it yourself, I explained almost everything.
        I recommend NIST TREC QA AQUANTANT collection or US PTO database: use my business plan, I explained in details what to do.

        • boen_robot

          Wait, so you don’t have any proof-of-concept half-working pre-alpha prototype implementation?!? Well then… I was hoping to first get familiar with the paradigm before turning around and saying “SQL/NoSQL is not obsolete because < scenarios where SQL/NoSQL is better suited than your paradigm >”, but now… Yeah, SQL and NoSQL are definitely not “obsolete” yet, if there’s no actual implementation to replace the SQL and NoSQL ones.

          Plus… You’re not making it easy to find details on your system (which I’m still unable to… please give one link – I’m sure SitePoint/Disqus won’t immediately assume it’s spam). Even if I did had money to spend on a software patent (which in all honesty, I don’t), I wouldn’t invest in “vaporware” of a completely different and unproven nature, unless I was convinced of its advantages in comparison to existing systems. I don’t need much convincing or even using the actual software – a video of you using your own prototype implementation to CRUD some data, and comparing it with an SQL database would be enough for me.

          • Ilya Geller

            this is the reason I spam: there are many companies who have resources.
            the same companies cut me from financing.
            now they all know that their competitors know

          • Craig Buckler

            I don’t understand most of what you’re on about but…

            You claim to have designed a vastly superior artificially-intelligent data store. It’s not clear whether you have a working implementation but perhaps the concept is good enough? However, you won’t reveal the details because you want recognition and financial reward.

            My advice: stop talking and release it. Let others examine your ideas/code without charge or restriction. If your claims hold-up, untold fame and riches will follow. You’ll be the father of AI. The name Geller will be synonymous with Babbage, Lovelace, Turing and Berners-Lee.

            Until then, you have nothing. Unless you can substantiate your claims with proof and usable software, developers will continue to use SQL/NoSQL. Hence the reason for this article.

          • Ilya Geller

            I released everything! All is public domain. Read my blog at IBM – all details on technology are in there. Read my patents.
            The proof is my NIST TREC QA 2003; the implementation of my new ideas is too expensive for me – US PTO database, 15 million of structured and related patents. I cannot afford it.
            If you want – you can do US PTO – it’s at least $500 million per year

          • Craig Buckler

            Links?

            Forget the patents – they could make your solution unusable. Give it away and allow humanity to progress unhindered. Tim Berners-Lee did that for the web and usage exploded exponentially. Perhaps he could have made billions, but money lasts a lifetime while legacies endure forever.

          • Ilya Geller

            Right. SQL = $1-2 trillion ($1-2.000 billion). SQL is the Industry standard. People loose real billions. Google, IBM, Oracle, Amazon, etc. – they all are gone.
            Do you think they allow me to publish anything? Or to start my company?
            The patents is the only what I could publish. These posts – the only I can publish

          • Craig Buckler

            How could they stop you? Ideas in the public domain are unstoppable. Why haven’t those companies prevented you talking here?

            Besides, they will come to you. They’ll want to use your concepts, grow their own software and beat their competitors. It’s not as though anyone thinks SQL (or anything in IT) will last forever.

            Publish your ideas for the world. Until you do, no one will believe your claims. Would you rather be a hero or a paranoid recluse?

            That’s the end of my thoughts on this matter which have veered uncontrollably off-topic.

          • Ilya Geller

            Google? Google will come to me? Don’t make me laugh…
            You don’t understand: there are many gigantic companies those business is only SQL. Without SQL they are nothing. They have the power, money: there are many ways to make me silent.
            The posts on Internet is my last resort: I tried everything for five years.

          • Craig Buckler

            …you mean you’ve tried everything except for publishing your ideas!

            Google doesn’t depend on SQL. The company depends on services. Your claims would make their search systems better – of course they’d be interested. As would any of their competitors.

            Have you approached any of these companies and revealed your ideas in full? I presume not.

            Alternatively, you must have evidence of them attempting to shut you up? (Which – amazingly – has failed at SitePoint?) Add that information to your publications – it’ll make your claims more believable and newsworthy.

            However, until you publish, you risk of sounding like a conspiracy-theorizing loony making paranoid excuses about an imaginary system.

          • Ilya Geller

            Read my patents and IBM blog?
            Ilya Geller is my name

          • boen_robot

            LINKS DAMN IT!!!!

            *cough*
            Sorry… I meant….

            Links, pleeeease.

          • Ilya Geller

            The system does not allow to post links
            Go to Google and search on my name? ‘Ilya Geller’?

          • Craig Buckler

            Disqus DOES allow you to post links? I still can’t find it given your instructions but I presume you mean the PTO documents which I did located on Google.

            Patent applicatications don’t prove anything. They propose an invention but don’t necessarily state how it works. I could apply for a patent to an invisible flying car which runs on air and generates diamond emissions but that doesn’t mean I could build it. It just means anyone who did would need to pay me royalties.

            So, I say again: do the decent thing, forget the patents and publish your work. It sounds as though you’ve already wasted five years. Don’t waste any more time ranting in forums – no one will believe vaporware claims.

          • Ilya Geller

            Below is THE statistics. It’s the Fact. The Fact does not need to be proved.
            fact
            noun
            noun: fact; plural noun: facts
            a thing that is indisputably the case.

            For instance, there are two sentences:
            a) ‘Pickwick!’
            b) ‘That, with the view just mentioned, this Association has taken into its serious consideration a proposal, emanating from the aforesaid, Samuel Pickwick, Esq., G.C.M.P.C., and three other Pickwickians hereinafter named, for forming a new branch of United Pickwickians, under the title of The Corresponding Society of the Pickwick Club.’
            Evidently, that the ‘ Pickwick’ has different importance into both sentences, in regard to extra information in both. This distinction is reflected as the phrases, which contain ‘Pickwick’, weights: the first has 1, the second – 0.11; the greater weight signifies stronger emotional ‘acuteness’; where the weight refers to the frequency that a phrase occurs in relation to other phrases.

          • Craig Buckler

            Ahh, I see. You’re applying a weight to the same words depending on context. I hate to be a harbinger of doom but many other natural-search systems do exactly that. And it’s not AI.

            But keep at it. Preferably elsewhere.

          • Ilya Geller

            You don’t know what you are talking about. You don’t know SQL… You have no idea how IBM, Oracle and all IT Industry calculated weights before I patented that statistics.
            IBM took away its AQL… Oracle – take a look.

            That statistics is the biggest – I can say the only – discovery into Philosophy of Language and Linguistics for the past 150 years. The statistics changes everything. As my first patent created Google.

          • Craig Buckler

            Well I look forward to seeing your revolutionary system when it’s released. Best of luck.

          • boen_robot

            c) ‘Samuel Pickwick is an absolutely disgusting twat!’
            Evidently, despite appearing just once, and in a shorter sentence, this sentence has more “emotional ‘acuteness'” with regards to “Pickwick”. The distinction is reflected in the use of the word “twat”…. Which unless your software knows the meaning of, it wouldn’t detect that “emotional ‘acuteness'”. And if it DOES explicitly know that one word, it wouldn’t (necessarily) be able to automatically detect new variations that people will inevitably come up with in an attempt to communicate their emotions without being detected by the system.

            I don’t see exactly how this whole example is related to databases – systems used for storing and retrieving data. AIs are usually separate systems that USE a database as part of their functionality, not a database system on their own. Cortana and Siri for example are natural language analysis programs that store data about you in their own DB (I’m assuming an SQL-ish DB…) and makes decisions based on it, combined with the input, but the actual “storage” facility – the database – is separate from the analysis.

          • Ilya Geller

            That statistics is the biggest, if not the only, discovery in Humanities for the past 150 years.
            If you would read the patents you can see that I use phrases, not words. This is also my discovery.
            If you read my articles at IBM blog you can see why: words are none-predicative definitions, phrases – predicative.
            Now please read Henry Poincare and Moore-Russell-Wittgenstein. Tractatus Logico-Philosophicus?
            May I ask you to read my blog at IBM? I explained why and how in all details.
            Please try to read an article on Wiki on ‘Laconic phrase’? After that you will see emotions…

            Please study how weights were assigned before I discovered how to calculate them? Study what SQL is? Edgar Codd?
            IBM? Oracle? LexisNexis? HP? Google? How they assigned weights before Google read my patent application? Read my article at IBM blog?
            Weights were assigned.

          • Ilya Geller

            Please forget Natural Language?
            I structure common language.
            Cortana does not structure.
            Please read what I wrote? My patents?
            If you want I can give you IBM, Oracle, Google technology?

          • boen_robot

            www(dot)ibm(dot)com/developerworks/community/forums/html/topic?id=f290db14-c2d2-423e-b9ca-4e10d11417cd&ps=100&tags=&query=&filter=&sortBy=&order=asc

            All I see are “ramblings” about what it “could” be… And some of these sound an awful lot like Siri or Cortana… At least UI wise, even if they’re different under the hood. Oh, and BTW, these are forums, not blogs. I can’t find you at all in the blogs. Maybe give a link in a notation similar to the above?

          • Ilya Geller

            .

          • Ilya Geller

            No money. I have the program but cannot apply it to a real database, which can practically prove everything.
            There are two – NIST TREC QA AQUANTANT and US PTO Patent Database.
            Structuring is extremely expensive – 6.3 million at NIST TREC QA and 15-17 million at US PTO.
            However, US PTO can bring 500 millions-2 billion per year.

            Siri and Cortana – listen, I develop what has existed for long time. They too. The difference – they are programmers, I came from Science. They apply SQL and other programming languages. I – my head.

            They did not see the statistics I discovered, they cannot even parse, they still use n-grams. They cannot index data. They cannot create my relation database on subtexts. I patented that all.

          • Craig Buckler

            So the reason developers can’t implement your idea into their systems is because you have a patent?! You’re holding back technological progress for cumbersome legal processes and a little cash? Yeah, nice move. I hope you’re not using open source tools during your “development”…

            You can’t claim SQL/NoSQL is dead since you’re not allowing anyone to examine, develop or build on your idea. And boen_robot’s correct: you’re not talking about a new storage system but a data retrieval mechanism. The underlying technology stack could be anything – SQL, NoSQL, flat files, punch cards, potato print, etc. You may be a man of science but that doesn’t make you a developer.

            In summary, you have a (secret) concept. But you don’t have funding or development resources to realize your dream. In other words, you have nothing … except plenty of time to spout ludicrous off-topic claims and self-important drivel on forums. Stop wasting your time and ours – build your system and demonstrate it to the world.

          • Ilya Geller

            $1-2 trillion = $1-2.000 billion = $1-2.000.000 million = $1-2.000.000.000.000,17 dollar market

          • Craig Buckler

            and I hope you’re pleased with your 0% cut…

            You’ve been sitting on your idea for a decade without making a penny. That’s your fault – not the fault of dark forces trying to shut you up (I wish!)

          • Ilya Geller

            No.
            I tried for five years to rise money. However, they cut me from business world. This is the reason I began to post these letters on Internet – they did not expect me to do this

          • Craig Buckler

            No one will give you money or invest time in a patented concept you’re unwilling to share. Release it and stop blaming others for your woes. Ideas cost nothing. Implementation is another matter.

          • Ilya Geller
          • Minh Le

            Plot twist: Ilya Geller is an AI and handily passed the Turing test.

          • Ilya Geller

            I hope you have a pencil? Can yo calculate?
            Take any sentence by your choice?
            I have the Fact.
            Other Facts follow from the most primitive Grammar:
            – parsing by clauses,
            – paragraphs,
            – indexing by dictionary,
            – subtexts.
            Would you challenge Grammar you use writing these posts?

          • Craig Buckler

            All I could find were a few random forum posts? Why not post some links? You don’t think I’m working for the evil empire hoping to destroy/profit from your plans, do you?! (Of course, they’d all say that…)

          • Ilya Geller

            Google it – the first page on ‘Ilya Geller’
            IBM link
            DBLR link

            US PTO link

          • Ilya Geller

            Or you can use my software. It’s ready. In 4-5 months, I hope, you will have US PTO database.

          • Craig Buckler

            I don’t understand most of what you’re on about but…

            You claim to have designed a vastly superior artificially-intelligent data store. It’s not clear whether you have a working implementation but perhaps the concept is good enough? However, you won’t reveal the details because you want recognition and financial reward.

            My advice: stop talking and release it. Let others examine your ideas/code without charge or restriction. If your claims hold-up, untold fame and riches will follow. You’ll be the father of AI. The name Geller will be synonymous with Babbage, Lovelace, Turing and Berners-Lee.

            Until then, you have nothing. Unless you can substantiate your claims with proof and usable software, developers will continue to use SQL/NoSQL. Hence the reason for this article.

          • Ilya Geller

            in 3-4 months you can have NIST TREC QA AQUANTANT collection
            In 4-5 months – US PTO
            I have the program but never tried it on real data – too expensive

    • Thomas Loyd

      Ilya, having a degree in Linguistics and understanding stuff from being a DBA and DB developer before, your “numerics” database is not really better than any of the other database languages, SQL/NoSQL you are calling into question.

      My main reason for calling you out is because your “database technology” seems to forget that NO, and I repeat NO, database or program for that matter can truly take a quality item like your phrase “does eternal love exist?” and parse the meaning from it since that phrase has absolutely NO machine-ly quantifiable values for a numerical value of love. Any “quantifiable” value for love is automatically in question because some human had to come up with it first. And last time I checked, no human created value system is truly equivalent since one human will disagree with another human on what is a “1” through “n” scale of love intensity and any other dynamic that is part of it.

      Hell, you’re talking about the (un)Holy Grail of technology right now that computational linguistics is so hardly trying to parse out (puns intended). Things can be parsed grammatically, however, semantics tends to pitch them for a loop. And your statistical model of “parsing grammar” is probably just that, good for parsing grammar and statistically racking and stacking it. So, other than your system being “yet another non-SQL wannabe” I’m calling BS and don’t really see any benefit for it since SQL/NoSQL actually work quite fine.

      I also want to thank Craig for doing such fine job on this article and its successor too! You can never have enough information for choosing databases and their associated programmatic languages.

      • Ilya Geller

        I did.
        The parsing and weighting only a part of all. Read the patents?
        I switched from External to Internal theory of Analytic Philosophy, from Russell-Moore-Wittgenstein to Hegel-Bradley-Poincare.
        Basically I claim I found how and why human thinks and I created the first real AI.
        Now you can try to beat me. I am ready.
        We can start from Russell antinomies? And after that Ponicare on predicative and none-predicative definitions?

        • Thomas Loyd

          Ilya, I will get back to my basic premise as I mentioned above. Every one of those theories are merely that: theories. You basically named off a bunch of Peoples’ names for theories and I point you back to this: “no human created value system is truly equivalent since one human will disagree with another human no matter what”. You do NOT have an established system and for every example you try to compensate for there will always be a counter-example where it does not work. Hence, Craig’s article on the SQL / NoQL choice for those who are trying to wrap their heads around the two options and don’t have as much skills/experience doing ERMs and normalization through Codd’s Normalization Forms 1-6 & DKNF in a relational database.

          As for AI, there is still a lot that is out for debate as to what is truly a “self-aware” AI other then a bunch of case-statements, if-then statements, binary logic based fuzzy decisions that make up whatever you want to call AI as stored somewhere in a computer (in database of course in a normalized form…hehe). Since my expertise and study is in Linguistics I can talk to this because there are things that a human will be able to completely understand like Dr. Seuss: “I will not eat green eggs and ham Sam I am.” Good luck getting your AI to understand quite what “green eggs and ham” are while any child will completely “grok” what it is and appreciate Dr. Seuss’ wit and humor. Also, how about ambiguity: You beat your wife often? Oops, AI choked on that one since what IS the true meaning of it? If you’ve studied generative/transformational grammar from the likes of Noam Chomsky and other truly cunning linguists you will see that your AI still has a very long way to go, if ever. Don’t feel too bad, Computational Linguistics is still trying to get it together too but still having a hard time shaking off the curse of the mathematician’s logic as applied to language.

          As for Russell’s Antinomy, it is based on mathematics and logic. The last time I checked, language is not as logically bound as you would like to make it out to be. That is why in Spanish a double negative STILL has a negative connotation: y entonces, tu no sabes nada de ese concepto. And unlike math, the Spanish speaking world moves on and doesn’t come to a grinding halt because, Dios lo prohibe, a double-negative takes them into a mathematically illogical world that does not compute and tongue-ties the whole culture.

          Also, I fully DO NOT intend on trying to beat you to the punch or ever try and program something of that magnitude as you suggest because of the inherent madness/bias that one tends to develop around their own “baby” as you are showing with your point of view for your patented idea. HOWEVER, I can probably pick your complete programmatic model for your “novel NonSQL” language apart from a linguistic/logical viewpoint because of my own interests and academic background. But I choose not to because too much time for something of little benefit and, as I see it, futile in the long run.

          Since we’re bandying challenges back and forth, here’s one for you Ilya:

          Explain to me how you would go about creating a scale that an AI system, or database, would be able to understand how much I (or any other human being) love you or hate you?

          I’ll give you the answer even though you will probably try to do it anyway: You can’t. Or actually, you probably could for you yourself. But then again you’re human and an AI is not. To sum it up: Qualities can never truly equal Quantities. Just ask Wolfram Alpha or IBM’s Watson and see what their answers are.

          Good luck bro!
          Tom The Still Cunning Linguist (and occasional DBA)

          • Ilya Geller

            Thomas – I gave the Fact, statistics:
            For instance, there are two sentences:
            a) ‘Pickwick!’
            b) ‘That, with the view just mentioned, this Association has taken into its serious consideration a proposal, emanating from the aforesaid, Samuel Pickwick, Esq., G.C.M.P.C., and three other Pickwickians hereinafter named, for forming a new branch of United Pickwickians, under the title of The Corresponding Society of the Pickwick Club.’
            Evidently, that the ‘ Pickwick’ has different importance into both sentences, in regard to extra information in both. This distinction is reflected as the phrases, which contain ‘Pickwick’, weights: the first has 1, the second – 0.11; the greater weight signifies stronger emotional ‘acuteness’; where the weight refers to the frequency that a phrase occurs in relation to other phrases.
            SQL does not see that statistics – SQL is over.
            Prove I am wrong?

          • Thomas Loyd

            Ilya, you have proven nothing other than once again, statistics, just like math cannot compensate or even define what some “essence” is. Your statistical “emotional acuteness” measurement once again relies on what? S-T-A-T-I-S-T-I-C-S! Also known as numbers. And since your NonSQL “solution” relies on that you are still missing the point. Your “Pickwick” example is relying on statistical frequencies of (fill in the lexical blank here) in location to each other in your text/corpus. You have (yet again) given something an arbitrary weightedness. It still does not fit the bill nor answer the real question.

            As for your barber example, that is an existential item that is not solved with your NonSQL database thingy. Hell, it reminds of an existential Mobius strip where one is still trying to figure out the chicken or the egg as to primacy of origin and/or solution to a problem with the answer probably being he cuts his own hair or is married and his wife does it. Problem with all that existential stuff is what I like to say from my favorite game Character Mr. Torgue of Borderlands 2 fame: TOO MANY SYLLABLES!!! BORING!!!! And yes, even simplicity can be wrong too because some things are just too complicated to grok in a simplistic fashion.

            Yeah, U.S. philosophers have their own perspective that does not necessarily mesh with your Russian/Slavic perspective my friend. Just like the Girya is now the tool of choice for exercise professional because it is simple but brutal like your philosophical perspectives based upon your cultural experience. Nature or nurture anyone?

            Since you are making your grandiose premise: “I gave you the Fact. This Fact changed everything. From now all Science is under Internal Relations theory wings. SQL is over.” I say NAY! Because you still need to refine your process more and listen to Occam’s Razor and any other existential reasoning you may come up with until you realize futility at its best.

            Always remember too: Opinions are abundantly available in many odiferous forms and yours has been annotated here too along with mine.

            BTW, thanks for the intellectual pursuit in this. I’m not going to counter anything else you say because it is starting to become academically cumbersome and I have to go to bed along with the many nodding and rolling eyes in the crowd reading this.

            On that note, good night bro! Love ya! Don’t hate ya! Spasiba! Buenas Noches, O yasumi nasai, bon soir, guten nacht, and boa noite! So agree to disagree agreeably and enjoy yourself!

            PS: One day I’ll get Russian down Ilya so I can further debate pessimistic existentialism as Russians love to live it with you. Smiles are so much better with optimism too.

          • Ilya Geller

            I am from the casual Philosophical tradition: Plato, Aristo, Hegel, Spinoza, Russell, etc.
            Show me one Fact any American philosopher or Russell-Moore-Wittgenstein provided?
            I did. Einstein got Nobel for the same.
            Like I said – Chomsky did nothing in Science, he used too many syllables, that’s it.
            You did not comment my dialogue with Dostoevskiy. Why?

          • Ilya Geller

            My SQL saga is pretty damn serious.
            Don’t patronize me. OK? If you have something to say – please do. But think first.

          • Thomas Loyd

            I will patronize you Ilya until you Move on. Until you put up something to prove your point that has validity you can quit being a loud squeaky wheel. I’m not going to engage you on here since you are moving way off the topic and into existential claims with your “NonSQL” claim. Put something up on the internet and prove your claims or just move on since nobody is going to take you seriously anyway until you do so. Also, if you’re into making existential philosophical claims as you have done you might want to take it to a different place than Sitepoint because you’re getting just plain tiring now. If your SQL saga is pretty damn serious post something about it on the internet along with code/program/working model to support your claims. Then ask for feedback. If you’re stuck on closed source by hiding behind your grandiose claims, it all comes down to you putting up something and being taken seriously or talking smack without any support other than your words and looking the fool.

            I also realize what it is like when you are also doing this in another language (I speak a couple too). Again, I’m through here and moving on to other excellent articles here on SitePoint. You should do so too. Bye Ilya.

          • Ilya Geller

            The theme: how to chose between.

            I tell – there is nothing to choose between.
            Both SQL and NoSQL are obsolete: one must waste tons of time adjusting his queries to ‘raw’ data.
            I tell: the data should be structured; the queries must be structured the same manner.
            I tell: new kind of relational database should be used: data must be related by its sense, meaning – not manual categories.
            I explained that by my patents. These patents are written by the best lawyers and no language ambiguities should appear while you read them.

            Both SQL and NoSQL are obsolete and must be avoided.

            All IT Industry uses SQL and NoSQL only: all IT Industry is obsolete.
            Google, IBM, Oracle, Microsoft, etc. – they all are obsolete.

          • Ilya Geller

            Russell said on antinomies: ‘I recognize further this element of truth in Poincaré’s objection to totality, that whatever in any way concerns all of any or some (undetermined) of the members of a class must not be itself one of the members of a class (Russell 2014).’
            I think that Nothing is a member of none, any and all classes: Nothing cannot be somehow observed and described; there is something Real, material substance, our Universe – and Nothing.
            However, something material always finishes in Nothing: for instance, suppose there is a town with just one barber, who is male. In this town, every man keeps himself clean-shaven, and he does so by doing exactly one of two things:
            – shaving himself;
            – or going to the barber.
            Who shaves the barber? I am positive that the barber can either willingly find refuge from too inquisitive philosophers into another town, ruining the set of all; or he die, finishing the set of all. In other words: ‘Hence, the truth of being and nothing alike is the unity of both of them; this unity is becoming’ (Hegel 1991). In other words: all sets exist in time, Russell example is the set outside time.

          • Ilya Geller

            I forgot what Noam Chomsky did. Something on kernel sentences? Please read my patents – I obtain predicative definitions – they are kernel sentences.
            I am very skeptical about American humanitarians – they all are weak, uneducated and don’t know how to think.
            Yes. I spoke to Dostoevskiy – read my article from 2006 – he hated me because I interrogated him asking why he planed to kill people.

          • Ilya Geller

            Actually, I see none in Oxford, Cambridge or somewhere else… For the past 100 years, after Russell failed to define what Knowledge is – Analytic Philosophy and all Science stagnated.

            I gave you the Fact. This Fact changed everything.
            From now all Science is under Internal Relations theory wings.
            SQL is over.

          • Ilya Geller

            You can get the same result – try. The only thing you need to do is to write a program and make Lexical Clone of Dostoevskiy based on ‘Brothers…’ and ‘Crime and…’

  • simon codrington

    Thanks for the article @craigbuckler . I’ve been interested in finding more about NoSQL for a while and this article (and your other one) were easy to understand with actual examples.

    Don’t worry about the negative noise from others :)

    • Craig Buckler

      Thanks Simon – glad you found them useful. It took me a little time to get my head around NoSQL and it often requires thinking in a different way.

  • david

    In your first example, creating new tables for multiple telephone numbers / email addresess isn’t required. You may create one extra table and store this additional data as JSON inside a MEDIUMTEXT column with the contactid column for reference. For the second example, it does work for a single purpose (display this exact data) but the second you want to call multiple sources (different users statues at once) it’s impossible. I know you were just giving examples but it does kinda negate the comparisons.

    • http://careersreport.com maij.thompson

      Allow& me to show you a genuine way to earn a lot of extra money by finishing basic tasks from your house for few short hours a day — See more info by visiting >MY*&___(DISQUS)*%___ID)

    • Craig Buckler

      Regarding JSON inside a MEDIUMTEXT column … you’re suggesting a NoSQL-like store inside SQL DB. Wouldn’t it be simpler to use NoSQL in the first place?! Storing multiple values in one SQL column goes against the first normal form of good relational database design (https://en.wikipedia.org/wiki/First_normal_form). No one will stop you doing it but you lose benefits such as type checking, indexing, foreign keys etc.

      Second example (social network?): what’s impossible about retrieving multiple documents in SQL or NoSQL?

      These examples can be developed in an infinite variety of ways. I’m suggesting which DB type could offer benefits. You may not agree but that doesn’t make the approaches any less valid.

  • http://cneude-createur-web.com Matthieu

    Thank you very much for this article. I was waiting for this kind of article for a long time, I don’t have the time to dig into NoSQL for the moment and I didn’t really know the advantage on it.

    I will now ask myself the good questions for my future side project…

    • Craig Buckler

      Glad you found it useful, Matthieu. That was my reason for writing them – many tutorials tell to how to achieve something in SQL or NoSQL but not why you should consider that DB type in the first place.

  • Eugene Sergienko

    Thanks for both articles. They are clearly explained. Good job !

  • Novica Vukobratovic

    I have a question, or a wondering actually :) If a person wants to be a web developer these days, is he going to be able to have a “life” outside of that ? Or is it constant, non-stop work / study cycle every day?

    • Craig Buckler

      The best developers enjoy development so it doesn’t feel like ‘work’. So, yes, we often put in silly hours but most working people do…

      • http://javebratt.com Jorge Vergara

        I’d even argue that if you are organized you can do it in less time than most working people :P

  • Daniel

    Hi, this is a great article, thanks man. I have a question for you, I’m doing a payment gateway project, something like Paypal, but 100 times smaller; what’s your advice on the type of database I should use, SQL or NoSQL?Thanks for your help.

  • Hoang Nguyen

    Great article, finally I could understand when should use SQL or noSQL :)

  • phalguna mattangi

    Thanks a lot .. great forum, clearly explains it.
    I have been through an instance where we are looking to design the database for online reservation system for a tennis court, in fact to support other sports too.
    We have our designs in both the versions . We are familiar with SQL ,RDBMS.
    But we are quite new NOSQL. I wanted to know as reservation systems are transactional on daily basis, which one we need to prefer to avoid complications furtherly. Most of the forums i googled recommends SQL but I wanted to know from expert commentals in this forum .. :)

Recommended

Learn Coding Online
Learn Web Development

Start learning web development and design for free with SitePoint Premium!

Instant Website Review

Use Woorank to analyze and optimize your website to improve your website to improve your ranking!

Run a review to see how your site can improve across 70+ metrics!

Get the latest in Front-end, once a week, for free.