atam for nosql database selection - sei digital … · atam for nosql database selection. using...

43
ATAM for NoSQL Database Selection Using Architecture (Not Products) to Guide Database Selection Dan McCreary Kelly-McCreary & Associates

Upload: vuongnguyet

Post on 01-Aug-2018

236 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ATAM for NoSQL Database Selection - SEI Digital … · ATAM for NoSQL Database Selection. Using Architecture (Not Products) to Guide Database Selection. Dan McCreary. ... weigh the

ATAM for NoSQL Database Selection

Using Architecture (Not Products) to Guide Database Selection

Dan McCrearyKelly-McCreary & Associates

Page 2: ATAM for NoSQL Database Selection - SEI Digital … · ATAM for NoSQL Database Selection. Using Architecture (Not Products) to Guide Database Selection. Dan McCreary. ... weigh the

New NoSQL databases offer more options to the database architect. Selecting the right NoSQL database for your project has become a nontrivial task. Yet selecting the right database can result in huge cost savings and increased agility. This presentation will show how the Architecture Tradeoff Analysis Method (ATAM) can be applied to objectively select the best database architecture for a project. We review the core NoSQL database architecture patterns (key-value stores, column-family stores, graph databases, and document databases) and then present examples of using quality trees to score business problems with alternative architectures. We’ll address creative ways to use combinations of NoSQL architectures, cloud database services, and frameworks such as Hadoop, HDFS, and MapReduce to build back-end solutions that combine low operational costs and horizontal scalability. The presentation includes real-world case studies of this process.

Session Description

2Kelly-McCreary & Associates

Page 3: ATAM for NoSQL Database Selection - SEI Digital … · ATAM for NoSQL Database Selection. Using Architecture (Not Products) to Guide Database Selection. Dan McCreary. ... weigh the

• How I got into using ATAM for database selection• Background as of 2006

• Worked for Steve Jobs at NeXT• Object-oriented development Objective-C, Java• Strong focus on object-relational mapping

• DBKit, WebObjects, Hibernate, Oracle, Sybase, MS-SQL Server• 7 years doing XML (CriMNet), Metadata Registries (ISO/IEC

11179) and Semantics (RDF, OWL etc.)

My Story

3Kelly-McCreary & Associates

Page 4: ATAM for NoSQL Database Selection - SEI Digital … · ATAM for NoSQL Database Selection. Using Architecture (Not Products) to Guide Database Selection. Dan McCreary. ... weigh the

4Kelly-McCreary & Associates

Page 5: ATAM for NoSQL Database Selection - SEI Digital … · ATAM for NoSQL Database Selection. Using Architecture (Not Products) to Guide Database Selection. Dan McCreary. ... weigh the

5Kelly-McCreary & Associates

Page 6: ATAM for NoSQL Database Selection - SEI Digital … · ATAM for NoSQL Database Selection. Using Architecture (Not Products) to Guide Database Selection. Dan McCreary. ... weigh the

6Kelly-McCreary & Associates

Page 7: ATAM for NoSQL Database Selection - SEI Digital … · ATAM for NoSQL Database Selection. Using Architecture (Not Products) to Guide Database Selection. Dan McCreary. ... weigh the

7Kelly-McCreary & Associates

Page 8: ATAM for NoSQL Database Selection - SEI Digital … · ATAM for NoSQL Database Selection. Using Architecture (Not Products) to Guide Database Selection. Dan McCreary. ... weigh the

8Kelly-McCreary & Associates

Page 9: ATAM for NoSQL Database Selection - SEI Digital … · ATAM for NoSQL Database Selection. Using Architecture (Not Products) to Guide Database Selection. Dan McCreary. ... weigh the

Four Translations

9Copyright 2010 Dan McCreary & Associates

• T1 – HTML into Java Objects• T2 – Java Objects into SQL Tables• T3 – Tables into Objects• T4 – Objects into HTML

