Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Massively Scalable Services at AVAST: Case Study

Massively Scalable Services at AVAST: Case Study

Protection against zero-day attacks, polymorphic malware and computer security in general is moving more and more to "cloud". We build massively scalable low-latency backend systems with REST APIs that must respond to tens of thousands of requests every second. Such a demanding task requires application of the most modern technologies - distributed NoSQL data stores, asynchronous HTTP handling and the latest algorithms. We will show you how we went about creating one such system called FileRep (service that provides reputation of potentially harmful files) using Netty, Cassandra and Scala.
These slides were presented at WebExpo 2014 in Prague.

Jakub Janeček

September 13, 2014
Tweet

More Decks by Jakub Janeček

Other Decks in Programming

Transcript

  1. Observations# ! File suspicious if new or unique in our user

    base.! ! “Cloud” can deliver detections almost instantaneously.!
  2. Observations# ! File suspicious if new or unique in our user

    base.! ! “Cloud” can deliver detections almost instantaneously.! File Reputation service!
  3. Problem# What?! DB of all files in our user base?!

    Requests coming from millions of users at once?!
  4. Terminology# ! Loner – new or unique file, considered suspicious.! ! Topstar

    – well-known file, usually safe.! ! Prevalence – number of unique users having seen the file.!
  5. Terminology# ! Loner – new or unique file, considered suspicious.! ! Topstar

    – well-known file, usually safe.! ! Prevalence – number of unique users having seen the file.! ! Emergence – the first time the file was seen.!
  6. Cluster Architecture# FileRep# Cassandra! PostgreSQL! Mucker# FileRep# Cassandra! FileRep# Cassandra!

    FileRep# Cassandra! FileRep# Cassandra! FileRep# Cassandra! DC1# DC2# DC3#
  7. Platform# class Handler extends RequestHandler[Buffer, Buffer] { def handle(c: Context,

    r: Buffer): Response } boss thread! worker threads! app threads!
  8. Platform# class Handler extends RequestHandler[Buffer, Buffer] { def handle(c: Context,

    r: Buffer): Response } boss thread! worker threads! app threads!
  9. Platform# class Handler extends RequestHandler[Buffer, Buffer] { def handle(c: Context,

    r: Buffer): Response } boss thread! worker threads! app threads!
  10. FileRep v2# ! Evolution of FileRep v1.! ! The idea and functionality

    still the same.! ! Implementation:! ! simplification - Mucker replaced by HLL++,!
  11. FileRep v2# ! Evolution of FileRep v1.! ! The idea and functionality

    still the same.! ! Implementation:! ! simplification - Mucker replaced by HLL++,! ! cleanup - rewritten in Scala.!
  12. Topstar Prevalence# ! Prevalence ≅ 1 000 000! ! User ID =

    16 B! 1000000 * 16 = 16000000 B = 15 MB#
  13. Topstar Prevalence# ! Prevalence ≅ 1 000 000! ! User ID =

    16 B! 1000000 * 16 = 16000000 B = 15 MB# # 15 * 2000000 ≅ 30 GB#
  14. Generalization# ! The idea of reputation can also be applied to:!

    ! domains,! ! Android applications,! ! and others…!
  15. AVAST# Join discussion with the AVAST developers.! ! Follow us

    at Twitter and G+! ! @avast_devs #AVASTdevs"