NOSQL Mongo DB Couch DB ANgular JS Node
NOSQL Mongo DB Couch DB ANgular JS Node JS
No. SQL • Next Generation Databases mostly addressing some of the points: being non-relational, distributed, open-source and horizontally scalable. • Schema-free, easy replication support, simple API, eventually consistent / BASE (not ACID), a huge amount of data and more. • A No. SQL (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.
No. SQL can be classified in 3 types: 1. Wide Column Store / Column Families Eg - : Hadoop / HBase, Cassandra , Amazon Simple. DB , Cloud. Data etc. 2. Document Store Eg - : Arango. DB, Orient. DB , Mongo DB , Couch DB 3. Key Value / Tuple Store Eg - : Oracle NOSQL Database , Reddis , Dynamo DB.
Couch DB • Couch. DB is a database that completely embraces the web. Store your data with JSON documents. Access your documents and query your indexes with your web browser, via HTTP. Index, combine, and transform your documents with Java. Script. • Couch. DB works well with modern web and mobile apps. • And you can distribute your data, or your apps, efficiently using Couch. DB’s incremental replication. Couch. DB supports master setups with automatic conflict detection. • Couch. DB is highly available and partition tolerant, but is also eventually consistent, Couch. DB has a fault-tolerant storage engine that puts the safety of your data first.
Features of Couch DB • ACID Properties • The Couch. DB file layout and commitment system features all Atomic Consistent Isolated Durable (ACID) properties. On-disk, Couch. DB never overwrites committed data or associated structures, ensuring the database file is always in a consistent state. This is a “crash-only" design where the Couch. DB server does not go through a shut down process, it's simply terminated. • Compaction • Wasted space is recovered by occasional compaction. On schedule, or when the database file exceeds a certain amount of wasted space, the compaction process clones all the active data to a new file and then discards the old file. The database remains completely online the entire time and all updates and reads are allowed to complete successfully. The old file is deleted only when all the data has been copied and all users transitioned to the new file.
Features of Couch DB • Views • ACID properties only deal with storage and updates, we also need the ability to show our data in interesting and useful ways. Unlike SQL databases where data must be carefully decomposed into tables, data in Couch. DB is stored in semi-structured documents.
Security and Validation • Administrator Access • Couch. DB database instances have administrator accounts. Administrator accounts can create other administrator accounts and update design documents. Design documents are special documents containing view definitions and other special formulas, as well as regular fields and blobs. • Update Validation • As documents written to disk, they can be validated dynamically by javascript functions for both security and data validation. When the document passes all the formula validation criteria, the update is allowed to continue. If the validation fails, the update is aborted and the user client gets an error response.
Mongo DB • Mongo. DB (from humongous) is a cross-platform document-oriented database. Classified as a No. SQL database, Mongo. DB eschews the traditional table-based relational database structure in favor of JSON-like documents with dynamic schemas (Mongo. DB calls the format BSON), making the integration of data in certain types of applications easier and faster. • Mongo. DB is free and open-source software.
Features Of Mongo DB Document-oriented • Instead of taking a business subject and breaking it up into multiple relational structures, Mongo. DB can store the business subject in the minimal number of documents. For example, instead of storing title and author information in two distinct relational structures, title, author, and other title-related information can all be stored in a single document called Book. Ad hoc queries • Mongo. DB supports search by field, range queries, regular expression searches. Queries can return specific fields of documents and also include user-defined Java. Script functions.
Features Of Mongo DB Indexing • Any field in a Mongo. DB document can be indexed (indices in Mongo. DB are conceptually similar to those in RDBMSes). Secondary indices are also available. Replication • Mongo. DB provides high availability with replica sets. [16] A replica set consists of two or more copies of the data. Each replica set member may act in the role of primary or secondary replica at any time. • Load balancing • File Storage Server-side Java. Script execution • Java. Script can be used in queries, aggregation functions (such as Map. Reduce), and sent directly to the database to be executed.
Usabilty of Different No SQL DB DB Choice depends on Your software requirement.
Mongo DB vs Couch DB • As you can see, there are three primary concerns you must balance when choosing a data management system: consistency, availability, and partition tolerance. * Consistency means that each client always has the same view of the data. * Availability means that all clients can always read and write. * Partition tolerance means that the system works well across physical network partitions. • As you can see in the diagram, Mongo. DB and Couch. DB are built with a slightly different focus. Both scale across multiple nodes easily, but Mongo. DB favours consistency while Couch. DB favours availability.
Mongo DB vs Couch DB Mongod. B : Availability and Partition Tolerance Couch. DB : Consistency and Partition Tolerance Mongo. DB: If you need dynamic queries. If you prefer to define indexes, not map/reduce functions. If you need good performance on a big DB. If you wanted Couch. DB, but your data changes too much, filling up disks. Couch. DB : For accumulating, occasionally changing data, on which pre -defined queries are to be run. Places where versioning is important.
CONCLUDE - Mongo. DB • • • • Written in: C++ Main point: Retains some friendly properties of SQL. (Query, index) License: AGPL (Drivers: Apache) Protocol: Custom, binary (BSON) Master/slave replication (auto failover with replica sets) Sharding built-in Queries are javascript expressions Run arbitrary javascript functions server-side Better update-in-place than Couch. DB Uses memory mapped files for data storage Performance over features Journaling (with --journal) is best turned on On 32 bit systems, limited to ~2. 5 Gb An empty database takes up 192 Mb Grid. FS to store big data + metadata (not actually an FS) Has geospatial indexing • Best used: If you need dynamic queries. If you prefer to define indexes, not map/reduce functions. If you need good performance on a big DB. If you wanted Couch. DB, but your data changes too much, filling up disks. • For example: For most things that you would do with My. SQL or Postgre. SQL, but having predefined columns really holds you back.
CONCLUDE - Couch. DB • • • • • Main point: DB consistency, ease of use License: Apache Protocol: HTTP/REST Bi-directional (!) replication, continuous or ad-hoc, with conflict detection, thus, master-master replication. (!) MVCC - write operations do not block reads Previous versions of documents are available Crash-only (reliable) design Needs compacting from time to time Views: embedded map/reduce Formatting views: lists & shows Server-side document validation possible Authentication possible Real-time updates via _changes (!) Attachment handling thus, Couch. Apps (standalone js apps) j. Query library included • Best used: For accumulating, occasionally changing data, on which pre-defined queries are to be run. Places where versioning is important. • For example: CRM, CMS systems. Master-master replication is an especially interesting feature, allowing easy multi-site deployments.
ANGULAR JS • Angular. JS (commonly referred to as “Angular” or “Angular. js”) is an open-source web application framework mainly maintained by Google and by a community of individual developers and corporations to address many of the challenges encountered in developing single-page applications. • It aims to simplify both the development and the testing of such applications by providing a framework for clientside model–view–controller (MVC) and model–view– viewmodel (MVVM) architectures, along with components commonly used in rich Internet applications.
WHY Angular JS • Angular. JS provides the following features which makes developing web apps easy: • • Two way data binding Dependency Injection Custom HTML Directives Easy integration with REST webservices using $http, $resource, Rectangular etc • Support for Testing.
- Slides: 18