Social Networks and the Richness of Data



Similar documents
Using MySQL for Big Data Advantage Integrate for Insight Sastry Vedantam

MySQL és Hadoop mint Big Data platform (SQL + NoSQL = MySQL Cluster?!)

Ground up Introduction to In-Memory Data (Grids)

Cloud Based Application Architectures using Smart Computing

Scalable Architecture on Amazon AWS Cloud

The deployment of OHMS TM. in private cloud

SCALABLE DATA SERVICES

In Memory Accelerator for MongoDB

ZingMe Practice For Building Scalable PHP Website. By Chau Nguyen Nhat Thanh ZingMe Technical Manager Web Technical - VNG

Distributed File System. MCSN N. Tonellotto Complements of Distributed Enabling Platforms

Database Scalability {Patterns} / Robert Treat

Practical Cassandra. Vitalii

F1: A Distributed SQL Database That Scales. Presentation by: Alex Degtiar (adegtiar@cmu.edu) /21/2013

Couchbase Server Technical Overview. Key concepts, system architecture and subsystem design

Evolution of Web Application Architecture International PHP Conference. Kore Nordmann / <kore@qafoo.com> June 9th, 2015


On- Prem MongoDB- as- a- Service Powered by the CumuLogic DBaaS Platform

Real-time reporting at 10,000 inserts per second. Wesley Biggs CTO 25 October 2011 Percona Live

The Sierra Clustered Database Engine, the technology at the heart of

Hybrid Solutions Combining In-Memory & SSD

Understanding Neo4j Scalability

Big Data with Component Based Software

Accelerating Enterprise Applications and Reducing TCO with SanDisk ZetaScale Software

Graph Database Proof of Concept Report

LARGE-SCALE DATA STORAGE APPLICATIONS

<Insert Picture Here> Oracle NoSQL Database A Distributed Key-Value Store

Are You Ready for the Holiday Rush?

Assignment # 1 (Cloud Computing Security)

SQL Databases Course. by Applied Technology Research Center. This course provides training for MySQL, Oracle, SQL Server and PostgreSQL databases.

Efficient Network Marketing - Fabien Hermenier A.M.a.a.a.C.

BENCHMARKING CLOUD DATABASES CASE STUDY on HBASE, HADOOP and CASSANDRA USING YCSB

Bigdata High Availability (HA) Architecture

Chapter 7. Using Hadoop Cluster and MapReduce

MakeMyTrip CUSTOMER SUCCESS STORY

Using Object Database db4o as Storage Provider in Voldemort

Big Data Pipeline and Analytics Platform

Tushar Joshi Turtle Networks Ltd

How to Choose Between Hadoop, NoSQL and RDBMS

membase.org: The Simple, Fast, Elastic NoSQL Database NorthScale Matt Ingenthron OSCON 2010

Cloud Application Development (SE808, School of Software, Sun Yat-Sen University) Yabo (Arber) Xu

MongoDB Developer and Administrator Certification Course Agenda

MySQL High-Availability and Scale-Out architectures

Couchbase Server Under the Hood

Structured Data Storage

Search Big Data with MySQL and Sphinx. Mindaugas Žukas

NoSQL: Going Beyond Structured Data and RDBMS

PipeCloud : Using Causality to Overcome Speed-of-Light Delays in Cloud-Based Disaster Recovery. Razvan Ghitulete Vrije Universiteit

Comparing Microsoft SQL Server 2005 Replication and DataXtend Remote Edition for Mobile and Distributed Applications

Availability Digest. Raima s High-Availability Embedded Database December 2011

Removing Failure Points and Increasing Scalability for the Engine that Drives webmd.com

Hypertable Architecture Overview

Evaluator s Guide. McKnight. Consulting Group. McKnight Consulting Group

Cloud Computing: Meet the Players. Performance Analysis of Cloud Providers

Why NoSQL? Your database options in the new non- relational world IBM Cloudant 1

BookKeeper. Flavio Junqueira Yahoo! Research, Barcelona. Hadoop in China 2011

Database Replication with MySQL and PostgreSQL

Technical Overview Simple, Scalable, Object Storage Software

NoSQL Data Base Basics

Wikimedia architecture. Mark Bergsma Wikimedia Foundation Inc.

Zero Downtime Deployments with Database Migrations. Bob Feldbauer

