What Is NoSQL?
NoSQL stands for Not only SQL, and is an emerging alternative to SQL databases such as MySQL, the most widely-used open-source database. MySQL is a full relational database, like Oracle, DB2, and SQL Server. Each of these has a large user base, and is relied on by organizations large and small as the "source of truth." That's because transactions done against these databases are guaranteed to be processed accurately. Each of these databases has a storage engine that is ACID-compliant, which is an acronym for:
- Atomic: Database modifications must follow an all-or-nothing rule and either complete or not complete, but never leave data in some in-between state.
- Consistent: Any database modification must keep the database in a consistent state, or, more precisely, take the database from one consistent state to another consistent state.
- Isolated: This requires that other operations cannot access or see data that has been modified during a transaction that has not yet completed. In other words, concurrent transactions must not interfere with one another.
- Durable: The database guarantees that once the user is told that the transaction has succeeded, the transaction will not be lost even in the case of system failure.
ACID-compliance is necessary to guarantee reliability and data integrity. This has to add some overhead. In most cases the overhead is worthwhile because reliability and data integrity are essential. But some applications need access to large amounts of data but don't have the same stringent reliability and integrity requirements. For these applications the overhead is too much to bear, leading to the view that an ACID-compliant SQL database will be too slow.
A large number of NoSQL non-relational data stores have been proposed, and they're genuinely useful for many applications. NoSQL offerings range from key-value stores to document / object stores to extensible record stores. All NoSQL offerings relax one or more of the ACID properties; they also have simpler APIs and do not offer the full expressive power of SQL. The ACID alternative is sometimes described as BASE ("basically available, soft state, eventual consistency"), as in this 2008 ACM article by Dan Pritchett. There's also an excellent 2010 paper by database luminary and Schooner Advisory Board member, Dr. Rick Cattell, entitled "High Performance Scalable Data Stores." Also, here's a CACM blog post — Errors in Database Systems, Eventual Consistency, and the CAP Theorem — by database pioneer Michael Stonebraker, which nicely discusses some of the tradeoffs between ACID Consistency and BASE eventual consistency.
Memcached, widely utilized due to its low latency and high scalability, is already a key-value store supporting both cache and store mode by enabling or disabling eviction. Implement it on a server using large amounts of fast flash memory. Add persistence and enterprise-grade high availability and disaster recovery. Suddenly, you have a superb enterprise-ready NoSQL key-value store for real production use on demanding workloads.
