SlideShare a Scribd company logo
1 of 36
1
ONLINE TALK
Deploying and Operating
KSQL
2
Neil is a senior engineer and technologist at Confluent, the
company founded by the creators of Apache Kafka®. He has over
20 years of expertise of working on distributed computing,
messaging and stream processing. He has built or redesigned
commercial messaging platforms, distributed caching products as
well as developed large scale bespoke systems for tier-1 banks.
After a period at ThoughtWorks, he went on to build some of the
first distributed risk engines in financial services. In 2008 he
launched a startup that specialised in distributed data analytics and
visualization. Then prior to joining Confluent he was the CTO at a
fintech consultancy.
Neil Avery
Senior Engineer and Technologist, Confluent
3
Housekeeping Items
● This session will last about an hour.
● This session will be recorded.
● You can submit your questions by entering them into the GoToWebinar panel.
● The last 10-15 minutes will consist of Q&A.
● The slides and recording will be available after the talk.
Agenda
• Deployment
• Configuration
• Scaling
• Monitoring
5
First things first
• Getting KSQL binaries is easy
Download: https://www.confluent.io/download/
Confluent Open Source 4.1+ (free)
Confluent Enterprise 4.1+ (30-day trial)
• Links to downloads, docs, news, examples, etc.
https://confluent.io/ksql
• KSQL code is open source (Apache license)
https://github.com/confluentinc/ksql
6
Deploying KSQL – Getting Started
• For development, e.g. on your laptop, use the Confluent CLI:
$ confluent start
• Starts up a full set of services:
Zookeeper & Kafka Broker
Schema Registry
KSQL Server
REST Proxy
Kafka Connect
Control Center
7
Deploying KSQL – Getting Started
8
Deploying KSQL – Starting KSQL Server
• KSQL Server acts as a Kafka client
Run it on nodes separate from the Kafka Brokers
• Provide a configuration file of settings
• From your installation directory:
$ bin/ksql-server-start config/ksql-server.properties
9
KSQL Server Configuration
• The configuration file has only a few mandatory options:
bootstrap.servers – where to find the Kafka Broker(s)
listeners – ports on which to listen for connections from the KSQL CLI
• Optional:
ksql.service.id – a name to group together a pool of KSQL Servers
• Optionally, add any property the embedded Kafka consumers and producers or Kafka Streams API would understand
e.g. security configurations
• Example:
bootstrap.servers=broker1:9092
listeners=http://localhost:8088
ksql.streams.commit.interval.ms=1000
producer.interceptor.classes=io.confluent.monitoring.clients.interceptor.MonitoringProducerInterceptor
consumer.interceptor.classes=io.confluent.monitoring.clients.interceptor.MonitoringConsumerInterceptor
10
Connecting to a Secured Kafka cluster
security.protocol=SASL_SSL
sasl.mechanism=PLAIN
sasl.jaas.config=
org.apache.kafka.common.security.plain.PlainLoginModule required
username="<name of the user KSQL should use>"
password="<the password>";
Exact settings you will need will vary depending on what SASL mechanism your
Kafka cluster is using and how your SSL certificates are signed. For full details,
please refer to the Security section of the Kafka documentation
<http://kafka.apache.org/documentation.html#security>
11
Connecting to a Schema Registry (Optional)
• Add Schema Registry address in the same configuration file
• If your Schema Registry is secured, you will also need to set a KSQL_OPTS environment variable when starting KSQL
Server to specify the connection credentials
12
Starting KSQL CLI
• KSQL CLI interfaces with a KSQL Server over HTTP
• Start by specifying the address of the target KSQL Server
13
Starting KSQL (preview) web interface
• 1. Download https://s3.amazonaws.com/ksql-experimental-ui/ksql-experimental-ui-0.1.war
• 2. Copy the war into ksql/ui folder
• 3. Run ksql-server-start Start by specifying the address of the target KSQL Server
http://localhost:8080/index.html
14
The Bigger Picture
15
Log Files
• See config/log4j.properties or config/log4j-rolling.properties
16
Patterns & Best Practices
• KSQL Server pools
– per team / project / use-case
• “headless” vs. “interactive”
$ bin/ksql-server-start config/my.properties - -queries-file /path/to/foo.sql
17
Scaling
• KSQL Servers are Kafka clients
• Queries act as Consumer Groups
• Partitions are the limit of scale-out
18
Scaling your data model
• Partitions – 1 topic has multiple queries – the number of partitions determines horizontal scale
• Queries performance (200k/second) (log-resilience using kafka)
• Partitions are the limit of scale-out -
19
Scaling your data model
• Partitions are the limit of scale-out – over 30k per typical server
• Query throughput determined by serialization
• Latency considerations
20
Scaling KSQL Server
• Using K8s & Docker (create pods of Server instances – deploy using an application.sql file)
• Monitor using Control Centre & Datadog & others
• Latency considerations
21
Example Application
Ecommerce Site HadoopEvent Stream Support
22
Example Application
https://github.com/bluemonk3y/ksql-recipe-fraudulent-txns
23
Show & Explain Queries
KSQL > show queries
KSQL > explain CSAS_SUSPICIOUS_TXNS;
24
Using JMX Monitoring….
25
KSQL-Server JMX metrics
$ export JMX_PORT=1099 && bin/ksql-server-start config/nicks-ksqlserver.properties
• Attach JConsole or tool of choice
• OR
• jstatd– run it on every host!
• Remotely connect and use Visualvm
26
Viewing JMX Metrics
27
KSQL Server Metrics
28
KSQL Metrics
29
Input Topic Metrics
30
Output Topic Metrics
31
Transient Query Metrics
32
Transient vs Persistent Queries
33
Drivers of Load and Throughput
• Messages
- message size (same as for any Kafka Client)
- message format (JSON is more expensive in CPU)
• Message (de)serialization is the most CPU-intensive aspect of any query
- in throughput testing, all queries are CPU-bound
- start with 4 cores minimum
• Use SSD if any joins or aggregations
• Relative resource demand: Query Type CPU RAM DISK
Project, filter n/a Medium None
Join n/a High Medium
Aggregate n/a High High
Questions
?
35
Thank you for joining us!
36
Example Application
https://github.com/bluemonk3y/ksql-recipe-fraudulent-txns