HDMQ :Towards In-Order and Exactly-Once Delivery using Hierarchical Distributed Message Queues. Dharmit Patel Faraj Khasib Shiva Srivastava

Welcome to Virtual Developer Day MySQL!

STREAM PROCESSING AT LINKEDIN: APACHE KAFKA & APACHE SAMZA. Processing billions of events every day

Why Zalando trusts in PostgreSQL

A Survey of Distributed Database Management Systems

Wisdom from Crowds of Machines

White Paper. Optimizing the Performance Of MySQL Cluster

Benchmarking Cassandra on Violin

Direct NFS - Design considerations for next-gen NAS appliances optimized for database workloads Akshay Shah Gurmeet Goindi Oracle

EXECUTIVE SUMMARY CONTENTS. 1. Summary 2. Objectives 3. Methodology and Approach 4. Results 5. Next Steps 6. Glossary 7. Appendix. 1.

ORACLE COHERENCE 12CR2

Apache Ignite TM (Incubating) - In- Memory Data Fabric Fast Data Meets Open Source

WSO2 Message Broker. Scalable persistent Messaging System

Storage Made Easy Enterprise File Share and Sync (EFSS) Cloud Control Gateway Architecture

Using Oracle NoSQL Database

Pulsar Realtime Analytics At Scale. Tony Ng April 14, 2015

In-Memory BigData. Summer 2012, Technology Overview

Benchmarking Couchbase Server for Interactive Applications. By Alexey Diomin and Kirill Grigorchuk

Software Performance, Scalability, and Availability Specifications V 3.0

Lambda Architecture. Near Real-Time Big Data Analytics Using Hadoop. January Website:

Analytics March 2015 White paper. Why NoSQL? Your database options in the new non-relational world

Bricks Cluster Technical Whitepaper

Module 14: Scalability and High Availability

GigaSpaces Real-Time Analytics for Big Data

Can the Elephants Handle the NoSQL Onslaught?

Scalable Web Application

Non-Stop for Apache HBase: Active-active region server clusters TECHNICAL BRIEF

Using Redis as a Cache Backend in Magento

Migration and Building of Data Centers in IBM SoftLayer with the RackWare Management Module

eccharts: Behind the scenes

Shop by Manufacturer Custom Module for Magento

Unibet.com Architecture

[Hadoop, Storm and Couchbase: Faster Big Data]

Reference Model for Cloud Applications CONSIDERATIONS FOR SW VENDORS BUILDING A SAAS SOLUTION

Synchronous multi-master clusters with MySQL: an introduction to Galera

HBase Schema Design. NoSQL Ma4ers, Cologne, April Lars George Director EMEA Services

NoSQL - What we ve learned with mongodb. Paul Pedersen, Deputy CTO paul@10gen.com DAMA SF December 15, 2011

Enterprise Operational SQL on Hadoop Trafodion Overview

Designing, Scoping, and Configuring Scalable Drupal Infrastructure. Presented by David Strauss

NoSQL in der Cloud Why? Andreas Hartmann

Transcription:

Social Networks and the Richness of Data Getting distributed Webservices Done with NoSQL Fabrizio Schmidt, Lars George VZnet Netzwerke Ltd.

Content Unique Challenges System Evolution Architecture Activity Stream - NoSQL Lessons learned, Future

Unique Challenges 16 Million Users > 80% Active/Month > 40% Active/Daily > 30min Daily Time on Site

Unique Challenges 16 Million Users 3 Billion Photos 150 TB Data 1 Billion Relationships 13 Million Messages per Day 17 Million Logins per Day 15 Billion Requests per Month 120 Million Emails per Week

Old System - Phoenix LAMP Apache + PHP + APC (50 req/s) Sharded MySQL Multi-Master Setup Memcache with 1 TB+ Monolithic Single Service, Synchronous

Old System - Phoenix 500+ Apache Frontends 60+ Memcaches 150+ MySQL Servers

Old System - Phoenix

DON T PANIC

Asynchronous Services Basic Services Twitter Mobile CDN Purge... Java (e.g. Tomcat) RabbitMQ

First Services

