SlideShare a Scribd company logo
1 of 23
Download to read offline
Pragmatic Software
Development in q/kdb+
Ajay Rathore
My preferred tools for kdb+/q
development
● Sublime Text3
● Maven
● Git
● Jenkins
● Docker
Sublime Text3
● Light on the CPU, faster startup
● Symbol indexing across projects, which allows you to
use Goto Definition and Goto Symbol to jump to related
code in other files. Pretty huge
● Lots of open source plugins to enhance and customize
● Kdb+ syntax highlighting sublime-q
Screenshot of my IDE below
Maven
Maven’s primary goal is to allow a developer to comprehend the
complete state of a development effort in the shortest period of
time. In order to attain this goal there are several areas of concern
that Maven attempts to deal with:
● Making the build process easy
● Providing a uniform build system
● Providing quality project information
● Providing guidelines for best practices development
● Allowing transparent migration to new features
Apart from the above benefits, one of the biggest
advantage of using maven is that it allows certain level of
modularity in big kdb+ projects. Using maven we can break
kdb+ libraries and services into smaller, manageable
artifacts and using nexus repositories we can publish and
share those artifacts across different teams.
Let me give a simple example.
Suppose we want to create a logging library which can be
shared across different kdb services without duplicating the
code.
Maven project layout will look something like below
Assembly.xml (This will create a zip archive maintaining the
dir structure relative to src/main/kdb)
pom.xml
When we run “mvn install” on above project, maven will create a zip
artifact “logging-library-1.0-SNAPSHOT-dist.zip” and push that into
nexus repository.
In order for other projects to use this logging library, they will need to
declare a maven dependency in their project pom.
<dependency>
<groupId>com.kdb.ajay</groupId>
<artifactId>logging-library</artifactId>
<version>1.0-SNAPSHOT</version>
<classifier>dist</classifier>
<type>zip</type>
</dependency>
Provided those other projects are also assembled as zip
distribution, maven dependency plugin will pull any dependencies
and package everything together in a single artifact while
maintaining the individual project’s directory structure. Now for
using the functions in the logging library, other q files will need to
simply load the library using
l code/logging.q
For deployment purpose, we can use maven-antrun-plugin to scp
the final zip archive to any target server and unzip it and initialize
the service.
Git
Git is probably the most popular distributed version control
system out there, it can be used as a server out of the box.
Dedicated Git server software helps, amongst other features,
to add access control, display the contents of a Git repository
via the web, and help managing multiple repositories.
For hosting the code, there are couple of options for free
web-based Git repository hosting service like github and
bitbucket. I prefer using bitbucket which allows private
repositories.
Git can be integrated with maven using <scm> tag, this allows
maven to automatically push any tagged artifacts when user
runs mvn release:prepare and release:perform.
Jenkins
Jenkins is an open source continuous integration server.
Basically Continuous Integration is the practice of running
your tests on a non-developer machine automatically every
time someone pushes new code into the git repository. It
gets tightly integrated with maven and git.
There are multiple ways of setting up jenkins git repository
monitoring, whenever new code is pushed to git either
master or feature branch, jenkins can download any
changes and build the branch and can deploy the artifact to
the dev or uat server. All of this can be automated and
speeds up develop-test-release cycles.
Docker
Docker is an open source technology and provides a
convenient way to ship any infrastructure code and
supporting libraries and tools along with the application
code. You can look into references section for more
resources on docker.
We can make use of couple of maven plugins for creating
docker images of our kdb services and push those into
docker registries via jenkins job.
Project structure will look something like
For building docker images and integrating into maven
lifecycle we can create a maven docker profile
To invoke the above docker profile we can simply call
mvn clean install -P docker
This will result in following sequence of events, first of all maven will
build project zip artifact and put it inside project build directory which
by default is project-root/target/
After that maven-resource plugin will run in the prepare-package
phase and will copy all files inside src/main/docker dir to target/docker
and project build artifact from target to target/docker dir, it will also
replace any property place holders via resource filtering. Now
everything we need to build docker image is inside target/docker dir
Next we invoke maven-antrun-plugin in package phase. It will perform
two tasks, first it sets up appropriate file permission on
target/docker/build.sh and then run that script to produce docker
image.
build.sh
The above script simply invokes docker build command inside
target/docker/ dir which has dockerfile with all the instructions for
building the kdb service image.
Dockerfile
Once the docker image is produced, we can simply launch the
container using container port mapping and docker volumes for
loading data from SAN or NAS.
docker run -v
/Users/ajay/deploy/kdb-tick/data/marketdata:/home/ajay/services/kdb-t
ick/data/marketdata --name marketdata -td -p 5000:5000 -p
5001:5001 -p 5002:5002 ajayrathore/kdb-tick-marketdata
The above container will launch a standard kdb tick triplet with
tickerplant on port 5000, realtime on port 5001 and hdb on port 5002.
Historic data is mounted from localhost using docker -v flag.
References
Maven
Git
Jenkins
Docker

