SlideShare a Scribd company logo
MongoDB
ElasticSearch
Couchbase
Prepared by: Shalkarbayuly A. (PhD student)
Presentation was prepared for “Database Management” course as
a part of PhD program in Turgut Ozal University
1. NoSQL databases
2. MongoDB
3. ElasticSearch
4. Couchbase
What is NoSQL?
NoSQL databases
NOSQL sometimes stands for Not Only SQL
NOSQL is mechanism for storage and retrieval
of data other than tabular data
Motivations are simplicity of design, horizontal
scaling, control over availability
Problems of RD solved by NoSQL
★ RD will not scale to your traffic at an
acceptable cost
★ NoSQL provides a tool to develop new
features easily.
★ NoSQL have local data transactions which
do not have to be very durable. e.g. “liking”
items on websites.
Avoid NoSQL
➢If application requires run-time flexibility.
➢If application requires ACID
➢if application requires complicated queries
➢if application requires query language
➢If consistency is mandatory and there will
be no drastic changes in data volume,
relational databases would be a better option
Presentation: mongo db & elasticsearch & membase
What is MongoDB?
★ MongoDB is cross-platform
★ MongoDB is document-oriented database
★ MongoDB is a NoSQL database
★ MongoDB stores data in JSON-like
documents
MongoDB philosophy
Keep functionality when we can
Non-relational makes scaling horizontally
practical
Document models are good
Database technology should run anywhere
VMs, cloud, metal, etc
Use cases for MongoDB
Need of horizontal scaling:
storing in many regular servers
Iterative development:
regular changes of database’s structure
Document-oriented logic:
web page is important than data
Functionality vs Scalability & Performance
Goal: create Web-application for e-commerce
Products: there is no specific products, different
type of products may be sold on webapp
Problem: design database schema
E-commerce: sample problem
Product_Book{
id, name, shipping_info,
price, description,
……….
author,
title,
publisher,
edition,
ISBN
}
Product_Media{
id, name, shipping_info,
price, description,
……….
artist,
title,
track_listing,
label,
format
}
Simple solution: each time create table for specific product type
Problem: very complex code, creating table, rewriting app takes time and
causes errors, items cannot be considered as one item
RELATIONALDATABASE
approach
Product{
id, name, shipping_info,
price, description,
field1_value,
field1_name,
field2_value,
field2_name,
}
Product{
id, name, shipping_info,
price, description,
type,
author,
artist,
track_listing,
ISBN,
}
Set of fields with value and name
Problems: what if there are many
fields, how to find all books
All types of attributes in one table
Problems: new items causes
changes in code and table
RELATIONALDATABASE
approach
Book{
title,
author,
ISBN,
}
Product{
id, name, shipping_info,
price, description,
type (whether book or
media)
}
Creating polymorphic tables
Problems: need extra JOINS, which causes increase of speed
RELATIONALDATABASE
approach
MongoDB rescues
★ Flexible schema
★ Easily searchable
★ Easily accessible
★ Fast
{title: “Matrix”, price: 3500,
details:{actors:[‘Keanu Reaves’,’’K. Zeta Jones’]}}
{title: “Sherlock Holmes”, price: 2100,
details:{ISBN:33002A,author:”Conan Doyle”}}
★ MongoDB stores data in document form
○ Don’t need schema
○ Store in JSON form
○ Datas are edited in application
★ No JOINS
○ Data is loaded in LINEAR time
CRUD operations
Retrieving, creating, updating, deleting operations are done
on application side
There is no SQL queries
if software has many apps (on different platforms) it is BAD.
Because you have to write logic each time
if software has one app it is GOOD.
Because you don’t have to mess with SQL code
MongoDB: java example
//Create
String json = “{‘name’:’Mike’,’surname’:’Smith’}”;
DBObject dbObject = (DBObject)JSON.parse(json);
collection.insert(dbObject);
//Retrieve
db.products.find({‘title’:”The Matrix”});
//Update
BasicDBObject newD = new BasicDBObject();
newD.append("$set",new BasicDBObject().append("clients", 110));
BasicDBObject sq = new BasicDBObject().append("name", "Mike");
collection.update(sq, newD);
ElasticSearch
★ Real-time data
★ Real-time analytics
★ Distributed
★ High-availability
★ Multitenancy
★ Full-text search
★ Document-oriented
★ Schema-free
★ RESTful API
★ Build on top
Apache Lucene
Elasticsearch: important features
Elasticsearch is based on Lucene
Elasticsearch is ready for search of all types
➔Elasticsearch is search engine
➔Elasticsearch is document database
What is Lucene? (small explanation)
Lucene is information retrieval library, which
takes documents and makes them easily
searchable, through:
● indexing
● advanced analysis
● tokenization (indexing mice as mouse)
Lucene creates inverted
index, so that searching in
documents is performed in
linear time
Indexing
Searching terms in
documents without
indexing is
doc.size x no.documents
Don’t do this
Elasticsearch: use case
Elasticsearch is used as:
★ search engines
★ as a search mechanism for web-apps
among main database
○ e.g. E-commerce storing data in MongoDB, while
search data is stored in elasticsearch
★ as a document database
Elasticsearch: REST
Elasticsearch can be
accessed through
REST protocol
#Inserting data
PUT http://localhost:9200/movies/movie/1
{"title": "The Godfather","director":
"Francis Ford Coppola"}
#Getting data
GET http://localhost:9200/movies/movie/1
#Delete data
DELETE http://localhost:90/movies/movie/1
#Searching data
POST http://localhost:9200/_search
"query": {
"query_string": {
"query": "kill"
}
}
Couchbase
Couchbase history
Couchbase was created by combining two
NoSQL databases
Membase + CouchOne (principal players
behind CouchDB) = Couchbase
CouchBase
● Written in: Erlang & C
● Main point: Memcache compatible, but with
persistence and clustering
● Protocol: memcached + extensions
● Very fast (200k+/sec) access of data by key
● Provides memcached-style in-memory
caching buckets
Couchbase
Best used: Any application where low-latency
data access, high concurrency support and
high availability is a requirement.
For example: Low-latency use-cases like ad
targeting or highly-concurrent web apps like
online gaming (e.g. Zynga).
Couchbase
Couchbase store data in key-value or in document form
Couchbase is a key-value store: every Document has a
Key and a Value
Key can be a up to 250 characters
Keys are unique, within a bucket there can be only one key
Values can be JSON, string, numbers, binary blobs, special
positive number
Key-value NOSQL databases
Performance: high
Scalability: high
Flexibility: high
Complexity: none
Advantage:
High speed of response
Disadvantage:
All logic is located in app
Couchbase java example
CouchbaseClient c = new CouchbaseClient(baseURI, "default", "");
long userCounter = c.incr(“user_counter”,1,1);
c.set(“user:”+userCounter,json.toJson(user));
c.set("key", 0, "Hello World");
System.out.println(c.get("key"));
Ad

