SlideShare una empresa de Scribd logo
1 de 31
Descargar para leer sin conexión
Building Zingme News Feed
           System


               Chau Nguyen Nhat Thanh
                Senior Software Manager
             User Platform Division - VNG
Agenda

1) Introduction to News Feed
2) ZingMe News Feed system history
3) ZingMe News Feed system
4) Some statistics
5) Bonus
6) Q&A
Introduction to News Feed
Introduction to News Feed
●   Update friends' info
●   Update Biz info
●   Update VIP info
●   Interaction to them by comment, like ...
Introduction to News Feed
Introduction to News Feed
Introduction to News Feed
Introduction to News Feed
●   Terms
    ●   Social graph: Users in most social networking
        sites are describable in terms of a social
        graph. The relationships between users are
        represented by adjacency lists. If Jack and Jill
        are friends, they are said to be adjacent. This
        is known as an "edge" in the graph. (from
        Quora)
    ●   Not only Friends
    ●   but also Followers …
Introduction to News Feed
●   What do we need?
    ●   Someone does actions, his friend will see these
        action in his home as soon as possible
●   What will we solve the problems?
    ●   Solution 1: Push model (fan out on write)
    ●   Solution 2: Pull model (fan out on read)
    ●   Solution 3: Mixing push and pull (Feeding
        Frenzy- a paper from Yahoo)
Introduction to News Feed
●   Push model
    ●   This method involves denormalizing the user's activity
        data and pushing the meta data to all the user's friends
        at the time it occurs. (from Quora)
●   Pull model
    ●   This method involves keeping all recent activity data in
        memory and pulling in (or fanning out) that data at the
        time a user loads their home page. Data doesn't need to
        be pushed out to all subscribers as soon as it happens,
        so no back-log and no disk seeks (from Quora)
●   Mix model
    ●   Active user using push model
    ●   Non active user using pull
ZingMe News Feed system history
ZingMe News Feed system history

●   First version
    ●   Using PHP for worker
    ●   Using MySQL for feed item
    ●   Using MySQL for feed indexing
    ●   Having full feature: feed type filtering, ignoring
        users ..
    ●   Restarting DB and other services are the favorite
        jobs at that time :)
    ●   Lesson learn:
        –   Relation DB may not be fit for this kind of project
ZingMe News Feed system history

●   Second version
    ●   Still using PHP for worker
    ●   Using Cassandra for feed item
    ●   Using home build list id service for feed indexing
    ●   Using Memcached for caching item
    ●   Removing all deluxe features :) (stupid features due to
        our limited technique)
    ●   Restarting Cassandra, and waiting for compaction is our
        favorite jobs :) :)
    ●   Headache with changing avatar
    ●   Lesson learn: believe only ourself
ZingMe News Feed system history

●   Third version
    ●   Moving to Java for better performance
    ●   Still using Cassandra for feed item
    ●   Trying to use redis in Lab
    ●   Keep only simple features (KISS)
    ●   Cannot control memcache
        –   The new one expired before the old one ???
        –   Memcached is wrong ???
    ●   Cannot believe to Cassandra
    ●   Lesson learn: memcached is not the “thuốc tiên” :)
ZingMe News Feed system
    (The current one :))
ZingMe News Feed system
ZingMe News Feed system

●   Still using push model because of Twitter public some
    info related to this model
●   Not enough technical when choosing pull model
●   Begin to understand a little bit about how to keep it
    scaling
●   Do not use Cassandra any more for such kind of this
    system → do not believe to anyone, learn from what
    they do and try our best
ZingMe News Feed system

●   Feed Item
    ●   UserId, ObjectId, Created date...
    ●   Storage: home build based on Kyoto Cabinet
    ●   Fast recovery when crash
●   Feed Index
    ●   UserId → [feedId1,feedId2...]
    ●   Storage: home build
    ●   Fast recovery when crash
ZingMe News Feed system

●   Rate limit
    ●   Prefilter Spam or auto tool based on rate of write request
    ●   When hit limit, block that user for amount of time
●   Feed writer
    ●   Receive the write command
    ●   Get the next Id from Generator
    ●   Push the item to queue
    ●   Return the feedId for future reference
ZingMe News Feed system

