«NoSQL Databases and Polyglot Persistence»
Upcoming SlideShare
Loading in...5
×
 

«NoSQL Databases and Polyglot Persistence»

on

  • 1,646 views

Сергей Ковалев (Senior Java Developer в Altoros)

Сергей Ковалев (Senior Java Developer в Altoros)

Statistics

Views

Total Views
1,646
Views on SlideShare
1,450
Embed Views
196

Actions

Likes
4
Downloads
49
Comments
0

6 Embeds 196

http://www.belarusjug.org 128
https://twitter.com 30
http://belarusjug.org 28
http://feedly.com 6
http://cloud.feedly.com 2
http://digg.com 2

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

«NoSQL Databases and Polyglot Persistence» «NoSQL Databases and Polyglot Persistence» Presentation Transcript

  • © ALTOROS Systems | CONFIDENTIAL NoSQL Databases and Polyglot Persistence Sergey Kovalev, Senior Java Developer, sergey.kovalev@altoros.com
  • © ALTOROS Systems | CONFIDENTIAL 2 The Challenge “One Size Does Not Fit All”
  • © ALTOROS Systems | CONFIDENTIAL 3 • What is Polyglot Persistence? • RDBMS vs NoSQL • NoSQL DB types • Polyglot Persistence Patterns • Real project experience Agenda:
  • © ALTOROS Systems | CONFIDENTIAL Polyglot Persistence - 4 Using multiple data storage technologies, chosen based upon the way data is being used by individual applications or components of single application. Martin Fowler http://martinfowler.com/articles/nosql-intro.pdf What is Polyglot Persistence?
  • © ALTOROS Systems | CONFIDENTIAL 5 NoSQL Zooo What is Polyglot Persistence? http://nosql-databases.org 150+ NoSQL databases
  • © ALTOROS Systems | CONFIDENTIAL 6 What is Polyglot Persistence? Who use polyglot persistence?
  • © ALTOROS Systems | CONFIDENTIAL 7 • What is Polyglot Persistence? • RDBMS vs NoSQL • NoSQL DB types • Polyglot Persistence Patterns • Real project experience Agenda:
  • © ALTOROS Systems | CONFIDENTIAL RDMS are great 8 • Widely used and understood • Tested in real environments • Efficient use of storage space if data normalized properly • Great tools support ACID semantics • Incredibly flexible and powerful query language • Great framework support RDBMS vs NoSQL
  • © ALTOROS Systems | CONFIDENTIAL RDBMS have limitations 9 • Complex object graphs does not map very well with flat tables. • Strict Schema • Difficult to evolve Schema with time. • Data constraints and JOINs can be expensive at runtime. • Difficult to scale horizontally. RDBMS vs NoSQL
  • © ALTOROS Systems | CONFIDENTIAL NoSQL features 10 • Flexible schema • Easy to scale horizontally to add processing power and storage • High Performance RDBMS vs NoSQL
  • © ALTOROS Systems | CONFIDENTIAL 11 • What is Polyglot Persistence? • RDBMS vs NoSQL • NoSQL DB types • Polyglot Persistence Patterns • Real project experience Agenda:
  • © ALTOROS Systems | CONFIDENTIAL Key Value Stores 12 • A key-value store is a simple hash table • Primarily used when all access to the database is via primary key • Value is a blob with the data store not caring or knowing what is inside NoSQL DB types
  • © ALTOROS Systems | CONFIDENTIAL Column-Family Stores 13 • Store data in column families as rows that have many columns associated with a row key • Column families are groups of related data, often accessed together • Aggregate-Oriented NoSQL DB types
  • © ALTOROS Systems | CONFIDENTIAL 14 NoSQL DB types Document Databases • Stores and retrieves documents, which can be XML, JSON, BSON, … • Documents are self-describing, hierarchical tree data structures which can consist of maps, collections and scalar values • Aggregate-Oriented
  • © ALTOROS Systems | CONFIDENTIAL 15 NoSQL DB types Graph Databases • Allow to store entities and relationships between these entities • Entities are known as nodes, which have properties • Relations are known as edges, which also have properties
  • © ALTOROS Systems | CONFIDENTIAL 16 • What is Polyglot Persistence? • RDBMS vs NoSQL • NoSQL DB types • Polyglot Persistence Patterns • Real project experience Agenda:
  • © ALTOROS Systems | CONFIDENTIAL RDBMS 17 • Transactional data (payment and account) in a ACID compliant traditional RDBMS stores such as MySQL or Oracle. • Reporting Tools Polyglot Persistence Patterns RDBMS Web application Reporting Tools Transactional data
  • © ALTOROS Systems | CONFIDENTIAL Key Value Stores 18 • Session data in Redis or Hazelcast. Session data requires faster read and write but not durability. • Shopping cart data in a high availability and fault-tolerance data store such as Riak. Polyglot Persistence Patterns RDBMS Web application Reporting Tools Transactional data Key-Value store Sessions and Shopping cart
  • © ALTOROS Systems | CONFIDENTIAL Column-Family Stores 19 • Log level data (audit and activity) in a very high write throughput data store such as Cassandra. • Also good for analytic and real-time data mining such as product ranking Polyglot Persistence Patterns RDBMS Web application Reporting Tools Transactional data Key-Value store Sessions and Shopping cart Column-Family store Logging Analytic
  • © ALTOROS Systems | CONFIDENTIAL Document Databases 20 • Product catalogue in a document oriented data store such as MongoDB. Requirement include high read throughput, frequent data change (stock level information) • Customer profile data including purchase history, shipping & billing address Polyglot Persistence Patterns Web application Reporting Tools Transactional data Key-Value store Sessions and Shopping cart Column-Family store Logging Analytic Document store RDBMS Product catalogue
  • © ALTOROS Systems | CONFIDENTIAL Graph Databases 21 • Data for product recommendations, related products and similar products in a graph database such as Neo4j. Polyglot Persistence Patterns Web application Reporting Tools Transactional data Key-Value store Sessions and Shopping cart Column-Family store Logging Analytic Document store RDBMS Product catalogue Graph Databases Social graph
  • © ALTOROS Systems | CONFIDENTIAL Summary 22 Polyglot Persistence Patterns
  • © ALTOROS Systems | CONFIDENTIAL 23 • What is Polyglot Persistence? • RDBMS vs NoSQL • NoSQL DB types • Polyglot Persistence Patterns • Real project experience Agenda:
  • © ALTOROS Systems | CONFIDENTIAL ScienceWarehouse challenges 24 • Hundreds of thousands of records are added to the database daily • Visitors’ activities logging generates huge amount of write queries • Price table contains approximately 100,000,000 records • Price history table contains approximately 500.000.000 • Data rapidly grows Real project experience
  • © ALTOROS Systems | CONFIDENTIAL 25 • Upgrade hardware (vertical scaling) • Upgrade to the Oracle Database Enterprise Edition Options for ScienceWarehause • Use NoSQL and Polyglot Persistence or Real project experience
  • © ALTOROS Systems | CONFIDENTIAL 26 Real project experience Solutions for ScienceWarehouse • Add a caching layer • Write the log data on visitors’ activities to a NoSQL database (Cassandra or HBase) • Move price history(500,000,000 records table) information to NoSQL data base(Cassandra or HBase)
  • © ALTOROS Systems | CONFIDENTIAL 27 Real project experience ScienceWarehouse High Level Architecture Web application Legacy DB Key-Value store Sessions and Shopping cart Column-Family store Logging Analytic RDBMS
  • © ALTOROS Systems | CONFIDENTIAL 28 Sergey Kovalev, Senior Java Developer, sergey.kovalev@altoros.com NoSQL Databases and Polyglot Persistence