A RESTful Java Framework for Asynchronous High-Speed Ingest

Similar documents
What every DBA needs to know about JDBC connection pools Bridging the language barrier between DBA and Middleware Administrators

Everything You Need to Know About MySQL Group Replication

Multitenancy and Continuous Availability for Java Applications Oracle Database 18

ADBA Asynchronous Database Access

Lightstreamer. The Streaming-Ajax Revolution. Product Insight

Turning Relational Database Tables into Spark Data Sources

Measuring HEC Performance For Fun and Profit

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

MySQL HA Solutions Selecting the best approach to protect access to your data

WLS Neue Optionen braucht das Land

Application Container Cloud

Copyright 2013, Oracle and/or its affiliates. All rights reserved. CON-7777, JMS and WebSocket for Lightweight and Efficient Messaging

<Insert Picture Here> QCon: London 2009 Data Grid Design Patterns

Diplomado Certificación

Pimp My Data Grid. Brian Oliver Senior Principal Solutions Architect <Insert Picture Here>

Deploying Spatial Applications in Oracle Public Cloud

Javaentwicklung in der Oracle Cloud

1 Copyright 2011, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 8

State of the Dolphin Developing new Apps in MySQL 8

Mark Falco Oracle Coherence Development

Oracle 10g and IPv6 IPv6 Summit 11 December 2003

Bipul Sinha, Amit Ganesh, Lilian Hobbs, Oracle Corp. Dingbo Zhou, Basavaraj Hubli, Manohar Malayanur, Fannie Mae

Power your cloud infrastructure with Oracle VM and Cisco!

Oracle WebCenter Portal Performance Tuning

Transformation-free Data Pipelines by combining the Power of Apache Kafka and the Flexibility of the ESB's

What every DBA needs to know about JDBC connection pools * Bridging the language barrier between DBA and Middleware Administrators

Contents Overview of the Compression Server White Paper... 5 Business Problem... 7

Mix n Match Async and Group Replication for Advanced Replication Setups. Pedro Gomes Software Engineer

Autonomous Data Warehouse in the Cloud

Oracle Primavera P6 Enterprise Project Portfolio Management Performance and Sizing Guide. An Oracle White Paper December 2011

Oracle Enterprise Manager 12c IBM DB2 Database Plug-in

The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into

MSG: An Overview of a Messaging System for the Grid

Oracle Business Activity Monitoring 12c Best Practices ORACLE WHITE PAPER DECEMBER 2015

Splunk & AWS. Gain real-time insights from your data at scale. Ray Zhu Product Manager, AWS Elias Haddad Product Manager, Splunk

IBM B2B INTEGRATOR BENCHMARKING IN THE SOFTLAYER ENVIRONMENT

Using Java CompletionStage in Asynchronous Programming

RFC 003 Event Service October Computer Science Department October 2001 Request for Comments: 0003 Obsoletes: none.

Introduction to MySQL InnoDB Cluster

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

How to scale Windows Azure Application

MySQL & NoSQL: The Best of Both Worlds


Reactive Microservices Architecture on AWS

Keep Learning with Oracle University

Object Persistence Design Guidelines

DNS Level 100. Rohit Rahi November Copyright 2018, Oracle and/or its affiliates. All rights reserved.

Oracle and.net: Best Practices for Performance. Christian Shay & Alex Keh Product Managers Oracle October 28, 2015

Copyright 2018, Oracle and/or its affiliates. All rights reserved.

Oracle NoSQL Database at OOW 2017

Oracle Secure Backup 12.2 What s New. Copyright 2018, Oracle and/or its affiliates. All rights reserved.

Solaris Engineered Systems

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

Hidden Gems in JD Edwards Orchestrator and AIS Server

MySQL InnoDB Cluster. MySQL HA Made Easy! Miguel Araújo Senior Software Developer MySQL Middleware and Clients. FOSDEM 18 - February 04, 2018

Performance and Load Testing R12 With Oracle Applications Test Suite

Oracle Database 12c: JMS Sharded Queues

REST APIs on z/os. How to use z/os Connect RESTful APIs with Modern Cloud Native Applications. Bill Keller

IaaS Vendor Comparison

Primavera Compression Server 5.0 Service Pack 1 Concept and Performance Results

DATA INTEGRATION PLATFORM CLOUD. Experience Powerful Data Integration in the Cloud

MySQL Cluster Web Scalability, % Availability. Andrew

What's New in MySQL 5.7?

Extreme Performance Platform for Real-Time Streaming Analytics

Group Replication: A Journey to the Group Communication Core. Alfranio Correia Principal Software Engineer

Oracle Primavera P6 Enterprise Project Portfolio Management Performance and Sizing Guide. An Oracle White Paper April 2011

MySQL High Availability. Michael Messina Senior Managing Consultant, Rolta-AdvizeX /

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

End-to-End Java Security Performance Enhancements for Oracle SPARC Servers Performance engineering for a revenue product