More Related Content

What's hot

UKOUG, Oracle Transaction Locks
UKOUG, Oracle Transaction LocksUKOUG, Oracle Transaction Locks
UKOUG, Oracle Transaction Locks
Kyle Hailey
 

What's hot (20)

Introduction to Kafka Streams
Introduction to Kafka StreamsIntroduction to Kafka Streams
Introduction to Kafka Streams
 
CDC Stream Processing with Apache Flink
CDC Stream Processing with Apache FlinkCDC Stream Processing with Apache Flink
CDC Stream Processing with Apache Flink
 
Stream processing using Kafka
Stream processing using KafkaStream processing using Kafka
Stream processing using Kafka
 
From Zero to Hero with Kafka Connect
From Zero to Hero with Kafka ConnectFrom Zero to Hero with Kafka Connect
From Zero to Hero with Kafka Connect
 
ksqlDB: Building Consciousness on Real Time Events
ksqlDB: Building Consciousness on Real Time EventsksqlDB: Building Consciousness on Real Time Events
ksqlDB: Building Consciousness on Real Time Events
 
Kafka Streams: What it is, and how to use it?
Kafka Streams: What it is, and how to use it?Kafka Streams: What it is, and how to use it?
Kafka Streams: What it is, and how to use it?
 
Introduction To Streaming Data and Stream Processing with Apache Kafka
Introduction To Streaming Data and Stream Processing with Apache KafkaIntroduction To Streaming Data and Stream Processing with Apache Kafka
Introduction To Streaming Data and Stream Processing with Apache Kafka
 
Building robust CDC pipeline with Apache Hudi and Debezium
Building robust CDC pipeline with Apache Hudi and DebeziumBuilding robust CDC pipeline with Apache Hudi and Debezium
Building robust CDC pipeline with Apache Hudi and Debezium
 
Tuning Apache Kafka Connectors for Flink.pptx
Tuning Apache Kafka Connectors for Flink.pptxTuning Apache Kafka Connectors for Flink.pptx
Tuning Apache Kafka Connectors for Flink.pptx
 
Apache Kafka – (Pattern and) Anti-Pattern
Apache Kafka – (Pattern and) Anti-PatternApache Kafka – (Pattern and) Anti-Pattern
Apache Kafka – (Pattern and) Anti-Pattern
 
