Wednesday, May 20, 2015

Comparison - Elasticsearch vs MongoDB

Elasticsearch MongoDB
Description A modern enterprise search engine based on Apache Lucene One of the most popular document stores
DB-Engines Ranking Rank - 14, Score - 64.83 Rank - 4, Score - 277.32
Database model Search engine Document store
Developer Apache Software Foundation MongoDB, Inc
Initial release 2010 2009
License Open Source Open Source
Database as a Service No No
Implementation language Java C++
Server operating systems All OS with a Java VM Linux, OS X, Solaris, Windows
Data scheme schema-free schema-free
APIs and other access methods Java API, RESTful HTTP/JSON API proprietary protocol using JSON
Server-side scripts No JavaScript
Triggers Yes No
Partitioning methods Sharding Sharding
Replication methods Yes Master-slave replication
MapReduce No Yes
Consistency concepts Eventual Consistency Eventual Consistency, Immediate Consistency
Foreign keys No No
Transaction concepts No No
Durability Yes Yes

Tuesday, May 19, 2015

NoSQL Database

NoSQL encompasses a wide variety of different database technologies that were developed in response to a rise in the volume of data stored about users, objects and products, the frequency in which this data is accessed, and performance and processing needs. Relational databases, on the other hand, were not designed to cope with the scale and agility challenges that face modern applications, nor were they built to take advantage of the cheap storage and processing power available today.
NoSQL DEFINITION: Next Generation Databases mostly addressing some of the points: being non-relational, distributed, open-source and horizontally scalable.
A NoSQL (often interpreted as Not only SQL) database provides a mechanism for storage and retrieval of data that is modeled in means other than the tabular relations used in relational databases. Motivations for this approach include simplicity of design, horizontal scaling, and finer control over availability. The data structures used by NoSQL databases (e.g. key-value, graph, or document) differ from those used in relational databases, making some operations faster in NoSQL and others faster in relational databases. The particular suitability of a given NoSQL database depends on the problem it must solve.
NoSQL Database Types
  • Document databases pair each key with a complex data structure known as a document. Documents can contain many different key-value pairs, or key-array pairs, or even nested documents.
  • Graph stores are used to store information about networks, such as social connections. Graph stores include Neo4J and HyperGraphDB.
  • Key-value stores are the simplest NoSQL databases. Every single item in the database is stored as an attribute name (or "key"), together with its value. Examples of key-value stores are Riak and Voldemort. Some key-value stores, such as Redis, allow each value to have a type, such as "integer", which adds functionality.
  • Wide-column stores such as Cassandra and HBase are optimized for queries over large datasets, and store columns of data together, instead of rows.

The Benefits of NoSQL
When compared to relational databases, NoSQL databases are more scalable and provide superior performance, and their data model addresses several issues that the relational model is not designed to address:
  • Large volumes of structured, semi-structured, and unstructured data
  • Agile sprints, quick iteration, and frequent code pushes
  • Object-oriented programming that is easy to use and flexible
  • Efficient, scale-out architecture instead of expensive, monolithic architecture