T1

T4

T2

T3

Object MiddleTier

RelationalDatabaseWeb Browser

Page 10: ATAM for NoSQL Database Selection - SEI Digital … · ATAM for NoSQL Database Selection. Using Architecture (Not Products) to Guide Database Selection. Dan McCreary. ... weigh the

Kurt's Suggestion

store($collection, $file-name, $data)

10Copyright 2010 Dan McCreary & Associates

Web Browser

Save

Web Form

Use a Native XML Database!

Kurt Cagle

eXist-db

Page 11: ATAM for NoSQL Database Selection - SEI Digital … · ATAM for NoSQL Database Selection. Using Architecture (Not Products) to Guide Database Selection. Dan McCreary. ... weigh the

Zero Translation

• XML lives in the web browser (XForms)• REST interfaces• XML in the database (Native XML, XQuery)• XRX Web Application Architecture• No translation!

11Copyright 2010 Dan McCreary & Associates

Web Browser XML database

XForms

Page 12: ATAM for NoSQL Database Selection - SEI Digital … · ATAM for NoSQL Database Selection. Using Architecture (Not Products) to Guide Database Selection. Dan McCreary. ... weigh the

Database Tradeoff AnalysisMy Way

• 10,000 lines of code to break CRV XML document into Java component and use Hibernate to store each element into columns of tables

• 45 SQL inserts store• 20 joins to extract• Six months• Four developers (Java, SQL,

DBA, Project Manager)

Kurt's Way• One line of codes to store CRB• One day to write• One week to test• 100x increase in agility

12Kelly-McCreary & Associates

Page 13: ATAM for NoSQL Database Selection - SEI Digital … · ATAM for NoSQL Database Selection. Using Architecture (Not Products) to Guide Database Selection. Dan McCreary. ... weigh the

The Paradigm Shift

13Kelly-McCreary & Associates

2006

RDBMSs are the onlyway to store enterprise

data

There are many ways to store enterprise data and if you pick the right one your agility can go

up x1,000

Page 14: ATAM for NoSQL Database Selection - SEI Digital … · ATAM for NoSQL Database Selection. Using Architecture (Not Products) to Guide Database Selection. Dan McCreary. ... weigh the

Reality Sets In

What I wanted• Objective architecture analysis• Fairly weigh the pros and cons

of each alternative• Be surrounded by people that

know the strengths and weakness of many alternatives

What I got• Architecture decisions driven

by an RDBMS license• Architecture decisions made by

one person with limited exposure to alternatives

• Architecture decisions made by lack of knowledge

• Architecture by fear of the unknown

14Kelly-McCreary & Associates

Page 15: ATAM for NoSQL Database Selection - SEI Digital … · ATAM for NoSQL Database Selection. Using Architecture (Not Products) to Guide Database Selection. Dan McCreary. ... weigh the

Evaluating Software Architectures: Methods and Case Studiesby Paul Clements, Rick Kazman, and Mark Klein

• Addison-Wesley, 2001

Key Book for ATAM

15Kelly-McCreary & Associates

Page 16: ATAM for NoSQL Database Selection - SEI Digital … · ATAM for NoSQL Database Selection. Using Architecture (Not Products) to Guide Database Selection. Dan McCreary. ... weigh the

How Important is the Database?

16Kelly-McCreary & Associates

Database

User Interface 10%-20%

80%-90%

Page 17: ATAM for NoSQL Database Selection - SEI Digital … · ATAM for NoSQL Database Selection. Using Architecture (Not Products) to Guide Database Selection. Dan McCreary. ... weigh the

Reference Utility Tree from Book

17Kelly-McCreary & Associates

Note: Mostly Database Issues

Page 18: ATAM for NoSQL Database Selection - SEI Digital … · ATAM for NoSQL Database Selection. Using Architecture (Not Products) to Guide Database Selection. Dan McCreary. ... weigh the