Confluent와 함께 Data in Motion 실현
Confluent와 함께 Data in Motion 실현Confluent와 함께 Data in Motion 실현
Confluent와 함께 Data in Motion 실현
 
UKOUG, Oracle Transaction Locks
UKOUG, Oracle Transaction LocksUKOUG, Oracle Transaction Locks
UKOUG, Oracle Transaction Locks
 
Improving Kafka at-least-once performance at Uber
Improving Kafka at-least-once performance at UberImproving Kafka at-least-once performance at Uber
Improving Kafka at-least-once performance at Uber
 
KSQL Deep Dive - The Open Source Streaming Engine for Apache Kafka
KSQL Deep Dive - The Open Source Streaming Engine for Apache KafkaKSQL Deep Dive - The Open Source Streaming Engine for Apache Kafka
KSQL Deep Dive - The Open Source Streaming Engine for Apache Kafka
 
A visual introduction to Apache Kafka
A visual introduction to Apache KafkaA visual introduction to Apache Kafka
A visual introduction to Apache Kafka
 
kafka
kafkakafka
kafka
 
How Apache Kafka® Works
How Apache Kafka® WorksHow Apache Kafka® Works
How Apache Kafka® Works
 
Introduction to Kafka connect
Introduction to Kafka connectIntroduction to Kafka connect
Introduction to Kafka connect
 
Meet up roadmap cloudera 2020 - janeiro
Meet up   roadmap cloudera 2020 - janeiroMeet up   roadmap cloudera 2020 - janeiro
Meet up roadmap cloudera 2020 - janeiro
 
Ingestion in data pipelines with Managed Kafka Clusters in Azure HDInsight
Ingestion in data pipelines with Managed Kafka Clusters in Azure HDInsightIngestion in data pipelines with Managed Kafka Clusters in Azure HDInsight
Ingestion in data pipelines with Managed Kafka Clusters in Azure HDInsight
 

Similar to Deploying and Operating KSQL

Intel open stack-summit-session-nov13-final
Intel open stack-summit-session-nov13-finalIntel open stack-summit-session-nov13-final
Intel open stack-summit-session-nov13-final
Deepak Mane
 

Similar to Deploying and Operating KSQL (20)

Deploying and Operating KSQL
Deploying and Operating KSQLDeploying and Operating KSQL
Deploying and Operating KSQL
 
Putting Kafka In Jail – Best Practices To Run Kafka On Kubernetes & DC/OS
Putting Kafka In Jail – Best Practices To Run Kafka On Kubernetes & DC/OSPutting Kafka In Jail – Best Practices To Run Kafka On Kubernetes & DC/OS
Putting Kafka In Jail – Best Practices To Run Kafka On Kubernetes & DC/OS
 
Kafka Explainaton
Kafka ExplainatonKafka Explainaton
Kafka Explainaton
 
Data Pipelines with Kafka Connect
Data Pipelines with Kafka ConnectData Pipelines with Kafka Connect
Data Pipelines with Kafka Connect
 
Webinar: Unlock the Power of Streaming Data with Kinetica and Confluent
Webinar: Unlock the Power of Streaming Data with Kinetica and ConfluentWebinar: Unlock the Power of Streaming Data with Kinetica and Confluent
Webinar: Unlock the Power of Streaming Data with Kinetica and Confluent
 
AMIS Oracle OpenWorld 2015 Review – part 2- Hardware & IaaS and PaaS Cloud Fo...
AMIS Oracle OpenWorld 2015 Review – part 2- Hardware & IaaS and PaaS Cloud Fo...AMIS Oracle OpenWorld 2015 Review – part 2- Hardware & IaaS and PaaS Cloud Fo...
AMIS Oracle OpenWorld 2015 Review – part 2- Hardware & IaaS and PaaS Cloud Fo...
 
Tech-Spark: SQL Server on Linux
Tech-Spark: SQL Server on LinuxTech-Spark: SQL Server on Linux
Tech-Spark: SQL Server on Linux
 
New Features in Confluent Platform 6.0 / Apache Kafka 2.6
New Features in Confluent Platform 6.0 / Apache Kafka 2.6New Features in Confluent Platform 6.0 / Apache Kafka 2.6
New Features in Confluent Platform 6.0 / Apache Kafka 2.6
 