More Related Content

What's hot

What's hot (20)

Gradle
GradleGradle
Gradle
 
My kubernetes toolkit
My kubernetes toolkitMy kubernetes toolkit
My kubernetes toolkit
 
Continuous Deployment with Kubernetes, Docker and GitLab CI
Continuous Deployment with Kubernetes, Docker and GitLab CIContinuous Deployment with Kubernetes, Docker and GitLab CI
Continuous Deployment with Kubernetes, Docker and GitLab CI
 
The path to a serverless-native era with Kubernetes
The path to a serverless-native era with KubernetesThe path to a serverless-native era with Kubernetes
The path to a serverless-native era with Kubernetes
 
Advanced Git - Functionality and Features
Advanced Git - Functionality and FeaturesAdvanced Git - Functionality and Features
Advanced Git - Functionality and Features
 
Nugwc k8s session-16-march-2021
Nugwc k8s session-16-march-2021Nugwc k8s session-16-march-2021
Nugwc k8s session-16-march-2021
 
Dockercon 2018 EU Updates
Dockercon 2018 EU Updates Dockercon 2018 EU Updates
Dockercon 2018 EU Updates
 
Introduction to Kubernetes with demo
Introduction to Kubernetes with demoIntroduction to Kubernetes with demo
Introduction to Kubernetes with demo
 
Gradle
GradleGradle
Gradle
 
Day 2 Kubernetes - Tools for Operability (Velocity London Meetup)
Day 2 Kubernetes - Tools for Operability (Velocity London Meetup)Day 2 Kubernetes - Tools for Operability (Velocity London Meetup)
Day 2 Kubernetes - Tools for Operability (Velocity London Meetup)
 
Puzzle ITC Talk @Docker CH meetup CI CD_with_Openshift_0.2
Puzzle ITC Talk @Docker CH meetup CI CD_with_Openshift_0.2Puzzle ITC Talk @Docker CH meetup CI CD_with_Openshift_0.2
Puzzle ITC Talk @Docker CH meetup CI CD_with_Openshift_0.2
 
Gradle build capabilities
Gradle build capabilities Gradle build capabilities
Gradle build capabilities
 
An overview of the Kubernetes architecture
An overview of the Kubernetes architectureAn overview of the Kubernetes architecture
An overview of the Kubernetes architecture
 
Docker containerd Kubernetes sig node
Docker containerd Kubernetes sig nodeDocker containerd Kubernetes sig node
Docker containerd Kubernetes sig node
 
Next-gen DevOps engineering with Docker and Kubernetes by Antons Kranga
Next-gen DevOps engineering with Docker and Kubernetes by Antons KrangaNext-gen DevOps engineering with Docker and Kubernetes by Antons Kranga
Next-gen DevOps engineering with Docker and Kubernetes by Antons Kranga
 
Top 3 reasons why you should run your Enterprise workloads on GKE
Top 3 reasons why you should run your Enterprise workloads on GKETop 3 reasons why you should run your Enterprise workloads on GKE
Top 3 reasons why you should run your Enterprise workloads on GKE
 
Continuous Delivery with Jenkins
Continuous Delivery with JenkinsContinuous Delivery with Jenkins
Continuous Delivery with Jenkins
 
Testing with Docker
Testing with DockerTesting with Docker
Testing with Docker
 