State of MySQL Group Replication

Help Us Help You - TFA Collector and the Support Tools Bundle

<Insert Picture Here> A Brief Introduction to Live Object Pattern

<Insert Picture Here> Oracle Application Cache Solution: Coherence

Best Practices for Performance

Oracle Enterprise Manager 12c Sybase ASE Database Plug-in

Oracle APEX 18.1 New Features

Moving Databases to Oracle Cloud: Performance Best Practices

WebLogic JMS Clustering. Jayesh Patel

Copyright 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12

Java EE 7 is ready What to do next? Peter Doschkinow Senior Java Architect

Oracle Zero Data Loss Recovery Appliance (ZDLRA)

Safe Harbor Statement

Oracle Database 12c: RAC Administration Ed 1

Craig Blitz Oracle Coherence Product Management

GIS - Clustering Architectures. Raj Kumar Integration Management 9/25/2008

SEDA: An Architecture for Well-Conditioned, Scalable Internet Services

An Oracle White Paper August Building Highly Scalable Web Applications with XStream

Oracle Secure Backup 12.1 Technical Overview

Achieving Scalability and High Availability for clustered Web Services using Apache Synapse. Ruwan Linton WSO2 Inc.

INFRASTRUCTURE BEST PRACTICES FOR PERFORMANCE

Understanding Oracle RAC ( ) Internals: The Cache Fusion Edition

DBAs can use Oracle Application Express? Why?

NOSQL DATABASE CLOUD SERVICE. Flexible Data Models. Zero Administration. Automatic Scaling.

MySQL CLOUD SERVICE. Propel Innovation and Time-to-Market

Large-Scale Patch Automation for the Cloud-Generation DBAs

Oracle Database Exadata Cloud Service Exadata Performance, Cloud Simplicity DATABASE CLOUD SERVICE

Keep Learning with Oracle University

The Z Garbage Collector An Introduction

White Paper. Major Performance Tuning Considerations for Weblogic Server

1 Copyright 2011, Oracle and/or its affiliates. All rights reserved. reserved. Insert Information Protection Policy Classification from Slide 8

Transcription:

A RESTful Java Framework for Asynchronous High-Speed Ingest Pablo Silberkasten Jean De Lavarene Kuassi Mensah JDBC Product Development October 5, 2017 3

Safe Harbor Statement The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle s products remains at the sole discretion of Oracle. 4

Program Agenda 1 2 3 4 5 What is an HTTP/REST High-Speed Ingestor? Common issues when ingesting data Our approach to address those issues Coding and implementing this approach Demo architecture and execution! 5

Program Agenda 1 2 3 4 5 What is an HTTP/REST High-Speed Ingestor? Common issues when ingesting data Our approach to address those issues Coding and implementing this approach Demo architecture and execution! 6

What is a REST Ingestor? A separate channel (HTTP/REST) to stream data into the database It receives data continuously, concurrently (>10k concurrent clients) and with hightraffic to be inserted on the database. It exposes REST APIs: operational (stream data) administrative (CRUD operations over the destination) 7

Program Agenda 1 2 3 4 5 What is an HTTP/REST High-Speed Ingestor? Common issues when ingesting data Our approach to address those issues Coding and implementing this approach Demo architecture and execution! 8