Confluent Platform 5.4 + Apache Kafka 2.4 Overview (RBAC, Tiered Storage, Mul...
Confluent Platform 5.4 + Apache Kafka 2.4 Overview (RBAC, Tiered Storage, Mul...Confluent Platform 5.4 + Apache Kafka 2.4 Overview (RBAC, Tiered Storage, Mul...
Confluent Platform 5.4 + Apache Kafka 2.4 Overview (RBAC, Tiered Storage, Mul...
 
Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with A...
Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with A...Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with A...
Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with A...
 
Au delà des brokers, un tour de l’environnement Kafka | Florent Ramière
Au delà des brokers, un tour de l’environnement Kafka | Florent RamièreAu delà des brokers, un tour de l’environnement Kafka | Florent Ramière
Au delà des brokers, un tour de l’environnement Kafka | Florent Ramière
 
Confluent Operator as Cloud-Native Kafka Operator for Kubernetes
Confluent Operator as Cloud-Native Kafka Operator for KubernetesConfluent Operator as Cloud-Native Kafka Operator for Kubernetes
Confluent Operator as Cloud-Native Kafka Operator for Kubernetes
 
Beyond the Brokers: A Tour of the Kafka Ecosystem
Beyond the Brokers: A Tour of the Kafka EcosystemBeyond the Brokers: A Tour of the Kafka Ecosystem
Beyond the Brokers: A Tour of the Kafka Ecosystem
 
Beyond the brokers - A tour of the Kafka ecosystem
Beyond the brokers - A tour of the Kafka ecosystemBeyond the brokers - A tour of the Kafka ecosystem
Beyond the brokers - A tour of the Kafka ecosystem
 
Elastic Kubernetes Services (EKS)
Elastic Kubernetes Services (EKS)Elastic Kubernetes Services (EKS)
Elastic Kubernetes Services (EKS)
 
KSQL---Streaming SQL for Apache Kafka
KSQL---Streaming SQL for Apache KafkaKSQL---Streaming SQL for Apache Kafka
KSQL---Streaming SQL for Apache Kafka
 
Best Practices for Running Kafka on Docker Containers
Best Practices for Running Kafka on Docker ContainersBest Practices for Running Kafka on Docker Containers
Best Practices for Running Kafka on Docker Containers
 
Intel open stack-summit-session-nov13-final
Intel open stack-summit-session-nov13-finalIntel open stack-summit-session-nov13-final
Intel open stack-summit-session-nov13-final
 
Distributed & Highly Available server applications in Java and Scala
Distributed & Highly Available server applications in Java and ScalaDistributed & Highly Available server applications in Java and Scala
Distributed & Highly Available server applications in Java and Scala
 
Container orchestration k8s azure kubernetes services
Container orchestration  k8s azure kubernetes servicesContainer orchestration  k8s azure kubernetes services
Container orchestration k8s azure kubernetes services
 

More from confluent

More from confluent (20)

Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
Santander Stream Processing with Apache Flink
Santander Stream Processing with Apache FlinkSantander Stream Processing with Apache Flink
Santander Stream Processing with Apache Flink
 
Unlocking the Power of IoT: A comprehensive approach to real-time insights
Unlocking the Power of IoT: A comprehensive approach to real-time insightsUnlocking the Power of IoT: A comprehensive approach to real-time insights
Unlocking the Power of IoT: A comprehensive approach to real-time insights
 
Workshop híbrido: Stream Processing con Flink
Workshop híbrido: Stream Processing con FlinkWorkshop híbrido: Stream Processing con Flink
Workshop híbrido: Stream Processing con Flink
 
Industry 4.0: Building the Unified Namespace with Confluent, HiveMQ and Spark...
Industry 4.0: Building the Unified Namespace with Confluent, HiveMQ and Spark...Industry 4.0: Building the Unified Namespace with Confluent, HiveMQ and Spark...
Industry 4.0: Building the Unified Namespace with Confluent, HiveMQ and Spark...
 
AWS Immersion Day Mapfre - Confluent
AWS Immersion Day Mapfre   -   ConfluentAWS Immersion Day Mapfre   -   Confluent
AWS Immersion Day Mapfre - Confluent
 
Eventos y Microservicios - Santander TechTalk
Eventos y Microservicios - Santander TechTalkEventos y Microservicios - Santander TechTalk
Eventos y Microservicios - Santander TechTalk
 
Q&A with Confluent Experts: Navigating Networking in Confluent Cloud
Q&A with Confluent Experts: Navigating Networking in Confluent CloudQ&A with Confluent Experts: Navigating Networking in Confluent Cloud
Q&A with Confluent Experts: Navigating Networking in Confluent Cloud
 
Citi TechTalk Session 2: Kafka Deep Dive
Citi TechTalk Session 2: Kafka Deep DiveCiti TechTalk Session 2: Kafka Deep Dive
Citi TechTalk Session 2: Kafka Deep Dive
 
Build real-time streaming data pipelines to AWS with Confluent
Build real-time streaming data pipelines to AWS with ConfluentBuild real-time streaming data pipelines to AWS with Confluent
Build real-time streaming data pipelines to AWS with Confluent
 
Q&A with Confluent Professional Services: Confluent Service Mesh
Q&A with Confluent Professional Services: Confluent Service MeshQ&A with Confluent Professional Services: Confluent Service Mesh
Q&A with Confluent Professional Services: Confluent Service Mesh
 
Citi Tech Talk: Event Driven Kafka Microservices
Citi Tech Talk: Event Driven Kafka MicroservicesCiti Tech Talk: Event Driven Kafka Microservices
Citi Tech Talk: Event Driven Kafka Microservices
 
Confluent & GSI Webinars series - Session 3
Confluent & GSI Webinars series - Session 3Confluent & GSI Webinars series - Session 3
Confluent & GSI Webinars series - Session 3
 
Citi Tech Talk: Messaging Modernization
Citi Tech Talk: Messaging ModernizationCiti Tech Talk: Messaging Modernization
Citi Tech Talk: Messaging Modernization
 
Citi Tech Talk: Data Governance for streaming and real time data
Citi Tech Talk: Data Governance for streaming and real time dataCiti Tech Talk: Data Governance for streaming and real time data
Citi Tech Talk: Data Governance for streaming and real time data
 
Confluent & GSI Webinars series: Session 2
Confluent & GSI Webinars series: Session 2Confluent & GSI Webinars series: Session 2
Confluent & GSI Webinars series: Session 2
 
Data In Motion Paris 2023
Data In Motion Paris 2023Data In Motion Paris 2023
Data In Motion Paris 2023
 
Confluent Partner Tech Talk with Synthesis
Confluent Partner Tech Talk with SynthesisConfluent Partner Tech Talk with Synthesis
Confluent Partner Tech Talk with Synthesis
 
The Future of Application Development - API Days - Melbourne 2023
The Future of Application Development - API Days - Melbourne 2023The Future of Application Development - API Days - Melbourne 2023
The Future of Application Development - API Days - Melbourne 2023
 
The Playful Bond Between REST And Data Streams
The Playful Bond Between REST And Data StreamsThe Playful Bond Between REST And Data Streams
The Playful Bond Between REST And Data Streams
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 

Deploying and Operating KSQL

  • 2. 2 Neil is a senior engineer and technologist at Confluent, the company founded by the creators of Apache Kafka®. He has over 20 years of expertise of working on distributed computing, messaging and stream processing. He has built or redesigned commercial messaging platforms, distributed caching products as well as developed large scale bespoke systems for tier-1 banks. After a period at ThoughtWorks, he went on to build some of the first distributed risk engines in financial services. In 2008 he launched a startup that specialised in distributed data analytics and visualization. Then prior to joining Confluent he was the CTO at a fintech consultancy. Neil Avery Senior Engineer and Technologist, Confluent
  • 3. 3 Housekeeping Items ● This session will last about an hour. ● This session will be recorded. ● You can submit your questions by entering them into the GoToWebinar panel. ● The last 10-15 minutes will consist of Q&A. ● The slides and recording will be available after the talk.
  • 5. 5 First things first • Getting KSQL binaries is easy Download: https://www.confluent.io/download/ Confluent Open Source 4.1+ (free) Confluent Enterprise 4.1+ (30-day trial) • Links to downloads, docs, news, examples, etc. https://confluent.io/ksql • KSQL code is open source (Apache license) https://github.com/confluentinc/ksql
  • 6. 6 Deploying KSQL – Getting Started • For development, e.g. on your laptop, use the Confluent CLI: $ confluent start • Starts up a full set of services: Zookeeper & Kafka Broker Schema Registry KSQL Server REST Proxy Kafka Connect Control Center
  • 7. 7 Deploying KSQL – Getting Started
  • 8. 8 Deploying KSQL – Starting KSQL Server • KSQL Server acts as a Kafka client Run it on nodes separate from the Kafka Brokers • Provide a configuration file of settings • From your installation directory: $ bin/ksql-server-start config/ksql-server.properties
  • 9. 9 KSQL Server Configuration • The configuration file has only a few mandatory options: bootstrap.servers – where to find the Kafka Broker(s) listeners – ports on which to listen for connections from the KSQL CLI • Optional: ksql.service.id – a name to group together a pool of KSQL Servers • Optionally, add any property the embedded Kafka consumers and producers or Kafka Streams API would understand e.g. security configurations • Example: bootstrap.servers=broker1:9092 listeners=http://localhost:8088 ksql.streams.commit.interval.ms=1000 producer.interceptor.classes=io.confluent.monitoring.clients.interceptor.MonitoringProducerInterceptor consumer.interceptor.classes=io.confluent.monitoring.clients.interceptor.MonitoringConsumerInterceptor
  • 10. 10 Connecting to a Secured Kafka cluster security.protocol=SASL_SSL sasl.mechanism=PLAIN sasl.jaas.config= org.apache.kafka.common.security.plain.PlainLoginModule required username="<name of the user KSQL should use>" password="<the password>"; Exact settings you will need will vary depending on what SASL mechanism your Kafka cluster is using and how your SSL certificates are signed. For full details, please refer to the Security section of the Kafka documentation <http://kafka.apache.org/documentation.html#security>
  • 11. 11 Connecting to a Schema Registry (Optional) • Add Schema Registry address in the same configuration file • If your Schema Registry is secured, you will also need to set a KSQL_OPTS environment variable when starting KSQL Server to specify the connection credentials
  • 12. 12 Starting KSQL CLI • KSQL CLI interfaces with a KSQL Server over HTTP • Start by specifying the address of the target KSQL Server
  • 13. 13 Starting KSQL (preview) web interface • 1. Download https://s3.amazonaws.com/ksql-experimental-ui/ksql-experimental-ui-0.1.war • 2. Copy the war into ksql/ui folder • 3. Run ksql-server-start Start by specifying the address of the target KSQL Server http://localhost:8080/index.html
  • 15. 15 Log Files • See config/log4j.properties or config/log4j-rolling.properties
  • 16. 16 Patterns & Best Practices • KSQL Server pools – per team / project / use-case • “headless” vs. “interactive” $ bin/ksql-server-start config/my.properties - -queries-file /path/to/foo.sql
  • 17. 17 Scaling • KSQL Servers are Kafka clients • Queries act as Consumer Groups • Partitions are the limit of scale-out
  • 18. 18 Scaling your data model • Partitions – 1 topic has multiple queries – the number of partitions determines horizontal scale • Queries performance (200k/second) (log-resilience using kafka) • Partitions are the limit of scale-out -
  • 19. 19 Scaling your data model • Partitions are the limit of scale-out – over 30k per typical server • Query throughput determined by serialization • Latency considerations
  • 20. 20 Scaling KSQL Server • Using K8s & Docker (create pods of Server instances – deploy using an application.sql file) • Monitor using Control Centre & Datadog & others • Latency considerations
  • 21. 21 Example Application Ecommerce Site HadoopEvent Stream Support
  • 23. 23 Show & Explain Queries KSQL > show queries KSQL > explain CSAS_SUSPICIOUS_TXNS;
  • 25. 25 KSQL-Server JMX metrics $ export JMX_PORT=1099 && bin/ksql-server-start config/nicks-ksqlserver.properties • Attach JConsole or tool of choice • OR • jstatd– run it on every host! • Remotely connect and use Visualvm
  • 33. 33 Drivers of Load and Throughput • Messages - message size (same as for any Kafka Client) - message format (JSON is more expensive in CPU) • Message (de)serialization is the most CPU-intensive aspect of any query - in throughput testing, all queries are CPU-bound - start with 4 cores minimum • Use SSD if any joins or aggregations • Relative resource demand: Query Type CPU RAM DISK Project, filter n/a Medium None Join n/a High Medium Aggregate n/a High High
  • 35. 35 Thank you for joining us!