Anger, Wiki, Conference, Book

18Kelly-McCreary & Associates

2011, 2012

Page 19: ATAM for NoSQL Database Selection - SEI Digital … · ATAM for NoSQL Database Selection. Using Architecture (Not Products) to Guide Database Selection. Dan McCreary. ... weigh the

• NoSQL is real and it’s here to stay

RDBMS vs. NoSQL

http://www.google.com/trends/explore#q=nosql%2C%20rdbms&date=1%2F2009%2051m&cmpt=q

RDBMS

NoSQL

Google Trends

19Kelly-McCreary & Associates

Page 20: ATAM for NoSQL Database Selection - SEI Digital … · ATAM for NoSQL Database Selection. Using Architecture (Not Products) to Guide Database Selection. Dan McCreary. ... weigh the

Before NoSQL

20Kelly-McCreary & Associates

Relational Analytical (OLAP)

Page 21: ATAM for NoSQL Database Selection - SEI Digital … · ATAM for NoSQL Database Selection. Using Architecture (Not Products) to Guide Database Selection. Dan McCreary. ... weigh the

After NoSQL

Relational Analytical (OLAP) Key-Value

Column-Family DocumentGraph

key value

key value

key value

key value

21

Column-Family

Kelly-McCreary & Associates 21

Page 22: ATAM for NoSQL Database Selection - SEI Digital … · ATAM for NoSQL Database Selection. Using Architecture (Not Products) to Guide Database Selection. Dan McCreary. ... weigh the

1. Define high level Requirements2. Consider all six major

architectures (SQL and NoSQL)3. Select database architecture

first4. Select products that support the

architecture second

Suggested Process

22Kelly-McCreary & Associates

Key

Page 23: ATAM for NoSQL Database Selection - SEI Digital … · ATAM for NoSQL Database Selection. Using Architecture (Not Products) to Guide Database Selection. Dan McCreary. ... weigh the

Finding the right tool for the job

23Kelly-McCreary & Associates

The Problem:

Many possible Solutions:

What tool will have the best fit? Multiple tools? One item vs. many?

Page 24: ATAM for NoSQL Database Selection - SEI Digital … · ATAM for NoSQL Database Selection. Using Architecture (Not Products) to Guide Database Selection. Dan McCreary. ... weigh the

Architecture Selection

• Don't underestimate the role of marketing to promote good architecture!

24

Business UnitDevelopers

Operations

Make it easy tocreate and maintain

code

Make it easy tomonitor and scale

Make it easy touse and extend

Architecture SelectionTeam

Provide long-term competitive advantage

Marketing

Architecture

Kelly-McCreary & Associates

Page 25: ATAM for NoSQL Database Selection - SEI Digital … · ATAM for NoSQL Database Selection. Using Architecture (Not Products) to Guide Database Selection. Dan McCreary. ... weigh the

Selection Process

Gather AllBusiness

Requirements

Find Architecturally

Significant Requirements

Score Effort for Each Requirement

for Each Architecture

Total Effort forEach

Architecture

Select TopFour Architectures

Business Unit

Marketing

Architecture

25Kelly-McCreary & Associates

Page 26: ATAM for NoSQL Database Selection - SEI Digital … · ATAM for NoSQL Database Selection. Using Architecture (Not Products) to Guide Database Selection. Dan McCreary. ... weigh the

Use Case Driven Difficulty Analysis

• architecture-score-card, not a product score card!

26Kelly-McCreary & Associates

Page 27: ATAM for NoSQL Database Selection - SEI Digital … · ATAM for NoSQL Database Selection. Using Architecture (Not Products) to Guide Database Selection. Dan McCreary. ... weigh the

Architecturally Significant Features

27

• A requirement that drives overall architecture• Requires experts to know when a requirement is significant

R

R

RR

R

R

RR

R

RR

R

R

R

RRR

R

R

RR

R

ArchitecturallySignificantRequirement

