1 Atigeo Confidential
Cassandra in xPatterns
Cassandra Day Seattle
July 2014
2 Atigeo Confidential
• xPatterns Architecture
• xPatterns dashboard application (Demo)
• Export to NoSql API & GUI (Demo)...
3 Atigeo Confidential
4 Atigeo Confidential
5 Atigeo Confidential
Export to NoSql API
• Datasets in the warehouse need to be exposed to high-throughput low-latency re...
6 Atigeo Confidential
7 Atigeo Confidential
Mesos/Spark cluster
8 Atigeo Confidential
Cassandra multi DC ring – write latency
9 Atigeo Confidential
Nagios monitoring
10 Atigeo Confidential
11 Atigeo Confidential
Referral Provider Network
• One of the many applications that we built for our largest healthcare c...
12 Atigeo Confidential
13 Atigeo Confidential
Graphite – Cassandra multi DC ring
14 Atigeo Confidential
VPC-to-VPC IPSEC Tunnel
15 Atigeo Confidential
• NTP: synchronize ALL clocks (servers and clients)
• Reduce the number of CFs (avoid OOM … memtabl...
16 Atigeo Confidential
Q & A
© 2013 Atigeo, LLC. All rights reserved. Atigeo and the xPatterns logo are trademarks of Atigeo. The information herein is...
Upcoming SlideShare
Loading in …5
×

Cassandra in xPatterns

1,016 views

Published on

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,016
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
17
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide
  • the logical architecture diagram with the 3 logical layers of xPatterns: Infrastructure, Analytics and Visualization and the roles: ELT Engineer, Data Scientist, Application Engineer.
    xPatterns is a big data analytics platform as a service that enables a rapid development of enterprise-grade analytical applications. It provides tools, api sets and a management console for building an ELT pipeline with data monitoring and quality gates, a data warehouse for ad-hoc and scheduled querying, analysis, model building and experimentation, tools for exporting data to NoSql and solrCloud cluster for real-time access through low-latency/high-throughput apis as well as dashboard and visualization api/tools leveraging the available data and models. In this presentation we will showcase one of the analytical applications build on top of xPatterns for our largest customer for that runs xPatterns in production on top a data warehouse consisting of several hundreds TB of medical, pharmacy and lab data records consisting of tens of billions of records. We will showcase the xPatterns components in the form of APIs and tools employed throughout the entire lifecycle of this application.”
  • The physical architecture diagram for our largest customer deployment, demonstrating the enterprise-grade attributes of the platform: scalability, high availability, performance, resilience, manageability while providing means for geo-failover (warehouse), geo-replication (real-time DB), data and system monitoring, instrumentation, backup & restore.
    Cassandra rings are DC-replicated across EC2 east and west coast regions, data between geo-replicas synchronized in real time through an ipsec tunnel (VPC-to-VPC).
    Geo-replicated apis behind an AWS Route 53 DNS service (latency based resource records sets) and ELBs ensures users requests are served from the closest geographical location. Failure to an entire region (happened to us during a big conference!) does not affect our availability and SLAs.
    User facing dashboards are served from Cassandra (real-time store), with data being exported from a data warehouse (Shark/Hive) build on top a Mesos-managed Spark/Hadoop cluster.
    Export jobs are instrumented and provide a throttling mechanism to control throughput.
    Export jobs run on the east-coast only, data is synchronized in real time with the west coast ring. Generated apis are automatically instrumented (Graphite) and monitored (Nagios).
  • Datasets in the warehouse need to be exposed to high-throughput low-latency real-time APIs. Each application requires extra processing performed on top of the core datasets, hence additional transformations are executed for building data marts inside the warehouse
    Pre-optimization Shark/Hive queries required for building an efficient data model for Cassandra persistence: minimal number of column families, wide rows (50-100 MB compressed). Resulting data model is efficient for both read (dashboard/API) and write (export/updates) requests
    Exporter tool builds the efficient data model and runs an export of data from a Shark/Hive table to a Cassandra Column Family, through a custom Spark job with configurable throughput (configurable Spark processors against a Cassandra ring)
    Data Modeling is driven by the read access patterns: lookup key, columns (record fields to read), paging, sorting, filtering.
    The data access patterns is used for automatically publishing a REST api that uses the underlying generated Cassandra data model and it fuels the data in the dashboards
    Execution logs behind workflows, progress report and instrumentation events for the dashboard are pushed to the browser through SSE (Zookeeper watchers used for synchronization)
  • Datasets in the warehouse need to be exposed to high-throughput low-latency real-time APIs. Each application requires extra processing performed on top of the core datasets, hence additional transformations are executed for building data marts inside the warehouse
    Pre-optimization Shark/Hive queries required for building an efficient data model for Cassandra persistence: minimal number of column families, wide rows (50-100 MB compressed). Resulting data model is efficient for both read (dashboard/API) and write (export/updates) requests
    Exporter tool builds the efficient data model and runs an export of data from a Shark/Hive table to a Cassandra Column Family, through a custom Spark job with configurable throughput (configurable Spark processors against a Cassandra ring)
    Data Modeling is driven by the read access patterns: lookup key, columns (record fields to read), paging, sorting, filtering.
    The data access patterns is used for automatically publishing a REST api that uses the underlying generated Cassandra data model and it fuels the data in the dashboards
    Execution logs behind workflows, progress report and instrumentation events for the dashboard are pushed to the browser through SSE (Zookeeper watchers used for synchronization)
  • Mesos/Spark context (CoarseGrainedMode) with a fixed 120 cores spread out across 4 nodes for the export job
  • Instrumentation dashboard showcasing the write latency measured during the export to noSql job (7ms max). Writes are performed against the east-coast DC … they are propagated to the west coast, however the JMX metric exposed (Write.Latency.OneMinuteRate) does not reflect it … need to build a new dashboard with different metrics!
  • Nagios monitoring for the geo-replicated, instrumented generated apis. The APIs (readers) and the Spark executors (writers) have a retry mechanism (AOP aspects) that implement throttling when Cassandra is under siege …
  • Ganglia monitoring Dashboard

  • Referral Provider Network: one of the 6 applications that we built for our healthcare customer using the xPatterns APIs and tools on the new beyond Hadoop infrastructure: ELT Pipeline, Export to NoSQL API. The dashboard for the RPN application was built using D3.js and angular against the generic api published by the export tool.
    The application allows for building a graph of downstream and upstream referred and referring providers, grouped by specialty and with computed aggregates like patient counts, claim counts and total charged amounts. RPN is used for both fraud detection and for aiding a clinic buying decision, by following the busiest graph paths.
    The dataset behind the app consists of 8 billion medical records, from which we extracted 1.7 million providers (Shark warehouse) and built 53 million relationships in the graph (persisted in Cassandra)
    While we demo the graph building we will also look at the Graphite instrumentation dashboard for analyzing the runtime performance of the geo-replicated Cassandra read operations during the demo
     


  • Referral Provider Network: one of the 6 applications that we built for our healthcare customer using the xPatterns APIs and tools on the new beyond Hadoop infrastructure: ELT Pipeline, Export to NoSQL API. The dashboard for the RPN application was built using D3.js and angular against the generic api published by the export tool.
    The application allows for building a graph of downstream and upstream referred and referring providers, grouped by specialty and with computed aggregates like patient counts, claim counts and total charged amounts. RPN is used for both fraud detection and for aiding a clinic buying decision, by following the busiest graph paths.
    The dataset behind the app consists of 8 billion medical records, from which we extracted 1.7 million providers (Shark warehouse) and built 53 million relationships in the graph (persisted in Cassandra)
    While we demo the graph building we will also look at the Graphite instrumentation dashboard for analyzing the runtime performance of the geo-replicated Cassandra read operations during the demo
     

  • Instrumentation dashboard showcasing the read latency measured during peak (40ms average, 60peak)
  • Security Architecture for the VPC-to-VPC hosting the DC-replicated rings.
    Openswan used on the VPN Instances in the public subnets for the ipsec tunnel encryption
    http://aws.amazon.com/articles/5472675506466066

  • Lessons learned over the past 3 years with operating Cassandra rings at scale.
    Custom serialization of objects instead of individually serializing column names/column values for object field names/field values, yields the most performance gains!
    Describe each tip in detail …
  • Cassandra in xPatterns

    1. 1. 1 Atigeo Confidential Cassandra in xPatterns Cassandra Day Seattle July 2014
    2. 2. 2 Atigeo Confidential • xPatterns Architecture • xPatterns dashboard application (Demo) • Export to NoSql API & GUI (Demo) • Data model optimization • Publishing from HDFS/Hive/Shark to Cassandra • Generated REST API’s  Instrumentation  Throttling & auto-retries • Geo-Replication  Cross-data-center replication, encryption & failover • Lessons Learned since 0.6 till 2.0.6 Agenda
    3. 3. 3 Atigeo Confidential
    4. 4. 4 Atigeo Confidential
    5. 5. 5 Atigeo Confidential Export to NoSql API • Datasets in the warehouse need to be exposed to high-throughput low-latency real-time APIs. Each application requires extra processing performed on top of the core datasets, hence additional transformations are executed for building data marts inside the warehouse • Exporter tool builds the efficient data model and runs an export of data from a Shark/Hive table to a Cassandra Column Family, through a custom Spark job with configurable throughput (configurable Spark processors against a Cassandra ring) (instrumentation dashboard embedded, logs, progress and instrumentation events pushed though SSE) • Data Modeling is driven by the read access patterns provided by an application engineer building dashboards and visualizations: lookup key, columns (record fields to read), paging, sorting, filtering • The end result of a job run is a REST API endpoint (instrumented, monitored, resilient, geo- replicated) that uses the underlying generated Cassandra data model and fuels the data in the dashboards • Configuration API provided for creating export jobs and executing them (ad-hoc or scheduled).
    6. 6. 6 Atigeo Confidential
    7. 7. 7 Atigeo Confidential Mesos/Spark cluster
    8. 8. 8 Atigeo Confidential Cassandra multi DC ring – write latency
    9. 9. 9 Atigeo Confidential Nagios monitoring
    10. 10. 10 Atigeo Confidential
    11. 11. 11 Atigeo Confidential Referral Provider Network • One of the many applications that we built for our largest healthcare customers using the xPatterns APIs and tools on the new upgraded infrastructure: ELT Pipeline, Jaws, Export to NoSql API. The dashboard for the RPN application was built using D3.js and angular against the generic api published by the export tool. • The application allows for building a graph of downstream and upstream referred and referring providers, grouped by specialty, with computed aggregates like patient counts, claim counts and total charged amounts. RPN is used for both fraud detection and for aiding a clinic buying decision, by following the busiest graph paths. • The dataset behind the app consists of 8 billion medical records, from which we extracted 1.7 million providers (Shark warehouse) and built 53 million relationships in the graph (persisted in Cassandra) • While we demo the graph building we will also look at the Graphite instrumentation dashboard for analyzing the runtime performance of the geo-replicated Cassandra read operations (latency in the 20-50ms range)
    12. 12. 12 Atigeo Confidential
    13. 13. 13 Atigeo Confidential Graphite – Cassandra multi DC ring
    14. 14. 14 Atigeo Confidential VPC-to-VPC IPSEC Tunnel
    15. 15. 15 Atigeo Confidential • NTP: synchronize ALL clocks (servers and clients) • Reduce the number of CFs (avoid OOM … memtable_total_space_in_mb) • Rows not too skinny and not too wide (avoid OOM) o Less memory pressure during high-throughput writes o Reduced network I/O, less rows, more column slices o Key cache & bloom filter index size affects perf o Efficient compaction, avoid hot spots • Custom serialization and dynamic columns for maximum perf gain (40%) • Do not drop CFs before emptying them (truncate/compact first) • Monitoring, instrumentation, automatic restarts • ConsistencyLevel: ONE is best … for our use cases • Key cache, Snappy (LZ4) compression, vnodes Lessons learned 0.6 - 2.0.6
    16. 16. 16 Atigeo Confidential Q & A
    17. 17. © 2013 Atigeo, LLC. All rights reserved. Atigeo and the xPatterns logo are trademarks of Atigeo. The information herein is for informational purposes only and represents the current view of Atigeo as of the date of this presentation. Because Atigeo must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Atigeo, and Atigeo cannot guarantee the accuracy of any information provided after the date of this presentation. ATIGEO MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

    ×