migrating from oracle to espresso
play

Migrating from Oracle to Espresso David Max Senior Software - PowerPoint PPT Presentation

Migrating from Oracle to Espresso David Max Senior Software Engineer LinkedIn About LinkedIn New York Engineering Located in Empire State Building Approximately 100 engineers and 1000 employees total New York Multiple teams, front


  1. Migrating from Oracle to Espresso David Max Senior Software Engineer LinkedIn

  2. About LinkedIn New York Engineering • Located in Empire State Building • Approximately 100 engineers and 1000 employees total New York • Multiple teams, front end, back Engineering end, and data science

  3. About Me • Software Engineer at LinkedIn NYC since 2015 • Content Ingestion team • Office Hours – Thursday 11:30-12:00 David Max Senior Software Engineer LinkedIn www.linkedin.com/in/davidpmax/

  4. What is Content Ingestion? Content Ingestion Babylonia

  5. Babylonia Content Ingestion

  6. Babylonia Content Ingestion

  7. url: https://www.youtube.com/watch?v=MS3c9hz0bRg title: "SATURN 2017 Keynote: Software is Details” image: Babylonia https://i.ytimg.com/vi/MS3c9hz0bRg/hqdefault.jpg?sq poaymwEYCKgBEF5IVfKriqkDCwgBFQAAiEIYAXAB\\u00 Content Ingestion 26rs=AOn4CLClwjQlBmMeoRCePtHaThN-qXRHqg

  8. Babylonia Content Ingestion

  9. What is Content Ingestion? • Extracts metadata from web pages • Source of Truth for 3 rd party content • Also contains metadata for some public 1 st party content Babylonia • Used by LinkedIn services for sharing, decorating, and embedding content Content Ingestion • Data also feeds into content understanding and relevance models

  10. Babylonia Datasets HDFS Database ETL Babylonia Data Change Events Content Ingestion

  11. Downstream and Upstream Datasets HDFS Offline Database ETL Babylonia Data Change Events Content Ingestion Near Line

  12. Babylonia use of Oracle (before migration) • Schema – Metadata extracted from • RDBMS – Relational Database each URL stored in individual rows Management System • Client –Babylonia the main (but not • Databus – Platform for streaming only) client to directly execute data change events to near line queries on Oracle DB consumers • Rest.li – Most online interaction with • Offline – ETL to HDFS for offline dataset in Oracle via Babylonia’s consumers Rest.li API

  13. Espresso is LinkedIn’s strategic distributed, fault-tolerant NoSQL database that powers many of What is LinkedIn’s services Espresso? • ~100 clusters in use* • ~420TB of SoT data* • ~2 million qps at peak load* * as of August 1, 2017

  14. What is Espresso? • NoSQL – Non relational • Document – A table is a container for documents of the same schema • Distributed – A single database can (defined in Avro) be distributed over a cluster of machines • Keys – Documents index by key fields, which are defined in the table • Scalable – Able to scale clusters schema horizontally by adding more nodes

  15. Why Migrate? • Maintenance – Babylonia’s Oracle • Integration – Support for Espresso tables required periodic jobs to be integrated with other tools and run that involved downtime for each systems at LinkedIn server • Rest.li – Espresso’s API is based on • Cost – Oracle more expensive to run Rest.li, which makes it easier to treat Espresso endpoints like other • Strategy – Espresso is the preferred LinkedIn Rest.li endpoints platform at LinkedIn for data of this type • Schema Evolution – Supported with zero downtime and no coordination • Support – Espresso team part of with DBA teams LinkedIn

  16. Data Formats (Oracle) Pegasus Oracle Row Oracle Row Rest.li Object Endpoints Oracle Row Oracle HDFS Offline Database ETL Pegasus Data Babylonia Oracle Databus Events Content Ingestion Near • Complex transformation Line Oracle Row between Oracle format and Pegasus format

  17. Pegasus and Avro • Pegasus and Avro schema Pegasus Avro definitions are very similar Schema Schema • Both can be used to generate Java objects with very similar interfaces • Pegasus schema can be used to auto-generate the Java Java Objects Objects Avro schema

  18. Data Formats (Espresso) Pegasus Espresso Avro Espresso Avro Rest.li Object Endpoints Espresso Avro Espresso HDFS Offline Database ETL Pegasus Data Babylonia Espresso Brooklin Events Content Ingestion Near • Simple transformation Line Espresso Avro between Avro format and Pegasus format

  19. Why Migrate? Schema Evolution Espresso • ALTER TABLE • Document schema auto-registration • Not tied to code deployment – need to • Schema changes are registered coordinate with DBAs automatically as part of the Babylonia deployment process • Schema change involves server downtime • Backwards compatibility is enforced – existing data does not need to be • In practice, developers go to great transformed lengths to avoid the hassle • Avro schema more natural fit with • Schema accumulates tech debt Rest.li Pegasus schema

  20. • Zero down time • Transparent to Rest.li clients Goals for • Give offline and nearline Migration Process consumers time to migrate • Validate each step • Mirroring in real time

  21. Pre-Migration State of Babylonia Oracle HDFS Offline Database ETL Babylonia Oracle Databus Events Content Ingestion Near Line

  22. Pre-Migration State of Babylonia Rest.li Endpoints Oracle Database Rest.li Calls Oracle Databus Events Other Services

  23. Pre-Migration Cleanup Rest.li • Identify code that is Endpoints tightly-coupled to the Oracle database Database • Decide which code should Rest.li be reimplemented for Calls Oracle Databus Espresso, and which code Events should be decoupled or eliminated. • Reduce number of code Other Services paths to migrate The easiest lines of code to migrate are the lines of code that don’t exist

  24. Bootstrap Espresso Database Offline Oracle HDFS Convert Database ETL Job Espresso Avro Data Espresso Bulk File Database Loader

  25. Bootstrap Espresso Database Oracle HDFS Database ETL Espresso Database

  26. Databus Listener, Shadow Read Validation Oracle Database Shadow Read Validation Oracle Databus Events Espresso Databus Database Listener

  27. Direct Writes to Espresso Oracle Database Shadow Read Validation Oracle Databus Events Direct Espresso Databus Database Listener Write

  28. Resolving Write Conflicts • Dual Write Conflict – Databus Listener • Migration Control – optional and Babylonia updating same record field added to scheme indicating which process wrote the record: Bulk Loader, Oracle Databus Events Databus listener, or Babylonia Direct Espresso Databus Database Listener Write

  29. Espresso New SoT Dual Writes Oracle Deprecated Database Oracle Databus Events Direct Espresso Espresso Read/Write Database Brooklin Events

  30. Oracle Turnoff Direct Espresso Espresso Read/Write Database Brooklin Events

  31. Thank you

Recommend


More recommend