R

NormalRequirement

R

R R

R

RR

R

R

RR

R

Kelly-McCreary & Associates

Page 28: ATAM for NoSQL Database Selection - SEI Digital … · ATAM for NoSQL Database Selection. Using Architecture (Not Products) to Guide Database Selection. Dan McCreary. ... weigh the

Quality Attribute Utility Tree

28Kelly-McCreary & Associates

Page 29: ATAM for NoSQL Database Selection - SEI Digital … · ATAM for NoSQL Database Selection. Using Architecture (Not Products) to Guide Database Selection. Dan McCreary. ... weigh the

Variations Used

• Change focus from "Performance" to "Scalability"• Change "Modifiability" to "Agility"• Increased emphasis on:

• Big Data• Searchability• Monitorability• Supportability• Affordability

29Kelly-McCreary & Associates

Page 30: ATAM for NoSQL Database Selection - SEI Digital … · ATAM for NoSQL Database Selection. Using Architecture (Not Products) to Guide Database Selection. Dan McCreary. ... weigh the

ATAM Process Flow

30

BusinessDrivers

QualityAttributes

UserStories

AnalysisArchitecture

PlanArchitecturalApproaches

ArchitecturalDecisions

Tradeoffs

SensitivityPoints

Non-Risks

RisksRisk ThemesDistilled info

Impacts

Kelly-McCreary & Associates

Page 31: ATAM for NoSQL Database Selection - SEI Digital … · ATAM for NoSQL Database Selection. Using Architecture (Not Products) to Guide Database Selection. Dan McCreary. ... weigh the

Sample Utility Tree

• Each topic (Quality Attribute) helps focus the discussion of a selection team

• The topics vary from project to project• Big Data projects focus on "Scalability" and

"Findability" etc.• Objective ranking of requirements before you

begin talking about architecture alternatives

31

Availability

Scalability

Maintainability

Affordability

Interoperability

Sustainability

Security

Portability

Findability

Kelly-McCreary & Associates

Page 32: ATAM for NoSQL Database Selection - SEI Digital … · ATAM for NoSQL Database Selection. Using Architecture (Not Products) to Guide Database Selection. Dan McCreary. ... weigh the

• The quality of the fit is driven by the quality of each finger's fit

• If one finger doesn’t fit the entire glove has a poor fit

• "Quality trees" help us evaluate the overall fitness of a problem and solution

• Removes focus on a single dimension

Hand in Glove

32Kelly-McCreary & Associates

Page 33: ATAM for NoSQL Database Selection - SEI Digital … · ATAM for NoSQL Database Selection. Using Architecture (Not Products) to Guide Database Selection. Dan McCreary. ... weigh the

Finding the right metaphor

33

Customer A Customer B Customer C

This customer is running a report that takes a long time to run on a single system. If we used a NoSQL solution the report would be evenly distributed on all servers and runs in 1/12 the time.

This is like the situation when many people are forced to go to the longest line even when other agents are not busy.

CPU Utilization Airline Checkin

Kelly-McCreary & Associates

Page 34: ATAM for NoSQL Database Selection - SEI Digital … · ATAM for NoSQL Database Selection. Using Architecture (Not Products) to Guide Database Selection. Dan McCreary. ... weigh the

• Requirements by threat type (DOS, Injection, Internal, Social Engineering)

Change in focus of Security

34Kelly-McCreary & Associates

Security

Authentication

Authorization

Audit

Encryption

Validating users

Granting access rights to resources

Who changed what and when

Encrypting/signing data within a database

Page 35: ATAM for NoSQL Database Selection - SEI Digital … · ATAM for NoSQL Database Selection. Using Architecture (Not Products) to Guide Database Selection. Dan McCreary. ... weigh the

• The ability to share code between other NoSQL databases (even within the same type) is very limited

The Big Problem: Standards

35Kelly-McCreary & Associates

Portability

Port to other DB