Recommended

Lightning talk: elasticsearch at Cogenta
Lightning talk: elasticsearch at Cogenta
Yann Cluchey
 
What I learnt: Elastic search & Kibana : introduction, installtion & configur...
What I learnt: Elastic search & Kibana : introduction, installtion & configur...
Rahul K Chauhan
 
BigData, NoSQL & ElasticSearch
BigData, NoSQL & ElasticSearch
Sanura Hettiarachchi
 
Elasticsearch Introduction
Elasticsearch Introduction
Roopendra Vishwakarma
 
ElasticSearch for data mining
ElasticSearch for data mining
William Simms
 
Roaring with elastic search sangam2018
Roaring with elastic search sangam2018
Vinay Kumar
 
Introduction to Elasticsearch
Introduction to Elasticsearch
Bo Andersen
 
Presto at Facebook - Presto Meetup @ Boston (10/6/2015)
Presto at Facebook - Presto Meetup @ Boston (10/6/2015)
Martin Traverso
 
Elasticsearch Arcihtecture & What's New in Version 5
Elasticsearch Arcihtecture & What's New in Version 5
Burak TUNGUT
 
ELK - Stack - Munich .net UG
ELK - Stack - Munich .net UG
Steve Behrendt
 
Introduction to ELK
Introduction to ELK
Harshakumar Ummerpillai
 