Introduction of Kubernetes - Trang Nguyen
Introduction of Kubernetes - Trang NguyenIntroduction of Kubernetes - Trang Nguyen
Introduction of Kubernetes - Trang Nguyen
 
Automate App Container Delivery with CI/CD and DevOps
Automate App Container Delivery with CI/CD and DevOpsAutomate App Container Delivery with CI/CD and DevOps
Automate App Container Delivery with CI/CD and DevOps
 

Similar to Pragmatic software development in kdb+

Jenkins advance topic
Jenkins advance topicJenkins advance topic
Jenkins advance topic
Kalkey
 
Devops Online Training.pdf
Devops Online Training.pdfDevops Online Training.pdf
Devops Online Training.pdf
SpiritsoftsTraining
 

Similar to Pragmatic software development in kdb+ (20)

FOSDEM 2017: GitLab CI
FOSDEM 2017:  GitLab CIFOSDEM 2017:  GitLab CI
FOSDEM 2017: GitLab CI
 
Jenkins advance topic
Jenkins advance topicJenkins advance topic
Jenkins advance topic
 
Devops Online Training.pdf
Devops Online Training.pdfDevops Online Training.pdf
Devops Online Training.pdf
 
Devops Online Training.pdf
Devops Online Training.pdfDevops Online Training.pdf
Devops Online Training.pdf
 
Devops Online Training.pdf
Devops Online Training.pdfDevops Online Training.pdf
Devops Online Training.pdf
 
Devops Online Training.pdf
Devops Online Training.pdfDevops Online Training.pdf
Devops Online Training.pdf
 
Devops Online Training.pdf
Devops Online Training.pdfDevops Online Training.pdf
Devops Online Training.pdf
 
Session 2
Session 2Session 2
Session 2
 
Session 2
Session 2Session 2
Session 2
 