Common issues when ingesting data Resource Contention and Transparency Number of connections/sessions becomes a performance issue and a bottleneck for scaling. Regular jdbc sql inserts does not scale. Clients blocks for a response. Transparently resolve -no changes on the client-: Routing High Availability Disaster Recover Planned Maintenance and changes in the database topology. Database upgrades (new features, version translation is not trivial. 9

Program Agenda 1 2 3 4 5 What is an HTTP/REST High-Speed Ingestor? Common issues when ingesting data Our approach to address those issues Coding and implementing this approach Demo architecture and execution! 10

Our approach Decouple clients from the database using a proxy-like design pattern. Multiplex connections (reuse). Work asynchronously (do not block for a response). Be able to scale: collect objects on 1000 s of sockets using just a handful of threads based on Java NIO Selector s API and State Machine algorithms. Build Batch Inserts blocks. Write unblockingly and asynchronously on the database. Be able to route inserts based on attributes of the objects and state of the database nodes. 11

Program Agenda 1 2 3 4 5 What is an HTTP/REST High-Speed Ingestor? Common issues when ingesting data Our approach to address those issues Coding and implementing this approach Demo architecture and execution! 12

The code challenge. Use just a handful of threads. Yet read/write over thousands of sockets. Expose a non-blocking, lightweight, stand-alone interface (and build it!). Using standard protocols. Protecting the infrastructure through flow control (backpressure). Optimize the persistence of data. Unblockingly sending prepared messages to the database. Provide High-Availability. Provide Scalability: elastically growing over the demand. Listen for events on the database. 13

Handful of threads being able to provide IO over thousands of open sockets. // Main class starting a server socket // EVERYTHING IS EVENT DRIVEN!! RESTServer server = new RESTServer(); server.startserverchannel(new AcceptEventListener() { Rest Request Ack. Persist. State Machine Algorithms with partially read requests @Override public void onaccept(socketchannel channel) { // Incoming channel set non-blocking channel.configureblocking(false); // Associate a listener for the business logic and // registers on a pool of threads where the logic will // be executed (10k s o listeners on a pool of threads) server.registerlistener(channel, new IOEventListener() { @Override public void onread() throws IOException { // Retrieve buffer associated to this // channel and resume reading until end ByteBuffer buffer = channels.get(channel); int bytesread = channel.read(buffer); // won t block! if ( reachendofrequest) { // When the reading is over send ack // Http- 200 immediately, process is async. } else { continue } 14

Non-blocking, lightweight, stand-alone interface using standard protocols 1/2. // RESTServer s methods to start a ServerSocketChannel public ServerSocketChannel startserverchannel( final AcceptEventListener listener, final int port) throws IOException { Rest Request Ack. Persist. State Machine Algorithms with partially read requests // Create server channel ServerSocketChannel serversocketchannel = ServerSocketChannel. open(); serversocketchannel.bind(new InetSocketAddress(port)).configureBlocking(false); // <--!! // Register in SelectionServices, which is // the same pool as the IOEventListener SelectionServices. getdefaultservice().register(serversocketchannel, new AcceptEventHandler(serverSocketChannel, listener)); } return serversocketchannel; 15

Non-blocking, lightweight, stand-alone interface using standard protocols 2/2. /* Rest Request Ack. Persist. Admin API State Machine Algorithms with partially read requests ß On Error/Event Cloud- based API both for admin and operational usage. Operational: putrecord putrecordbatch Admin: addstorage liststorage removestorage updatestorage Storage update can take Lambdas to act upon events (including errors). */ 16

Optimize the persistence of data, unblockingly sending prepared messages to the database 1/2.... if (reachendofrequest) { Rest Request Ack. Persist. State Machine Algorithms with partially read requests // Before sending ack to client build object // TODO Optimize, we might not need to unmarshall MyObject myobject = MyObject.fromJSonByteBufferJSon(buffer); // Queue on database workers databaseworkers. queue(myobject); // send response bufferresponse.rewind(); channel. write(bufferresponse); // clear buffer buffer.clear(); } 17

Optimize the persistence of data, unblockingly sending prepared messages to the database 2/2. /* Two more options to optimize the data persistence: Rest Request Ack. Persist. State Machine Algorithms with partially read requests 1. Using specific technology for the database (going out of the JDBC spec), like Direct Path in Oracle Database (OCI ready, we are working on adding this support in the thin driver too). 2. Using the async. Driver (check on Douglas presentation). */ 18

High Availability and Elasticity Redundancy over intercommunicated managed servers (nodes) on a cluster. Session states are stored in an outside memory data grid (Coherence*Web optionally) to migrate sessions over nodes. Template servers that can be automatically started (and stopped) to satisfy an increase on the demand depending on thresholds and using template values. Front End Http Load Balancer 19

Database event awareness UCP/Simplefan usage to receive events from the database and re-route requests accordingly Node Down Event: to act upon the event of a node going down. Service Down Event: to act upon the event of service going down. Load Advisory Event: to route requests based on the load of the nodes in the cluster. FAN EVENTS 20

Program Agenda 1 2 3 4 5 What is an HTTP/REST High-Speed Ingestor? Common issues when ingesting data Our approach to address those issues Coding and implementing this approach Demo architecture and execution! 21

The Demo High level tech. approach (recap.) Service Layer DB Worker Layer POST Service Thread Service Thread Service Thread Service Thread Flow Control DB Thread Worker DB Thread Worker DB Thread Worker DB Thread Worker DB Thread Worker DB Thread Worker DB Thread Worker DB Thread Worker DB Thread Worker DB Thread Worker DB Thread Worker DB Thread Worker DB Write 22

The Demo - Execution JMeter (load simulator) running on 1 Exalogic X4-2 compute node*. 10.000 concurrent threads 2 start up time 1 between posts 1kb payload Collector running on 1 Exalogic X4-2 compute node*. 4 threads for service I/O 10 worker threads to persist on database (each one with a dedicated connection to the db) Oracle Database 12c running on 1 Exalogic X4-2 compute node*. Table: EventId Timestamp Event Generation Timestamp Event Ingestion Payload (1Kb)) Rate: 10.000 rpc/second Avg. response time: ~ 2-3ms Inserted > 1M rows ~ 1gb *Exalogic X4-2 compute node - Memory: 94.6GB - CPU 12 cores, 24 threads, 2 sockets, Intel Xeon Processor X5675 3.07GHz, 23

Demo 24

Q&A Next Steps 25