back to basics webinar 1: introduction to nosql

Download Back to Basics Webinar 1: Introduction to NoSQL

If you can't read please download the document

Upload: mongodb

Post on 14-Apr-2017

4.297 views

Category:

Data & Analytics


1 download

TRANSCRIPT

PowerPoint Presentation

Back to Basics 2017 : Webinar 1

Introduction to NoSQLJoe DrumgooleDirector of Developer Advocacy, EMEAMongoDB@jdrumgoole

V1.3

Who I am, how long have I been at MongoDB. 2

Welcome!

Delighted to have you here. Hope you can make it to all the sessions. Sessions will be recorded so we can send them out afterwards so dont worry if you miss one.

If you have questions please pop them in the sidebar. 3

Course AgendaDateTimeWebinar19-Jan-201715:00 GMTIntroduction to NoSQL26-Jan-201715:00 GMTYour First MongoDB Application02-Feb-201711:00 GMTIntroduction to Replica Sets09-Feb-201711:00 GMTIntroduction to Sharding

#

Agenda for TodayWhy NoSQLThe different types of NoSQL databaseDetailed overview of MongoDBQ&A

#

RelationalExpressive Query Language& Secondary IndexesStrong ConsistencyEnterprise Management& Integrations

#

A lot of people expect us to come in and bash relational database or say we dont think theyre good. And thats simply not true.

Relational databases has laid the foundation for what youd want out of a database, and we absolutely think there are capabilities that remain critical today

Expressive query language & secondary Indexes. Users should be able to access and manipulate their data in sophisticated ways and you need a query language that lets you do all that out of the box. Indexes are a critical part of providing efficient access to data. We believe these are table stakes for a database.

Strong consistency. Strong consistency has become second nature for how we think about building applications, and for good reason. The database should always provide access to the most up-to-date copy of the data. Strong consistency is the right way to design a database.

Enterprise Management and Integrations. Finally, databases are just one piece of the puzzle, and they need to fit into the enterprise IT stack. Organizations need a database that can be secured, monitored, automated, and integrated with their existing IT infrastructure and staff, such as operations teams, DBAs, and data analysts.6

The World Has Changed

DataRiskTimeCost

#

But of course the world has changed a lot since the 1980s when the relational database first came about.

First of all, data and risk are significantly up.

In terms of data90% data created in last 2 years - think about that for a moment, of all the data ever created, 90% of it was in the last 2 years80% of enterprise data is unstructured - this is data that doesnt fit into the neat tables of a relational databaseUnstructured data is growing 2X rate of structured data

At the same time, risks of running a database are higher than ever before. You are now faced with:More users - Apps have shifted from small internal departmental system with thousands of users to large external audiences with millions of usersNo downtime - Its no longer the case that apps only need to be available during standard business hours. They must be up 24/7. All across the globe - your users are everywhere, and they are always connected

On the other hand, time and costs are way down.

Theres less time to build apps than ever before. Youre being asked to:Ship apps in a few months not years - Development methods have shifted from a waterfall process to an iterative process that ships new functionality in weeks and in some cases multiple times per day at companies like Facebook and Amazon.

And costs are way down too. Companies want to:Pay for value over time - Companies have shifted to open-source business and SaaS models that allow them to pay for value over timeUse cloud and commodity resources - to reduce the time to provision their infrastructure, and to lower their total cost of ownership7

NoSQL

Scalability& PerformanceAlways On,Global DeploymentsFlexibility

Expressive Query Language& Secondary IndexesStrong ConsistencyEnterprise Management& Integrations

#

Because the relational database was not designed for modern applications, starting about 10 years ago a number of companies began to build their own databases that are fundamentally different. The market calls these NoSQL.

NoSQL databases were designed for this new world

Flexibility. All of them have some kind of flexible data model to allow for faster iteration and to accommodate the data we see dominating modern applications. While they all have different approaches, what they have in common is they want to be more flexible.

Scalability + Performance. Similarly, they were all built with a focus on scalability, so they all include some form of sharding or partitioning. And they're all designed to deliver great performance. Some are better at reads, some are better at writes, but more or less they all strive to have better performance than a relational database.

Always-On Global Deployments. Lastly, NoSQL databases are designed for highly available systems that provide a consistent, high quality experience for users all over the world. They are designed to run on many computers, and they include replication to automatically synchronize the data across servers, racks, and data centers.

However, when you take a closer look at these NoSQL systems, it turns out they have thrown out the baby with the bathwater. They have sacrificed the core database capabilities youve come to expect and rely on in order to build fully functional apps, like rich querying and secondary indexes, strong consistency, and enterprise management.8

Nexus ArchitectureScalability& PerformanceAlways On,Global DeploymentsFlexibility