quick intro to elastic search
quick intro to elastic search
medcl
 
Interactive learning analytics dashboards with ELK (Elasticsearch Logstash Ki...
Interactive learning analytics dashboards with ELK (Elasticsearch Logstash Ki...
Andrii Vozniuk
 
Log analysis using Logstash,ElasticSearch and Kibana
Log analysis using Logstash,ElasticSearch and Kibana
Avinash Ramineni
 
Elastic Stack Introduction
Elastic Stack Introduction
Vikram Shinde
 
The Ultimate Logging Architecture - You KNOW you want it!
The Ultimate Logging Architecture - You KNOW you want it!
Michele Leroux Bustamante
 
Intro to elasticsearch
Intro to elasticsearch
Joey Wen
 
Deep Dive on ArangoDB
Deep Dive on ArangoDB
Max Neunhöffer
 
Elastic stack Presentation
Elastic stack Presentation
Amr Alaa Yassen
 
Elasticsearch
Elasticsearch
Andrii Gakhov
 
Fluentd and Docker - running fluentd within a docker container
Fluentd and Docker - running fluentd within a docker container
Treasure Data, Inc.
 
Big Data Overview Part 1
Big Data Overview Part 1
William Simms
 
Elastic - ELK, Logstash & Kibana
Elastic - ELK, Logstash & Kibana
SpringPeople
 
tdtechtalk20160330johan
tdtechtalk20160330johan
Johan Gustavsson
 
Log analysis with the elk stack
Log analysis with the elk stack
Vikrant Chauhan
 
Presto Meetup 2016 Small Start
Presto Meetup 2016 Small Start
Hiroshi Toyama
 
Log analytics with ELK stack
Log analytics with ELK stack
AWS User Group Bengaluru
 
Methods of NoSQL database systems benchmarking
Methods of NoSQL database systems benchmarking
Транслируем.бел
 
Benchmarking MongoDB and CouchBase
Benchmarking MongoDB and CouchBase
Christopher Choi
 
PPC for ecommerce websites
PPC for ecommerce websites
Luke Glassford
 

More Related Content

What's hot (19)

Elasticsearch Arcihtecture & What's New in Version 5
Elasticsearch Arcihtecture & What's New in Version 5
Burak TUNGUT
 
ELK - Stack - Munich .net UG
ELK - Stack - Munich .net UG
Steve Behrendt
 
Introduction to ELK
Introduction to ELK
Harshakumar Ummerpillai
 
quick intro to elastic search
quick intro to elastic search
medcl
 
Interactive learning analytics dashboards with ELK (Elasticsearch Logstash Ki...
Interactive learning analytics dashboards with ELK (Elasticsearch Logstash Ki...
Andrii Vozniuk
 
Log analysis using Logstash,ElasticSearch and Kibana
Log analysis using Logstash,ElasticSearch and Kibana
Avinash Ramineni
 
Elastic Stack Introduction
Elastic Stack Introduction
Vikram Shinde
 
The Ultimate Logging Architecture - You KNOW you want it!
The Ultimate Logging Architecture - You KNOW you want it!
Michele Leroux Bustamante
 
Intro to elasticsearch
Intro to elasticsearch
Joey Wen
 
Deep Dive on ArangoDB
Deep Dive on ArangoDB
Max Neunhöffer
 
Elastic stack Presentation
Elastic stack Presentation
Amr Alaa Yassen
 
Elasticsearch
Elasticsearch
Andrii Gakhov
 
Fluentd and Docker - running fluentd within a docker container
Fluentd and Docker - running fluentd within a docker container
Treasure Data, Inc.
 
Big Data Overview Part 1
Big Data Overview Part 1
William Simms
 
Elastic - ELK, Logstash & Kibana
Elastic - ELK, Logstash & Kibana
SpringPeople
 
tdtechtalk20160330johan
tdtechtalk20160330johan
Johan Gustavsson
 
Log analysis with the elk stack
Log analysis with the elk stack
Vikrant Chauhan
 
Presto Meetup 2016 Small Start
Presto Meetup 2016 Small Start
Hiroshi Toyama
 
Log analytics with ELK stack
Log analytics with ELK stack
AWS User Group Bengaluru
 
Elasticsearch Arcihtecture & What's New in Version 5
Elasticsearch Arcihtecture & What's New in Version 5
Burak TUNGUT
 
ELK - Stack - Munich .net UG
ELK - Stack - Munich .net UG
Steve Behrendt
 
quick intro to elastic search
quick intro to elastic search
medcl
 
Interactive learning analytics dashboards with ELK (Elasticsearch Logstash Ki...
Interactive learning analytics dashboards with ELK (Elasticsearch Logstash Ki...
Andrii Vozniuk
 
Log analysis using Logstash,ElasticSearch and Kibana
Log analysis using Logstash,ElasticSearch and Kibana
Avinash Ramineni
 
Elastic Stack Introduction
Elastic Stack Introduction
Vikram Shinde
 
The Ultimate Logging Architecture - You KNOW you want it!
The Ultimate Logging Architecture - You KNOW you want it!
Michele Leroux Bustamante
 
Intro to elasticsearch
Intro to elasticsearch
Joey Wen
 
Elastic stack Presentation
Elastic stack Presentation
Amr Alaa Yassen
 
Fluentd and Docker - running fluentd within a docker container
Fluentd and Docker - running fluentd within a docker container
Treasure Data, Inc.
 
Big Data Overview Part 1
Big Data Overview Part 1
William Simms
 
Elastic - ELK, Logstash & Kibana
Elastic - ELK, Logstash & Kibana
SpringPeople
 
Log analysis with the elk stack
Log analysis with the elk stack
Vikrant Chauhan
 
Presto Meetup 2016 Small Start
Presto Meetup 2016 Small Start
Hiroshi Toyama
 

Viewers also liked (17)

Methods of NoSQL database systems benchmarking
Methods of NoSQL database systems benchmarking
Транслируем.бел
 
Benchmarking MongoDB and CouchBase
Benchmarking MongoDB and CouchBase
Christopher Choi
 
PPC for ecommerce websites
PPC for ecommerce websites
Luke Glassford
 
UX mockups for an advanced search
UX mockups for an advanced search
Alvaro Lourenço
 
Improving UX checkout
Improving UX checkout
Myriam Jessier
 
Maximizing ROI in eCommerce with Search
Maximizing ROI in eCommerce with Search
iProspect Canada
 
UX: internal search for e-commerce
UX: internal search for e-commerce
Myriam Jessier
 
Data Science and Machine Learning for eCommerce and Retail
Data Science and Machine Learning for eCommerce and Retail
Andrei Lopatenko
 
Machine Learning for retail and ecommerce
Machine Learning for retail and ecommerce
Andrei Lopatenko
 
NoSQL into E-Commerce: lessons learned
NoSQL into E-Commerce: lessons learned
La FeWeb
 
Intro to Elasticsearch
Intro to Elasticsearch
Clifford James
 
Webinar: OpenNLP and Solr for Superior Relevance
Webinar: OpenNLP and Solr for Superior Relevance
Lucidworks
 
Tuning Elasticsearch Indexing Pipeline for Logs
Tuning Elasticsearch Indexing Pipeline for Logs
Sematext Group, Inc.
 
E commerce search strategies how faceted navigation and apache solr lucene op...
E commerce search strategies how faceted navigation and apache solr lucene op...
Lucidworks (Archived)
 
Surprising failure factors when implementing eCommerce and Omnichannel eBusiness
Surprising failure factors when implementing eCommerce and Omnichannel eBusiness
Divante
 
Magento scalability from the trenches (Meet Magento Sweden 2016)
Magento scalability from the trenches (Meet Magento Sweden 2016)
Divante
 
Omnichannel Customer Experience
Omnichannel Customer Experience
Divante
 
Benchmarking MongoDB and CouchBase
Benchmarking MongoDB and CouchBase
Christopher Choi
 
PPC for ecommerce websites
PPC for ecommerce websites
Luke Glassford
 
UX mockups for an advanced search
UX mockups for an advanced search
Alvaro Lourenço
 
Maximizing ROI in eCommerce with Search
Maximizing ROI in eCommerce with Search
iProspect Canada
 
UX: internal search for e-commerce
UX: internal search for e-commerce
Myriam Jessier
 
Data Science and Machine Learning for eCommerce and Retail
Data Science and Machine Learning for eCommerce and Retail
Andrei Lopatenko
 
Machine Learning for retail and ecommerce
Machine Learning for retail and ecommerce
Andrei Lopatenko
 
NoSQL into E-Commerce: lessons learned
NoSQL into E-Commerce: lessons learned
La FeWeb
 
Intro to Elasticsearch
Intro to Elasticsearch
Clifford James
 
Webinar: OpenNLP and Solr for Superior Relevance
Webinar: OpenNLP and Solr for Superior Relevance
Lucidworks
 
Tuning Elasticsearch Indexing Pipeline for Logs
Tuning Elasticsearch Indexing Pipeline for Logs
Sematext Group, Inc.
 
E commerce search strategies how faceted navigation and apache solr lucene op...
E commerce search strategies how faceted navigation and apache solr lucene op...
Lucidworks (Archived)
 
Surprising failure factors when implementing eCommerce and Omnichannel eBusiness
Surprising failure factors when implementing eCommerce and Omnichannel eBusiness
Divante
 
Magento scalability from the trenches (Meet Magento Sweden 2016)
Magento scalability from the trenches (Meet Magento Sweden 2016)
Divante
 
Omnichannel Customer Experience
Omnichannel Customer Experience
Divante
 
Ad

Similar to Presentation: mongo db & elasticsearch & membase (20)

No sql databases
No sql databases
Walaa Hamdy Assy
 
NoSQL
NoSQL
Radu Vunvulea
 
MongoDB Basics
MongoDB Basics
Sarang Shravagi
 
Nosql seminar
Nosql seminar
Shreyashkumar Nangnurwar
 
Which Questions We Should Have
Which Questions We Should Have
Oracle Korea
 
MongoDB
MongoDB
Rony Gregory
 
Nosql part1 8th December
Nosql part1 8th December
Ruru Chowdhury
 
NoSql - mayank singh
NoSql - mayank singh
Mayank Singh
 
No sq lv1_0
No sq lv1_0
Tuan Luong
 
CouchBase The Complete NoSql Solution for Big Data
CouchBase The Complete NoSql Solution for Big Data
Debajani Mohanty
 
MongoDB Lab Manual (1).pdf used in data science
MongoDB Lab Manual (1).pdf used in data science
bitragowthamkumar1
 
Mongo Bb - NoSQL tutorial
Mongo Bb - NoSQL tutorial
Mohan Rathour
 
NoSQL and CouchDB: the view from MOO
NoSQL and CouchDB: the view from MOO
James Hollingworth
 
Couch db
Couch db
arunamore
 
Couch db
Couch db
Rashmi Agale
 
NoSQL Basics and MongDB
NoSQL Basics and MongDB
Shamima Yeasmin Mukta
 
Couchbase Overview Nov 2013
Couchbase Overview Nov 2013
Jeff Harris
 
NoSQL in the context of Social Web
NoSQL in the context of Social Web
Bogdan Gaza
 
CouchDB
CouchDB
Rashmi Agale
 
MongoDB at CodeMash 2.0.1.0
MongoDB at CodeMash 2.0.1.0
Mike Dirolf
 
Ad

Recently uploaded (20)

MOVIE RECOMMENDATION SYSTEM, UDUMULA GOPI REDDY, Y24MC13085.pptx
MOVIE RECOMMENDATION SYSTEM, UDUMULA GOPI REDDY, Y24MC13085.pptx
Maharshi Mallela
 
DevOps for AI: running LLMs in production with Kubernetes and KubeFlow
DevOps for AI: running LLMs in production with Kubernetes and KubeFlow
Aarno Aukia
 
OpenTelemetry 101 Cloud Native Barcelona
OpenTelemetry 101 Cloud Native Barcelona
Imma Valls Bernaus
 
Enable Your Cloud Journey With Microsoft Trusted Partner | IFI Tech
Enable Your Cloud Journey With Microsoft Trusted Partner | IFI Tech
IFI Techsolutions
 
Wondershare PDFelement Pro 11.4.20.3548 Crack Free Download
Wondershare PDFelement Pro 11.4.20.3548 Crack Free Download
Puppy jhon
 
Application Modernization with Choreo - The AI-Native Internal Developer Plat...
Application Modernization with Choreo - The AI-Native Internal Developer Plat...
WSO2
 
Transmission Media. (Computer Networks)
Transmission Media. (Computer Networks)
S Pranav (Deepu)
 
Shell Skill Tree - LabEx Certification (LabEx)
Shell Skill Tree - LabEx Certification (LabEx)
VICTOR MAESTRE RAMIREZ
 
Zoneranker’s Digital marketing solutions
Zoneranker’s Digital marketing solutions
reenashriee
 
SAP Datasphere Catalog L2 (2024-02-07).pptx
SAP Datasphere Catalog L2 (2024-02-07).pptx
HimanshuSachdeva46
 
Reimagining Software Development and DevOps with Agentic AI
Reimagining Software Development and DevOps with Agentic AI
Maxim Salnikov
 
dp-700 exam questions sample docume .pdf
dp-700 exam questions sample docume .pdf
pravkumarbiz
 
Women in Tech: Marketo Engage User Group - June 2025 - AJO with AWS
Women in Tech: Marketo Engage User Group - June 2025 - AJO with AWS
BradBedford3
 
Code and No-Code Journeys: The Coverage Overlook
Code and No-Code Journeys: The Coverage Overlook
Applitools
 
How the US Navy Approaches DevSecOps with Raise 2.0
How the US Navy Approaches DevSecOps with Raise 2.0
Anchore
 
What is data visualization and how data visualization tool can help.pptx
What is data visualization and how data visualization tool can help.pptx
Varsha Nayak
 
Smadav Pro 2025 Rev 15.4 Crack Full Version With Registration Key
Smadav Pro 2025 Rev 15.4 Crack Full Version With Registration Key
joybepari360
 
Integrating Survey123 and R&H Data Using FME
Integrating Survey123 and R&H Data Using FME
Safe Software
 
About Certivo | Intelligent Compliance Solutions for Global Regulatory Needs
About Certivo | Intelligent Compliance Solutions for Global Regulatory Needs
certivoai
 
Migrating to Azure Cosmos DB the Right Way
Migrating to Azure Cosmos DB the Right Way
Alexander (Alex) Komyagin
 
MOVIE RECOMMENDATION SYSTEM, UDUMULA GOPI REDDY, Y24MC13085.pptx
MOVIE RECOMMENDATION SYSTEM, UDUMULA GOPI REDDY, Y24MC13085.pptx
Maharshi Mallela
 
DevOps for AI: running LLMs in production with Kubernetes and KubeFlow
DevOps for AI: running LLMs in production with Kubernetes and KubeFlow
Aarno Aukia
 
OpenTelemetry 101 Cloud Native Barcelona
OpenTelemetry 101 Cloud Native Barcelona
Imma Valls Bernaus
 
Enable Your Cloud Journey With Microsoft Trusted Partner | IFI Tech
Enable Your Cloud Journey With Microsoft Trusted Partner | IFI Tech
IFI Techsolutions
 
Wondershare PDFelement Pro 11.4.20.3548 Crack Free Download
Wondershare PDFelement Pro 11.4.20.3548 Crack Free Download
Puppy jhon
 
Application Modernization with Choreo - The AI-Native Internal Developer Plat...
Application Modernization with Choreo - The AI-Native Internal Developer Plat...
WSO2
 
Transmission Media. (Computer Networks)
Transmission Media. (Computer Networks)
S Pranav (Deepu)
 
Shell Skill Tree - LabEx Certification (LabEx)
Shell Skill Tree - LabEx Certification (LabEx)
VICTOR MAESTRE RAMIREZ
 
Zoneranker’s Digital marketing solutions
Zoneranker’s Digital marketing solutions
reenashriee
 
SAP Datasphere Catalog L2 (2024-02-07).pptx
SAP Datasphere Catalog L2 (2024-02-07).pptx
HimanshuSachdeva46
 
Reimagining Software Development and DevOps with Agentic AI
Reimagining Software Development and DevOps with Agentic AI
Maxim Salnikov
 
dp-700 exam questions sample docume .pdf
dp-700 exam questions sample docume .pdf
pravkumarbiz
 
Women in Tech: Marketo Engage User Group - June 2025 - AJO with AWS
Women in Tech: Marketo Engage User Group - June 2025 - AJO with AWS
BradBedford3
 
Code and No-Code Journeys: The Coverage Overlook
Code and No-Code Journeys: The Coverage Overlook
Applitools
 
How the US Navy Approaches DevSecOps with Raise 2.0
How the US Navy Approaches DevSecOps with Raise 2.0
Anchore
 
What is data visualization and how data visualization tool can help.pptx
What is data visualization and how data visualization tool can help.pptx
Varsha Nayak
 
Smadav Pro 2025 Rev 15.4 Crack Full Version With Registration Key
Smadav Pro 2025 Rev 15.4 Crack Full Version With Registration Key
joybepari360
 
Integrating Survey123 and R&H Data Using FME
Integrating Survey123 and R&H Data Using FME
Safe Software
 
About Certivo | Intelligent Compliance Solutions for Global Regulatory Needs
About Certivo | Intelligent Compliance Solutions for Global Regulatory Needs
certivoai
 

Presentation: mongo db & elasticsearch & membase

  • 1. MongoDB ElasticSearch Couchbase Prepared by: Shalkarbayuly A. (PhD student) Presentation was prepared for “Database Management” course as a part of PhD program in Turgut Ozal University
  • 2. 1. NoSQL databases 2. MongoDB 3. ElasticSearch 4. Couchbase
  • 4. NoSQL databases NOSQL sometimes stands for Not Only SQL NOSQL is mechanism for storage and retrieval of data other than tabular data Motivations are simplicity of design, horizontal scaling, control over availability
  • 5. Problems of RD solved by NoSQL ★ RD will not scale to your traffic at an acceptable cost ★ NoSQL provides a tool to develop new features easily. ★ NoSQL have local data transactions which do not have to be very durable. e.g. “liking” items on websites.
  • 6. Avoid NoSQL ➢If application requires run-time flexibility. ➢If application requires ACID ➢if application requires complicated queries ➢if application requires query language ➢If consistency is mandatory and there will be no drastic changes in data volume, relational databases would be a better option
  • 8. What is MongoDB? ★ MongoDB is cross-platform ★ MongoDB is document-oriented database ★ MongoDB is a NoSQL database ★ MongoDB stores data in JSON-like documents
  • 9. MongoDB philosophy Keep functionality when we can Non-relational makes scaling horizontally practical Document models are good Database technology should run anywhere VMs, cloud, metal, etc
  • 10. Use cases for MongoDB Need of horizontal scaling: storing in many regular servers Iterative development: regular changes of database’s structure Document-oriented logic: web page is important than data
  • 12. Goal: create Web-application for e-commerce Products: there is no specific products, different type of products may be sold on webapp Problem: design database schema E-commerce: sample problem
  • 13. Product_Book{ id, name, shipping_info, price, description, ………. author, title, publisher, edition, ISBN } Product_Media{ id, name, shipping_info, price, description, ………. artist, title, track_listing, label, format } Simple solution: each time create table for specific product type Problem: very complex code, creating table, rewriting app takes time and causes errors, items cannot be considered as one item RELATIONALDATABASE approach
  • 14. Product{ id, name, shipping_info, price, description, field1_value, field1_name, field2_value, field2_name, } Product{ id, name, shipping_info, price, description, type, author, artist, track_listing, ISBN, } Set of fields with value and name Problems: what if there are many fields, how to find all books All types of attributes in one table Problems: new items causes changes in code and table RELATIONALDATABASE approach
  • 15. Book{ title, author, ISBN, } Product{ id, name, shipping_info, price, description, type (whether book or media) } Creating polymorphic tables Problems: need extra JOINS, which causes increase of speed RELATIONALDATABASE approach
  • 16. MongoDB rescues ★ Flexible schema ★ Easily searchable ★ Easily accessible ★ Fast
  • 17. {title: “Matrix”, price: 3500, details:{actors:[‘Keanu Reaves’,’’K. Zeta Jones’]}} {title: “Sherlock Holmes”, price: 2100, details:{ISBN:33002A,author:”Conan Doyle”}} ★ MongoDB stores data in document form ○ Don’t need schema ○ Store in JSON form ○ Datas are edited in application ★ No JOINS ○ Data is loaded in LINEAR time
  • 18. CRUD operations Retrieving, creating, updating, deleting operations are done on application side There is no SQL queries if software has many apps (on different platforms) it is BAD. Because you have to write logic each time if software has one app it is GOOD. Because you don’t have to mess with SQL code
  • 19. MongoDB: java example //Create String json = “{‘name’:’Mike’,’surname’:’Smith’}”; DBObject dbObject = (DBObject)JSON.parse(json); collection.insert(dbObject); //Retrieve db.products.find({‘title’:”The Matrix”}); //Update BasicDBObject newD = new BasicDBObject(); newD.append("$set",new BasicDBObject().append("clients", 110)); BasicDBObject sq = new BasicDBObject().append("name", "Mike"); collection.update(sq, newD);
  • 20. ElasticSearch ★ Real-time data ★ Real-time analytics ★ Distributed ★ High-availability ★ Multitenancy ★ Full-text search ★ Document-oriented ★ Schema-free ★ RESTful API ★ Build on top Apache Lucene
  • 21. Elasticsearch: important features Elasticsearch is based on Lucene Elasticsearch is ready for search of all types ➔Elasticsearch is search engine ➔Elasticsearch is document database
  • 22. What is Lucene? (small explanation) Lucene is information retrieval library, which takes documents and makes them easily searchable, through: ● indexing ● advanced analysis ● tokenization (indexing mice as mouse)
  • 23. Lucene creates inverted index, so that searching in documents is performed in linear time Indexing Searching terms in documents without indexing is doc.size x no.documents Don’t do this
  • 24. Elasticsearch: use case Elasticsearch is used as: ★ search engines ★ as a search mechanism for web-apps among main database ○ e.g. E-commerce storing data in MongoDB, while search data is stored in elasticsearch ★ as a document database
  • 25. Elasticsearch: REST Elasticsearch can be accessed through REST protocol #Inserting data PUT http://localhost:9200/movies/movie/1 {"title": "The Godfather","director": "Francis Ford Coppola"} #Getting data GET http://localhost:9200/movies/movie/1 #Delete data DELETE http://localhost:90/movies/movie/1 #Searching data POST http://localhost:9200/_search "query": { "query_string": { "query": "kill" } }
  • 27. Couchbase history Couchbase was created by combining two NoSQL databases Membase + CouchOne (principal players behind CouchDB) = Couchbase
  • 28. CouchBase ● Written in: Erlang & C ● Main point: Memcache compatible, but with persistence and clustering ● Protocol: memcached + extensions ● Very fast (200k+/sec) access of data by key ● Provides memcached-style in-memory caching buckets
  • 29. Couchbase Best used: Any application where low-latency data access, high concurrency support and high availability is a requirement. For example: Low-latency use-cases like ad targeting or highly-concurrent web apps like online gaming (e.g. Zynga).
  • 30. Couchbase Couchbase store data in key-value or in document form Couchbase is a key-value store: every Document has a Key and a Value Key can be a up to 250 characters Keys are unique, within a bucket there can be only one key Values can be JSON, string, numbers, binary blobs, special positive number
  • 31. Key-value NOSQL databases Performance: high Scalability: high Flexibility: high Complexity: none Advantage: High speed of response Disadvantage: All logic is located in app
  • 32. Couchbase java example CouchbaseClient c = new CouchbaseClient(baseURI, "default", ""); long userCounter = c.incr(“user_counter”,1,1); c.set(“user:”+userCounter,json.toJson(user)); c.set("key", 0, "Hello World"); System.out.println(c.get("key"));