●   Gearman feed storage queue
    ●   Very fast
    ●   Support multi language client
    ●   Some time block the all workers when network
        unstable :)
    ●   Solve most of our heavy jobs
ZingMe News Feed system

●   Feed Sync center
    ●   Sync the new feed to the others such as:
        –   Spam detection
        –   Feed ranking system
        –   Logging system
    ●   Feed replication function for future use
ZingMe News Feed system

●   Feed Render worker
    ●   The main and heavy job:
        –   Get the feed item
        –   Extract the template id
        –   Get user info
        –   Render the feed based on them
    ●   Put rendered feed in to appropriate cache
    ●   Mobile and Desktop are totally different
ZingMe News Feed system

●   Feed Aggregate
    ●   Get the feed index
    ●   Get the rendered item from cache
    ●   Return to the front-end
    ●   Some cheat:
        –   If the cached items less than 5, in stead of returning
            the data return a JavaScript to reload that list
        –   At the same time push a task to warm-up the
            rendered cache
    ●   Auto fail-over when a cache service die
Some statistics
Some statistics

●   ~15M actions / day
●   10% Spam
    ●   Gift receive
    ●   Meaningless status
●   Cache hit 98%
●   ~80M registered users
●   ~3M active users / days
●   Max 1000 friends only
●   Unlimited followers
Bonus
●
    Twemcache (https://github.com/twitter/twemcache)
    ●   From Twitter
    ●   Solve most problems with memcached
    ●   More strategy for eviction items
        –   Item LRU eviction: per-slabclass LRU eviction
        –   Random eviction : evict all items from a randomly chosen slab
        –   ...
    ●   Twemcache proxy
●
    Redis (http://redis.io)
    ●   Replacement for home build when you have not enough time
    ●   Set is default supported
    ●   Supported cluster
    ●   Persistence
Question and Answer
Q&A
●   What is the problem with followers?
    ●   Do that with the trick
    ●   Cheating the owner ;)
We are hiring!!!!!!!
Q&A




Contact info:
         Chau Nguyen Nhat Thanh

       thanhcnn@vng.com.vn

       me.zing.vn/thanhcnn2000

Más contenido relacionado

La actualidad más candente

Scaling a Core Banking Engine Using Apache Kafka | Peter Dudbridge, Thought M...
Scaling a Core Banking Engine Using Apache Kafka | Peter Dudbridge, Thought M...Scaling a Core Banking Engine Using Apache Kafka | Peter Dudbridge, Thought M...
Scaling a Core Banking Engine Using Apache Kafka | Peter Dudbridge, Thought M...HostedbyConfluent
 
Introduction to Python Celery
Introduction to Python CeleryIntroduction to Python Celery
Introduction to Python CeleryMahendra M
 
Introduction to Storm
Introduction to Storm Introduction to Storm
Introduction to Storm Chandler Huang
 
Big Data in Real-Time at Twitter
Big Data in Real-Time at TwitterBig Data in Real-Time at Twitter
Big Data in Real-Time at Twitternkallen
 
Cassandra Introduction & Features
Cassandra Introduction & FeaturesCassandra Introduction & Features
Cassandra Introduction & FeaturesDataStax Academy
 
From cache to in-memory data grid. Introduction to Hazelcast.
From cache to in-memory data grid. Introduction to Hazelcast.From cache to in-memory data grid. Introduction to Hazelcast.
From cache to in-memory data grid. Introduction to Hazelcast.Taras Matyashovsky
 
Kinh nghiệm triển khai Microservices tại Sapo.vn
Kinh nghiệm triển khai Microservices tại Sapo.vnKinh nghiệm triển khai Microservices tại Sapo.vn
Kinh nghiệm triển khai Microservices tại Sapo.vnDotnet Open Group
 
Building Scalable and Personalized News Feed
Building Scalable and Personalized News FeedBuilding Scalable and Personalized News Feed
Building Scalable and Personalized News FeedEyal Ronel
 
Présentation de Apache Zookeeper
Présentation de Apache ZookeeperPrésentation de Apache Zookeeper
Présentation de Apache ZookeeperMichaël Morello
 
Scalability, Availability & Stability Patterns
Scalability, Availability & Stability PatternsScalability, Availability & Stability Patterns
Scalability, Availability & Stability PatternsJonas Bonér
 
Stability Patterns for Microservices
Stability Patterns for MicroservicesStability Patterns for Microservices
Stability Patterns for Microservicespflueras
 
Cassandra at eBay - Cassandra Summit 2012
Cassandra at eBay - Cassandra Summit 2012Cassandra at eBay - Cassandra Summit 2012
Cassandra at eBay - Cassandra Summit 2012Jay Patel
 
Deep Learning for Recommender Systems RecSys2017 Tutorial
Deep Learning for Recommender Systems RecSys2017 Tutorial Deep Learning for Recommender Systems RecSys2017 Tutorial
Deep Learning for Recommender Systems RecSys2017 Tutorial Alexandros Karatzoglou
 
Databus - LinkedIn's Change Data Capture Pipeline
Databus - LinkedIn's Change Data Capture PipelineDatabus - LinkedIn's Change Data Capture Pipeline
Databus - LinkedIn's Change Data Capture PipelineSunil Nagaraj
 
Introduction to apache zoo keeper
Introduction to apache zoo keeper Introduction to apache zoo keeper
Introduction to apache zoo keeper Omid Vahdaty
 
Applet features
Applet featuresApplet features
Applet featuresmyrajendra
 

La actualidad más candente (20)

Scaling a Core Banking Engine Using Apache Kafka | Peter Dudbridge, Thought M...
Scaling a Core Banking Engine Using Apache Kafka | Peter Dudbridge, Thought M...Scaling a Core Banking Engine Using Apache Kafka | Peter Dudbridge, Thought M...
Scaling a Core Banking Engine Using Apache Kafka | Peter Dudbridge, Thought M...
 
Introduction to Python Celery
Introduction to Python CeleryIntroduction to Python Celery
Introduction to Python Celery
 
Introduction to Storm
Introduction to Storm Introduction to Storm
Introduction to Storm
 
Big Data in Real-Time at Twitter
Big Data in Real-Time at TwitterBig Data in Real-Time at Twitter
Big Data in Real-Time at Twitter
 
Cassandra Introduction & Features
Cassandra Introduction & FeaturesCassandra Introduction & Features
Cassandra Introduction & Features
 
From cache to in-memory data grid. Introduction to Hazelcast.
From cache to in-memory data grid. Introduction to Hazelcast.From cache to in-memory data grid. Introduction to Hazelcast.
From cache to in-memory data grid. Introduction to Hazelcast.
 
Kinh nghiệm triển khai Microservices tại Sapo.vn
Kinh nghiệm triển khai Microservices tại Sapo.vnKinh nghiệm triển khai Microservices tại Sapo.vn
Kinh nghiệm triển khai Microservices tại Sapo.vn
 
Building Scalable and Personalized News Feed
Building Scalable and Personalized News FeedBuilding Scalable and Personalized News Feed
Building Scalable and Personalized News Feed
 
Présentation de Apache Zookeeper
Présentation de Apache ZookeeperPrésentation de Apache Zookeeper
Présentation de Apache Zookeeper
 
Scalability, Availability & Stability Patterns
Scalability, Availability & Stability PatternsScalability, Availability & Stability Patterns
Scalability, Availability & Stability Patterns
 
Stability Patterns for Microservices
Stability Patterns for MicroservicesStability Patterns for Microservices
Stability Patterns for Microservices
 
Apache Kafka at LinkedIn
Apache Kafka at LinkedInApache Kafka at LinkedIn
Apache Kafka at LinkedIn
 
Apache ZooKeeper
Apache ZooKeeperApache ZooKeeper
Apache ZooKeeper
 
Cassandra at eBay - Cassandra Summit 2012
Cassandra at eBay - Cassandra Summit 2012Cassandra at eBay - Cassandra Summit 2012
Cassandra at eBay - Cassandra Summit 2012
 
Deep Learning for Recommender Systems RecSys2017 Tutorial
Deep Learning for Recommender Systems RecSys2017 Tutorial Deep Learning for Recommender Systems RecSys2017 Tutorial
Deep Learning for Recommender Systems RecSys2017 Tutorial
 
Databus - LinkedIn's Change Data Capture Pipeline
Databus - LinkedIn's Change Data Capture PipelineDatabus - LinkedIn's Change Data Capture Pipeline
Databus - LinkedIn's Change Data Capture Pipeline
 
Apache Zookeeper
Apache ZookeeperApache Zookeeper
Apache Zookeeper
 
Introduction to apache zoo keeper
Introduction to apache zoo keeper Introduction to apache zoo keeper
Introduction to apache zoo keeper
 
Applet features
Applet featuresApplet features
Applet features
 
Apache Spark Architecture
Apache Spark ArchitectureApache Spark Architecture
Apache Spark Architecture
 

Similar a Building ZingMe News Feed System

Building zing me news feed system
Building zing me news feed systemBuilding zing me news feed system
Building zing me news feed systemAiTi Education
 
Utopia Kingdoms scaling case. From 4 users to 50.000+
Utopia Kingdoms scaling case. From 4 users to 50.000+Utopia Kingdoms scaling case. From 4 users to 50.000+
Utopia Kingdoms scaling case. From 4 users to 50.000+Python Ireland
 
Utopia Kindgoms scaling case: From 4 to 50K users
Utopia Kindgoms scaling case: From 4 to 50K usersUtopia Kindgoms scaling case: From 4 to 50K users
Utopia Kindgoms scaling case: From 4 to 50K usersJaime Buelta
 
Big data @ uber vu (1)
Big data @ uber vu (1)Big data @ uber vu (1)
Big data @ uber vu (1)Mihnea Giurgea
 
Tokamak 4: KDE Plasma Netbook
Tokamak 4: KDE Plasma NetbookTokamak 4: KDE Plasma Netbook
Tokamak 4: KDE Plasma NetbookMarco Martin
 
Der Freitag, A Use Case
Der Freitag, A Use CaseDer Freitag, A Use Case
Der Freitag, A Use Casekhink
 
An EyeWitness View into your Network
An EyeWitness View into your NetworkAn EyeWitness View into your Network
An EyeWitness View into your NetworkCTruncer
 
Security and why you need to review yours.
Security and why you need to review yours.Security and why you need to review yours.
Security and why you need to review yours.David Busby, CISSP
 
Activity feeds (and more) at mate1
Activity feeds (and more) at mate1Activity feeds (and more) at mate1
Activity feeds (and more) at mate1Hisham Mardam-Bey
 
Apache Cassandra at Target - Cassandra Summit 2014
Apache Cassandra at Target - Cassandra Summit 2014Apache Cassandra at Target - Cassandra Summit 2014
Apache Cassandra at Target - Cassandra Summit 2014Dan Cundiff
 
Server fleet management using Camunda by Akhil Ahuja
Server fleet management using Camunda by Akhil AhujaServer fleet management using Camunda by Akhil Ahuja
Server fleet management using Camunda by Akhil Ahujacamunda services GmbH
 
React - The JavaScript Library for User Interfaces
React - The JavaScript Library for User InterfacesReact - The JavaScript Library for User Interfaces
React - The JavaScript Library for User InterfacesJumping Bean
 
Our journey into scalable player engagement platform
Our journey into scalable player engagement platformOur journey into scalable player engagement platform
Our journey into scalable player engagement platformIdan Fridman
 
Gatling - Bordeaux JUG
Gatling - Bordeaux JUGGatling - Bordeaux JUG
Gatling - Bordeaux JUGslandelle
 
10 ways to improve your Android app performance
10 ways to improve your Android app performance10 ways to improve your Android app performance
10 ways to improve your Android app performanceBoris Farber
 
(Greach 2015) Decathlon Sport Meeting
(Greach 2015) Decathlon Sport Meeting(Greach 2015) Decathlon Sport Meeting
(Greach 2015) Decathlon Sport MeetingAlonso Torres
 
Rules for Fools: The Rules Module
Rules for Fools: The Rules ModuleRules for Fools: The Rules Module
Rules for Fools: The Rules ModuleWill Hall
 
Monitoring Big Data Systems - "The Simple Way"
Monitoring Big Data Systems - "The Simple Way"Monitoring Big Data Systems - "The Simple Way"
Monitoring Big Data Systems - "The Simple Way"Demi Ben-Ari
 
Debugging data pipelines @OLA by Karan Kumar
Debugging data pipelines @OLA by Karan KumarDebugging data pipelines @OLA by Karan Kumar
Debugging data pipelines @OLA by Karan KumarShubham Tagra
 

Similar a Building ZingMe News Feed System (20)

Building zing me news feed system
Building zing me news feed systemBuilding zing me news feed system
Building zing me news feed system
 
Utopia Kingdoms scaling case. From 4 users to 50.000+
Utopia Kingdoms scaling case. From 4 users to 50.000+Utopia Kingdoms scaling case. From 4 users to 50.000+
Utopia Kingdoms scaling case. From 4 users to 50.000+
 
Utopia Kindgoms scaling case: From 4 to 50K users
Utopia Kindgoms scaling case: From 4 to 50K usersUtopia Kindgoms scaling case: From 4 to 50K users
Utopia Kindgoms scaling case: From 4 to 50K users
 
Big data @ uber vu (1)
Big data @ uber vu (1)Big data @ uber vu (1)
Big data @ uber vu (1)
 
Tokamak 4: KDE Plasma Netbook
Tokamak 4: KDE Plasma NetbookTokamak 4: KDE Plasma Netbook
Tokamak 4: KDE Plasma Netbook
 
Der Freitag, A Use Case
Der Freitag, A Use CaseDer Freitag, A Use Case
Der Freitag, A Use Case
 
An EyeWitness View into your Network
An EyeWitness View into your NetworkAn EyeWitness View into your Network
An EyeWitness View into your Network
 
Security and why you need to review yours.
Security and why you need to review yours.Security and why you need to review yours.
Security and why you need to review yours.
 
Activity feeds (and more) at mate1
Activity feeds (and more) at mate1Activity feeds (and more) at mate1
Activity feeds (and more) at mate1
 
Apache Cassandra at Target - Cassandra Summit 2014
Apache Cassandra at Target - Cassandra Summit 2014Apache Cassandra at Target - Cassandra Summit 2014
Apache Cassandra at Target - Cassandra Summit 2014
 
Server fleet management using Camunda by Akhil Ahuja
Server fleet management using Camunda by Akhil AhujaServer fleet management using Camunda by Akhil Ahuja
Server fleet management using Camunda by Akhil Ahuja
 
React - The JavaScript Library for User Interfaces
React - The JavaScript Library for User InterfacesReact - The JavaScript Library for User Interfaces
React - The JavaScript Library for User Interfaces
 
Our journey into scalable player engagement platform
Our journey into scalable player engagement platformOur journey into scalable player engagement platform
Our journey into scalable player engagement platform
 
Gatling - Bordeaux JUG
Gatling - Bordeaux JUGGatling - Bordeaux JUG
Gatling - Bordeaux JUG
 
10 ways to improve your Android app performance
10 ways to improve your Android app performance10 ways to improve your Android app performance
10 ways to improve your Android app performance
 
Lambda architecture
Lambda architectureLambda architecture
Lambda architecture
 
(Greach 2015) Decathlon Sport Meeting
(Greach 2015) Decathlon Sport Meeting(Greach 2015) Decathlon Sport Meeting
(Greach 2015) Decathlon Sport Meeting
 
Rules for Fools: The Rules Module
Rules for Fools: The Rules ModuleRules for Fools: The Rules Module
Rules for Fools: The Rules Module
 
Monitoring Big Data Systems - "The Simple Way"
Monitoring Big Data Systems - "The Simple Way"Monitoring Big Data Systems - "The Simple Way"
Monitoring Big Data Systems - "The Simple Way"
 
Debugging data pipelines @OLA by Karan Kumar
Debugging data pipelines @OLA by Karan KumarDebugging data pipelines @OLA by Karan Kumar
Debugging data pipelines @OLA by Karan Kumar
 

Más de Chau Thanh

ZaloPay Merchant Platform on K8S on-premise
ZaloPay Merchant Platform on K8S on-premiseZaloPay Merchant Platform on K8S on-premise
ZaloPay Merchant Platform on K8S on-premiseChau Thanh
 
ZaloPay Merchant Platform on K8S on-premise
ZaloPay Merchant Platform on K8S on-premiseZaloPay Merchant Platform on K8S on-premise
ZaloPay Merchant Platform on K8S on-premiseChau Thanh
 
Cache hcm-topdev
Cache hcm-topdevCache hcm-topdev
Cache hcm-topdevChau Thanh
 
Design a scalable social network: Problems and solutions
Design a scalable social network: Problems and solutionsDesign a scalable social network: Problems and solutions
Design a scalable social network: Problems and solutionsChau Thanh
 
Design a scalable site: Problem and solutions
Design a scalable site: Problem and solutionsDesign a scalable site: Problem and solutions
Design a scalable site: Problem and solutionsChau Thanh
 
Design a scalable social network: Problems and Solutions
Design a scalable social network: Problems and SolutionsDesign a scalable social network: Problems and Solutions
Design a scalable social network: Problems and SolutionsChau Thanh
 
IoT and developer chances
IoT and developer chancesIoT and developer chances
IoT and developer chancesChau Thanh
 
Zing Me Real Time Web Chat Architect
Zing Me Real Time Web Chat ArchitectZing Me Real Time Web Chat Architect
Zing Me Real Time Web Chat ArchitectChau Thanh
 
Zingme practice for building scalable website with PHP
Zingme practice for building scalable website with PHPZingme practice for building scalable website with PHP
Zingme practice for building scalable website with PHPChau Thanh
 

Más de Chau Thanh (9)

ZaloPay Merchant Platform on K8S on-premise
ZaloPay Merchant Platform on K8S on-premiseZaloPay Merchant Platform on K8S on-premise
ZaloPay Merchant Platform on K8S on-premise
 
ZaloPay Merchant Platform on K8S on-premise
ZaloPay Merchant Platform on K8S on-premiseZaloPay Merchant Platform on K8S on-premise
ZaloPay Merchant Platform on K8S on-premise
 
Cache hcm-topdev
Cache hcm-topdevCache hcm-topdev
Cache hcm-topdev
 
Design a scalable social network: Problems and solutions
Design a scalable social network: Problems and solutionsDesign a scalable social network: Problems and solutions
Design a scalable social network: Problems and solutions
 
Design a scalable site: Problem and solutions
Design a scalable site: Problem and solutionsDesign a scalable site: Problem and solutions
Design a scalable site: Problem and solutions
 
Design a scalable social network: Problems and Solutions
Design a scalable social network: Problems and SolutionsDesign a scalable social network: Problems and Solutions
Design a scalable social network: Problems and Solutions
 
IoT and developer chances
IoT and developer chancesIoT and developer chances
IoT and developer chances
 
Zing Me Real Time Web Chat Architect
Zing Me Real Time Web Chat ArchitectZing Me Real Time Web Chat Architect
Zing Me Real Time Web Chat Architect
 
Zingme practice for building scalable website with PHP
Zingme practice for building scalable website with PHPZingme practice for building scalable website with PHP
Zingme practice for building scalable website with PHP
 

Último

Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 

Último (20)

Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 

Building ZingMe News Feed System

  • 1. Building Zingme News Feed System Chau Nguyen Nhat Thanh Senior Software Manager User Platform Division - VNG
  • 2. Agenda 1) Introduction to News Feed 2) ZingMe News Feed system history 3) ZingMe News Feed system 4) Some statistics 5) Bonus 6) Q&A
  • 4. Introduction to News Feed ● Update friends' info ● Update Biz info ● Update VIP info ● Interaction to them by comment, like ...
  • 8. Introduction to News Feed ● Terms ● Social graph: Users in most social networking sites are describable in terms of a social graph. The relationships between users are represented by adjacency lists. If Jack and Jill are friends, they are said to be adjacent. This is known as an "edge" in the graph. (from Quora) ● Not only Friends ● but also Followers …
  • 9. Introduction to News Feed ● What do we need? ● Someone does actions, his friend will see these action in his home as soon as possible ● What will we solve the problems? ● Solution 1: Push model (fan out on write) ● Solution 2: Pull model (fan out on read) ● Solution 3: Mixing push and pull (Feeding Frenzy- a paper from Yahoo)
  • 10. Introduction to News Feed ● Push model ● This method involves denormalizing the user's activity data and pushing the meta data to all the user's friends at the time it occurs. (from Quora) ● Pull model ● This method involves keeping all recent activity data in memory and pulling in (or fanning out) that data at the time a user loads their home page. Data doesn't need to be pushed out to all subscribers as soon as it happens, so no back-log and no disk seeks (from Quora) ● Mix model ● Active user using push model ● Non active user using pull
  • 11. ZingMe News Feed system history
  • 12. ZingMe News Feed system history ● First version ● Using PHP for worker ● Using MySQL for feed item ● Using MySQL for feed indexing ● Having full feature: feed type filtering, ignoring users .. ● Restarting DB and other services are the favorite jobs at that time :) ● Lesson learn: – Relation DB may not be fit for this kind of project
  • 13. ZingMe News Feed system history ● Second version ● Still using PHP for worker ● Using Cassandra for feed item ● Using home build list id service for feed indexing ● Using Memcached for caching item ● Removing all deluxe features :) (stupid features due to our limited technique) ● Restarting Cassandra, and waiting for compaction is our favorite jobs :) :) ● Headache with changing avatar ● Lesson learn: believe only ourself
  • 14. ZingMe News Feed system history ● Third version ● Moving to Java for better performance ● Still using Cassandra for feed item ● Trying to use redis in Lab ● Keep only simple features (KISS) ● Cannot control memcache – The new one expired before the old one ??? – Memcached is wrong ??? ● Cannot believe to Cassandra ● Lesson learn: memcached is not the “thuốc tiên” :)
  • 15. ZingMe News Feed system (The current one :))
  • 17. ZingMe News Feed system ● Still using push model because of Twitter public some info related to this model ● Not enough technical when choosing pull model ● Begin to understand a little bit about how to keep it scaling ● Do not use Cassandra any more for such kind of this system → do not believe to anyone, learn from what they do and try our best
  • 18.
  • 19. ZingMe News Feed system ● Feed Item ● UserId, ObjectId, Created date... ● Storage: home build based on Kyoto Cabinet ● Fast recovery when crash ● Feed Index ● UserId → [feedId1,feedId2...] ● Storage: home build ● Fast recovery when crash
  • 20. ZingMe News Feed system ● Rate limit ● Prefilter Spam or auto tool based on rate of write request ● When hit limit, block that user for amount of time ● Feed writer ● Receive the write command ● Get the next Id from Generator ● Push the item to queue ● Return the feedId for future reference
  • 21. ZingMe News Feed system ● Gearman feed storage queue ● Very fast ● Support multi language client ● Some time block the all workers when network unstable :) ● Solve most of our heavy jobs
  • 22. ZingMe News Feed system ● Feed Sync center ● Sync the new feed to the others such as: – Spam detection – Feed ranking system – Logging system ● Feed replication function for future use
  • 23. ZingMe News Feed system ● Feed Render worker ● The main and heavy job: – Get the feed item – Extract the template id – Get user info – Render the feed based on them ● Put rendered feed in to appropriate cache ● Mobile and Desktop are totally different
  • 24. ZingMe News Feed system ● Feed Aggregate ● Get the feed index ● Get the rendered item from cache ● Return to the front-end ● Some cheat: – If the cached items less than 5, in stead of returning the data return a JavaScript to reload that list – At the same time push a task to warm-up the rendered cache ● Auto fail-over when a cache service die
  • 26. Some statistics ● ~15M actions / day ● 10% Spam ● Gift receive ● Meaningless status ● Cache hit 98% ● ~80M registered users ● ~3M active users / days ● Max 1000 friends only ● Unlimited followers
  • 27. Bonus ● Twemcache (https://github.com/twitter/twemcache) ● From Twitter ● Solve most problems with memcached ● More strategy for eviction items – Item LRU eviction: per-slabclass LRU eviction – Random eviction : evict all items from a randomly chosen slab – ... ● Twemcache proxy ● Redis (http://redis.io) ● Replacement for home build when you have not enough time ● Set is default supported ● Supported cluster ● Persistence
  • 29. Q&A ● What is the problem with followers? ● Do that with the trick ● Cheating the owner ;)
  • 31. Q&A Contact info: Chau Nguyen Nhat Thanh thanhcnn@vng.com.vn me.zing.vn/thanhcnn2000