Phoenix - RabbitMQ 1. PHP Implementation of AMQP Client Too slow! 2. PHP C - Extension (php-amqp http://code.google.com/p/php-amqp/) Fast enough 3. IPC - AMQP Dispatcher C-Daemon That s it! But not released so far

IPC - AMQP Dispatcher

Activity Stream

Old Activity Stream Memcache only - no persistence Status updates only #fail on memcache restart #fail on users with >1000 friends

Old Activity Stream We cheated! Memcache only - no persistence Status updates only #fail on memcache restart #fail on users with >1000 friends

Old Activity Stream We cheated! Memcache only - no persistence Status updates only #fail on memcache restart #fail on users with >1000 friends source: internet

Social Network Problem = Twitter Problem??? >15 different Events Timelines Aggregation Filters Privacy

Do the Math!

Do the Math! 18M Events/day sent to ~150 friends

Do the Math! 18M Events/day sent to ~150 friends => 2700M timeline inserts / day

Do the Math! 18M Events/day sent to ~150 friends => 2700M timeline inserts / day 20% during peak hour

Do the Math! 18M Events/day sent to ~150 friends => 2700M timeline inserts / day 20% during peak hour => 3.6M event inserts/hour - 1000/s

Do the Math! 18M Events/day sent to ~150 friends => 2700M timeline inserts / day 20% during peak hour => 3.6M event inserts/hour - 1000/s => 540M timeline inserts/hour - 150000/s

inserts / day rts/hour - 1000/s inserts/hour - 150000/s

New Activity Stream Social Network Problem Architecture NoSQL Systems

New Activity Stream Do it right! Social Network Problem Architecture NoSQL Systems

New Activity Stream Do it right! Social Network Problem Architecture NoSQL Systems source: internet

Architecture

FAS Federated Autonomous Services Nginx + Janitor Embedded Jetty + RESTeasy NoSQL Storage Backends

FAS Federated Autonomous Services

Activity Stream as a service Requirements: Endless scalability Storage & cloud independent Fast Flexible & extensible data model

Thinking in layers...

Activity Stream as a service

Activity Stream as a service

NoSQL Schema

NoSQL Schema Event Event is sent in by piggybacking the request

NoSQL Schema Generate Event ID Generate itemid - unique ID of the event

NoSQL Schema Generate Save Event ItemID itemid => stream_entry - save the event with meta information

NoSQL Schema Insert into the timeline of each recipient recipient [[itemid, time, type], ] Update Generate Save Event Indexes ItemID Insert into the timeline of the event originator sender [[itemid, time, type], ]

NoSQL Schema Generate Save Event ItemID

MRI (Redis)

MRI (Redis)

Architecture: Push Message Recipient Index (MRI) Push the Message directly to all MRIs {number of Recipients ~150} updates Special profiles and some users have >500 recipients >500 pushes to recipient timelines => stress the system!

ORI (Voldemort/ Redis)

ORI (Voldemort/ Redis)

Architecture: Pull Originator Index (ORI) NO Push to MRIs at all 1 Message + 1 Originator Index Entry Special profiles and some users have >500 friends get >500 ORIs on read => stress the system

Architecture: PushPull ORI + MRI Identify Users with recipient lists >{limit} Only push updates with recipients <{limit} to MRI Pull special profiles and users with >{limit} from ORI Identify active users with a bloom/bit filter for pull

Activity Filter Lars Reduce read operations on storage Distinguish user activity levels In memory and shared across keys and types Scan full day of updates for16m users on a per minute granularity for 1000 friends in < 100msecs

Activity Filter

NoSQL

NoSQL: Redis ORI + MRI on Steroids Fast in memory Data-Structure Server Easy protocol Asynchronous Persistence Master-Slave Replication Virtual-Memory JRedis - The Java client

NoSQL: Redis ORI + MRI on Steroids Data-Structure Server Datatypes: String, List, Sets, ZSets We use ZSets (sorted sets) for the Push Recipient Indexes Insert Get for (recipient : recipients) { jredis.zadd(recipient.id, streamentryindex); } jredis.zrange(streamownerid, from, to) jredis.zrangebyscore(streamownerid, somescorebegin, somescoreend)

NoSQL: Redis ORI + MRI on Steroids Persistence - AOF and Bgsave AOF - append only file - append on operation Bgsave - asynchronous snapshot - configurable (timeperiod or every n operations) - triggered directly We use AOF as itʻs less memory hungry Combined with bgsave for additional backups

NoSQL: Redis ORI + MRI on Steroids Virtual - Memory Storing Recipient Indexes for 16 mio users à ~500 entries would lead to >250 GB of RAM needed With Virtual Memory activated Redis swaps less frequented values to disk Only your hot dataset is in memory 40% logins per day / only 20% of these in peak ~ 20GB needed for hot dataset

NoSQL: Redis ORI + MRI on Steroids Jredis - Redis java client Pipelining support (sync and async semantics) Redis 1.2.3 compliant The missing parts No consistent hashing No rebalancing

Message Store (Voldemort)

Message Store (Voldemort)

NoSQL: Voldemort No #fail Messagestore (MS) Key-Value Store Replication Versioning Eventual Consistency Pluggable Routing / Hashing Strategy Rebalancing Pluggable Storage-Engine

NoSQL: Voldemort No #fail Messagestore (MS) Configuring replication, reads and writes <store> <name>stream-ms</name> <persistence>bdb</persistence> <routing>client</routing> <replication-factor>3</replication-factor> <required-reads>2</required-reads> <required-writes>2</required-writes> <prefered-reads>3</prefered-reads> <prefered-writes>3</prefered-writes> <key-serializer><type>string</type></key-serializer> <value-serializer><type>string</type></value-serializer> <retention-days>8</retention-days> </store>

NoSQL: Voldemort No #fail Messagestore (MS) Write: client.put(key, myversionedvalue); Update(read-modify-write): public class MriUpdateAction extends UpdateAction<String, String> { public MriUpdateAction(String key, ItemIndex index) { this.key = key; this.index = index; } } @Override public void update(storeclient<string, String> client) { Versioned<String> versionedjson = client.get(this.key); versionedjson.setobject("my value"); client.put(this.key, versionedjson); }

NoSQL: Voldemort No #fail Messagestore (MS) Eventual Consistency - Read public MriInconsistencyResolver implements InconsistencyResolver<Versioned<String>> { public List<Versioned<String>> resolveconflicts(list<versioned<string>> items){ Versioned<String> vers0 = items.get(0); Versioned<String> vers1 = items.get(1); if(vers0 == null && vers1 == null) { return null; } List<Versioned<String>> li = new ArrayList<Versioned<String>>(1); if(vers0 == null) { li.add(vers1); return li; } if(vers1 == null) { li.add(vers0); return li; } } } // resolve your inconsistency here e.g. merge to lists The default inconsistency resolver automatically takes the newer version

NoSQL: Voldemort No #fail Messagestore (MS) Configuration Choose a big number of partitions Reduce the size of the BDB append log Balance Client and Server Threadpools

Concurrent ID Generator

Concurrent ID Generator

NoSQL: Hazelcast Concurrent ID Generator (CIG) In Memory Data Grid Dynamically Scales Distributed java.util.{queue Set List Map} and more Dynamic Partitioning with Backups Configurable Eviction Persistence

NoSQL: Hazelcast Concurrent ID Generator (CIG) Cluster-wide ID Generation: No UUID because of architecture constraint IDs of Stream Entries generated via Hazelcast Replication to avoid loss of count Background persistence used for disaster recovery

NoSQL: Hazelcast Generate Unique Sequencial Numbers (Distributed Autoincrement): Nodes get ranges assigned (node1: 10000-19999, node2: 20000-29999 ID's) IDs per range locally incremented on the node (thread safe/atomic) Distributed locks secure range assignment for nodes Concurrent ID Generator (CIG)

NoSQL: Hazelcast Concurrent ID Generator (CIG) Example Configuration <map name=".vz.stream.cighazelcast"> </map> <map-store enabled="true"> <class-name>net.vz.storage.cigpersister</class-name> <write-delay-seconds>0</write-delay-seconds> </map-store> <backup-count>3</backup-count>

NoSQL: Hazelcast Concurrent ID Generator (CIG) Future use-cases: Advanced preaggregated cache Distributed Executions

Lessons Learned Start benchmarking and profiling your app early! A fast and easy Deployment keeps the motivation up Configure Voldemort carefully (especially on large heap machines) Read the mailing lists of the #nosql system you use No Solution in docs? - read the sources! At some point stop discussing and just do it!

In Progress Network Stream Global Public Stream Stream per Location Hashtags

Future Geo Location Stream Third Party API

Questions?