67
Marco Parenzan Microsoft Azure MVP @marco_parenzan marco [dot] parenzan [at] 1nn0va [dot] it

Perchè un programmatore ama anche i database NoSQL

Embed Size (px)

Citation preview

Marco Parenzan

Microsoft Azure MVP

@marco_parenzan

marco [dot] parenzan [at] 1nn0va [dot] it

Speaker info/Marco Parenzan

www.slideshare.net/marco.parenzan

www.github.com/marcoparenzan

marco [dot] parenzan [at] 1nn0va [dot] it

www.innovazionefvg.net

www.facebook.com/1nn0va

@marco_parenzan

Formazione ,Divulgazione e Consulenza con 1nn0va

Microsoft MVP 2015 for Microsoft Azure

Cloud Architect, NET developer

Loves Html5 Game Programming and Internet of Things

Polyglot Programmer

MVC

Browser

MVVM

View

View

View

Backend Presentation

Backend Public Access

Controller API

Business Logic

Data Access

Presentation

Contract DA/BL

Contract BL/P

«Monoglot» Data User

Set-theory-basedTwo-dimensional relations (or tables)

Tables have columnsColumn data is strongly typed, types enforced by system

Projections (SELECT…)

Tables have tuples (or rows)Selections (WHERE…)

Cartesian products (JOIN …)

Robust, stable, years of proving itself

Homogeneous data conforms to a structured / rigid

schema

Flexible query-ability

Very consistent & durable data

ACID transactions

Impedance mismatch (ORM mapping)

Requirement for flexible data

(Typically) Scale up

Cloud Citizen

http://azure.microsoft.com/en-us/documentation/infographics/azure/

PaaSAzure SQL Database

MySQL

IaaSSQL Server on VMs

Oracle Database

MySQL

PostgreSQL

And so many more ….

http://azure.microsoft.com/en-us/documentation/infographics/cloud-design-patterns/

https://msdn.microsoft.com/en-us/library/dn568099.aspx

Some Facts

“all the information created, replicated, and consumed in a

single year,” the number has grown from 130 billion

gigabytes in 2010 to 2.8 trillion gigabytes in 2012.

SmartTVs, Personal Fitness Trackers, Fridges, Hot Tubs,

Toasters, Industrial applications, Connected Cars, Home

sensors & automation, Manufacturing, Agriculture, Medical

etc. etc. etc.

What is NoSQL?

Issues of a

CRUD model

MVC

Data Session

Controller

View

Business

Logic

Mo

del

Contracts and

View Models

For this kind of document -

{

“id": “13244_user",

"firstName": "John",

"lastName": "Smith",

"age": 25,

"address":

{

"streetAddress": "21 2nd Str",

"city": "New York",

"state": "NY",

"postalCode": "10021"

},

“mobileNumber": "212 555-1234"

}

Part of the NoSQL family of databases

Built for simplicity, scale and performance

Non-relational, no schema enforced

Flexible query options

Promotes code first development

Resilient to iterative schema changes

Richer query and indexing (compared to KV stores)

Low impedance as object / JSON store; no ORM required

It just works

It’s fast (to get going, and in txs)

Mobile and Web apps – metadata for content oriented

apps

User data store – user profile and behavior data

IoT scenarios – queryable device and event store

Event workflow and logging

Data ingestion and presentation – ingesting data with

variable schema with rich views over the data

Product catalogs

Complex relational data

Complex map/reduce aggregations

Distributed transactions

OLAP

PaaSAzure DocumentDB

MongoLab, MongoDB Inc, MongoHQ

RavenHQ

IaasMongoDB

CouchDB

Couchbase

ArangoDB

And countless more …

Stale Data

Application

Responsiveness

Competing Consumers patternall consumers read from same stream (queue)

Message consumed by a single consumer

Service Bus: A layer of abstraction between clients and

services to relay inputs and outputs.

Inputs and outputs are “Messages”

Messages are persisted quickly

Messages are asynchronous by their nature

Messages are still there even if processing goes offline

Messages that can’t be processed can be replayed later

Queued access to DB

Insert

Update

Insert

Delete

DBCustomer

ActivitiesData Persistence

Responsibility

CQRS

Event Handler

UI

Event

Command Handler

Eve

nt

Device

Queue

Topics/Subscription

Event Hub

Write

ModelSearch

Model

Read

Model

Publish/Subscribe patterneach consumer reads from its subscription (a copy of message on related topic)

Message consumed by more subscribers (use filters)

Subs

Partitioned Consumers pattern

Marco Parenzan

Microsoft Azure MVP

@marco_parenzan

marco [dot] parenzan [at] 1nn0va [dot] it