Share code

Reuse

Training

Ability to port applications to other NoSQL databases

Ability to share code with other databases

Ability to reuse code from other databases

Ability to reuse training from other databases

Page 36: ATAM for NoSQL Database Selection - SEI Digital … · ATAM for NoSQL Database Selection. Using Architecture (Not Products) to Guide Database Selection. Dan McCreary. ... weigh the

36Kelly-McCreary & Associates

Page 37: ATAM for NoSQL Database Selection - SEI Digital … · ATAM for NoSQL Database Selection. Using Architecture (Not Products) to Guide Database Selection. Dan McCreary. ... weigh the

Using Quality Trees to Communicate Risk

37

Portability

Only some roles can update some records (H, L)

Availability

Scalability

Maintainability

Affordability

Interoperability

Sustainability

SecurityAudit

Alternate DBs Code can be ported to other databases (M, L)

This quality has been ranked as a medium level of importance to the project but the architecture has low portability to other databases

This quality has been ranked as a high level of importance to the project, but the implementation being considered has been evaluated as a low compliance. This helps us rank project risks.

The highest warning rolls up to each parent node

Authentication

Encryption

Authorization

A solid green border indicates no problems – our architecture and product meet the requirements of the project

A dashed red line indicates architectural risk

Kelly-McCreary & Associates

Page 38: ATAM for NoSQL Database Selection - SEI Digital … · ATAM for NoSQL Database Selection. Using Architecture (Not Products) to Guide Database Selection. Dan McCreary. ... weigh the

• "…is the ability of the system to undergo changes with a degree of ease. These changes could impact components, services, features, and interfaces when adding or changing the functionality, fixing errors, and meeting new business requirements."

Maintainability

38Kelly-McCreary & Associates

winner! Business AgilityThe "big win" for many NoSQL converts

"We came for the scalability, we stayed for the agility"SAAM has a stronger focus on change impact analysis

Page 39: ATAM for NoSQL Database Selection - SEI Digital … · ATAM for NoSQL Database Selection. Using Architecture (Not Products) to Guide Database Selection. Dan McCreary. ... weigh the

39Kelly-McCreary & Associates

Page 40: ATAM for NoSQL Database Selection - SEI Digital … · ATAM for NoSQL Database Selection. Using Architecture (Not Products) to Guide Database Selection. Dan McCreary. ... weigh the

• defines the capability for components and subsystems to be suitable for use in other applications and in other scenarios. Reusability minimizes the duplication of components and also the implementation time.

Reusability

40Kelly-McCreary & Associates

Reusability Maintainability

Take Home: reusing transforms (MapReduce etc.) is the key to agility in Big Data

Page 41: ATAM for NoSQL Database Selection - SEI Digital … · ATAM for NoSQL Database Selection. Using Architecture (Not Products) to Guide Database Selection. Dan McCreary. ... weigh the

XForms Quality Attribute Utility Tree

41Kelly-McCreary & Associates

Page 42: ATAM for NoSQL Database Selection - SEI Digital … · ATAM for NoSQL Database Selection. Using Architecture (Not Products) to Guide Database Selection. Dan McCreary. ... weigh the

Summary

• We need solution architects that are trained in the pros and cons of multiple database architectures

• Select a database architecture first, then select a product• "One size fits all" will not keep organizations competitive• ATAM (and SAAM) are great processes to help understand

the alternatives and objectively weigh the consequences of architectural decisions

42Kelly-McCreary & Associates

Page 43: ATAM for NoSQL Database Selection - SEI Digital … · ATAM for NoSQL Database Selection. Using Architecture (Not Products) to Guide Database Selection. Dan McCreary. ... weigh the

• Making Sense of NoSQL• Manning Publications• Available in PDF now via MEAP

• http://manning.com/mccreary• In print in July, 2013

Reference

43Kelly-McCreary & Associates

Dan McCrearyAnn Kelly