[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101
 
Exploring the Exciting Features of Spring Boot 3.1.pdf
Exploring the Exciting Features of Spring Boot 3.1.pdfExploring the Exciting Features of Spring Boot 3.1.pdf
Exploring the Exciting Features of Spring Boot 3.1.pdf
 
Microservices in Java
Microservices in JavaMicroservices in Java
Microservices in Java
 
Container on azure
Container on azureContainer on azure
Container on azure
 
CD in kubernetes using helm and ksonnet. Stas Kolenkin
CD in kubernetes using helm and ksonnet. Stas KolenkinCD in kubernetes using helm and ksonnet. Stas Kolenkin
CD in kubernetes using helm and ksonnet. Stas Kolenkin
 
Docker and kubernetes
Docker and kubernetesDocker and kubernetes
Docker and kubernetes
 
DevAssistant, Docker and You
DevAssistant, Docker and YouDevAssistant, Docker and You
DevAssistant, Docker and You
 
GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...
GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...
GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...
 
Overview of Docker
Overview of DockerOverview of Docker
Overview of Docker
 
O'Reilly Software Architecture Conference London 2017: Building Resilient Mic...
O'Reilly Software Architecture Conference London 2017: Building Resilient Mic...O'Reilly Software Architecture Conference London 2017: Building Resilient Mic...
O'Reilly Software Architecture Conference London 2017: Building Resilient Mic...
 
Ultimate Guide to Microservice Architecture on Kubernetes
Ultimate Guide to Microservice Architecture on KubernetesUltimate Guide to Microservice Architecture on Kubernetes
Ultimate Guide to Microservice Architecture on Kubernetes
 

Recently uploaded

+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@
 
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
 

Recently uploaded (20)

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
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
+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...
 
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
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
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
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

Pragmatic software development in kdb+

  • 1. Pragmatic Software Development in q/kdb+ Ajay Rathore
  • 2. My preferred tools for kdb+/q development ● Sublime Text3 ● Maven ● Git ● Jenkins ● Docker
  • 3. Sublime Text3 ● Light on the CPU, faster startup ● Symbol indexing across projects, which allows you to use Goto Definition and Goto Symbol to jump to related code in other files. Pretty huge ● Lots of open source plugins to enhance and customize ● Kdb+ syntax highlighting sublime-q Screenshot of my IDE below
  • 4.
  • 5. Maven Maven’s primary goal is to allow a developer to comprehend the complete state of a development effort in the shortest period of time. In order to attain this goal there are several areas of concern that Maven attempts to deal with: ● Making the build process easy ● Providing a uniform build system ● Providing quality project information ● Providing guidelines for best practices development ● Allowing transparent migration to new features
  • 6. Apart from the above benefits, one of the biggest advantage of using maven is that it allows certain level of modularity in big kdb+ projects. Using maven we can break kdb+ libraries and services into smaller, manageable artifacts and using nexus repositories we can publish and share those artifacts across different teams. Let me give a simple example. Suppose we want to create a logging library which can be shared across different kdb services without duplicating the code.
  • 7. Maven project layout will look something like below
  • 8. Assembly.xml (This will create a zip archive maintaining the dir structure relative to src/main/kdb)
  • 10.
  • 11.
  • 12. When we run “mvn install” on above project, maven will create a zip artifact “logging-library-1.0-SNAPSHOT-dist.zip” and push that into nexus repository. In order for other projects to use this logging library, they will need to declare a maven dependency in their project pom. <dependency> <groupId>com.kdb.ajay</groupId> <artifactId>logging-library</artifactId> <version>1.0-SNAPSHOT</version> <classifier>dist</classifier> <type>zip</type> </dependency> Provided those other projects are also assembled as zip distribution, maven dependency plugin will pull any dependencies
  • 13. and package everything together in a single artifact while maintaining the individual project’s directory structure. Now for using the functions in the logging library, other q files will need to simply load the library using l code/logging.q For deployment purpose, we can use maven-antrun-plugin to scp the final zip archive to any target server and unzip it and initialize the service.
  • 14. Git Git is probably the most popular distributed version control system out there, it can be used as a server out of the box. Dedicated Git server software helps, amongst other features, to add access control, display the contents of a Git repository via the web, and help managing multiple repositories. For hosting the code, there are couple of options for free web-based Git repository hosting service like github and bitbucket. I prefer using bitbucket which allows private repositories. Git can be integrated with maven using <scm> tag, this allows maven to automatically push any tagged artifacts when user runs mvn release:prepare and release:perform.
  • 15. Jenkins Jenkins is an open source continuous integration server. Basically Continuous Integration is the practice of running your tests on a non-developer machine automatically every time someone pushes new code into the git repository. It gets tightly integrated with maven and git. There are multiple ways of setting up jenkins git repository monitoring, whenever new code is pushed to git either master or feature branch, jenkins can download any changes and build the branch and can deploy the artifact to the dev or uat server. All of this can be automated and speeds up develop-test-release cycles.
  • 16. Docker Docker is an open source technology and provides a convenient way to ship any infrastructure code and supporting libraries and tools along with the application code. You can look into references section for more resources on docker. We can make use of couple of maven plugins for creating docker images of our kdb services and push those into docker registries via jenkins job.
  • 17. Project structure will look something like For building docker images and integrating into maven lifecycle we can create a maven docker profile
  • 18.
  • 19. To invoke the above docker profile we can simply call mvn clean install -P docker This will result in following sequence of events, first of all maven will build project zip artifact and put it inside project build directory which by default is project-root/target/ After that maven-resource plugin will run in the prepare-package phase and will copy all files inside src/main/docker dir to target/docker and project build artifact from target to target/docker dir, it will also replace any property place holders via resource filtering. Now everything we need to build docker image is inside target/docker dir Next we invoke maven-antrun-plugin in package phase. It will perform two tasks, first it sets up appropriate file permission on target/docker/build.sh and then run that script to produce docker image.
  • 20. build.sh The above script simply invokes docker build command inside target/docker/ dir which has dockerfile with all the instructions for building the kdb service image.
  • 22. Once the docker image is produced, we can simply launch the container using container port mapping and docker volumes for loading data from SAN or NAS. docker run -v /Users/ajay/deploy/kdb-tick/data/marketdata:/home/ajay/services/kdb-t ick/data/marketdata --name marketdata -td -p 5000:5000 -p 5001:5001 -p 5002:5002 ajayrathore/kdb-tick-marketdata The above container will launch a standard kdb tick triplet with tickerplant on port 5000, realtime on port 5001 and hdb on port 5002. Historic data is mounted from localhost using docker -v flag.