Expressive Query Language& Secondary IndexesStrong ConsistencyEnterprise Management& Integrations

#

MongoDB was built to address the way the world has changed while preserving the core database capabilities required to build modern applications.

Our vision is to leverage the work that Oracle and others have done over the last 40 years to make relational databases what they are today, and to take the reins from here. We pick up where they left off, incorporating the work that internet pioneers like Google and Amazon did to address the requirements of modern applications.

MongoDB is the only database that harnesses the innovations of NoSQL and maintains the foundation of relational databases and we call this our Nexus Architecture.

9

Types of NoSQL DatabaseKey/Value StoresColumn StoresGraph StoresMulti-model DatabasesDocument Stores

#

Key Value StoresAn associative arraySingle key lookupVery fast single key lookupNot so hot for reverse lookupsKey Value123454567.345678712346{ addr1 : The Grange, addr2: Dublin }12347top secret password12358Shopping basket value : 245601278712345

#

Think redis, memcached or Couchbase. 11

Revision : Row Stores (RDBMS)Store data aligned by rows (traditional RDBMS, e.g MySQL)Reads retrieve a complete row everytimeReads requiring only one or two columns are wasteful

IDNameSalaryStart Date1Joe D$240001/Jun/19702Peter J$280001/Feb/19723Phil G$230001/Jan/1973

1Joe D$240001/Jun/1970

2Peter J$280001/Feb/1972

3Phil G$230001/Jan/1973

#

How a Column Store Does it123

IDNameSalaryStart Date1Joe D$240001/Jun/19702Peter J$280001/Feb/19723Phil G$230001/Jan/1973

Joe DPeter JPhil G

$24000$28000$23000

1/Jun/19701/Feb/19721/Jan/1973

#

Why is this Attractive?A series of consecutive seeks can retrieve a column efficientlyCompressing similar data is super efficientHow do I align my rows? By order or by inserting a row IDIF you just need a small number of columns you dont need to read all the rowsBut: Updating and deleting by row is expensiveAppend only is preferredBetter for OLAP than OLTP

#

Column stores you know and love, HP Vertica, Cassandra. 14

Graph StoresStore graphs (edges and vertexes)E.g. social networksDesigned to allow efficient traversalOptimised for representing connectionsCan be implemented as a key value stored with the ability to store linksMongoDB 3.4 supports graph queries

#

Multi-Model DatabasesCombine multiple storage/access modelsOften Graph plus something elseFixes the polyglot persistence issue of keeping multiple independent databases consistentThe new new thing in NoSQL LandMongoDB is a "multi-modal" document storeGraphGeo-SpatialB-treeFull Text

#

No copies of data for multi-modal16

Document StoreNot PDFs, Microsoft Word or HTMLDocuments are nested structures created using Javascript Object Notation (JSON)

{ name : Joe Drumgoole,title : Director of Developer Advocacy,Address : {address1 : Latin Hall,address2 : Golden Lane,eircode : D09 N623,}expertise: [ MongoDB, Python, Javascript ],employee_number : 320,location : [ 53.34, -6.26 ]}

#

MongoDB Documents are Typed{ name : Joe Drumgoole,title : Director of Developer Advocacy,Address : {address1 : Latin Hall,address2 : Golden Lane,eircode : D09 N623,}expertise: [ MongoDB, Python, Javascript ],employee_number : 320,location : [ 53.34, -6.26 ]}

StringsNested DocumentArrayIntegerGeo-spatial Coordinates

#

MongoDB Understands JSON DocumentsFrom the very first version it was a native JSON databaseUnderstands and can index the sub-structuresStores JSON as a binary format called BSONEfficient for encoding and decoding for network transmissionMongoDB can create indexes on any document field(We will cover these areas in detail later on in the course)

#

Why Documents?Dynamic SchemaElimination of Object/Relational Mapping LayerImplicit denormalisation of the data for performance

#

Why Documents?Dynamic SchemaElimination of Object/Relational Mapping LayerImplicit denormalisation of the data for performance

#

Aggregation Framework

#

Pipeline Operators $matchFilter documents

$projectReshape documents

$groupSummarize documents

$outCreate new collections $sortOrder documents

$limit/$skipPaginate documents

$lookupJoin two collections together

$unwindExpand an array

#

Instant Start with Compass and Atlas

CompassAtlas

#

Next Webinar Your First MongoDB Application26th Jan 2017 15:00 GMT.Learn how to build your first MongoDB applicationCreate databases and collectionsLook at queriesBuild indexesStart to understand performanceRegister at https://www.mongodb.com/webinar/back-to-basics-webinar-seriesSend feedback to [email protected]

#

What's Next?Sign up for an online course: https://university.mongodb.com/Join a MUG: https://www.meetup.com/pro/mongodb/

#

Q&A