SlideShare uma empresa Scribd logo
1 de 23
Baixar para ler 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

Mais conteúdo relacionado

Mais procurados

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 CIalexanderkiel
 
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 Kubernetessparkfabrik
 
Advanced Git - Functionality and Features
Advanced Git - Functionality and FeaturesAdvanced Git - Functionality and Features
Advanced Git - Functionality and FeaturesAll Things Open
 
Nugwc k8s session-16-march-2021
Nugwc k8s session-16-march-2021Nugwc k8s session-16-march-2021
Nugwc k8s session-16-march-2021Avanti Patil
 
Introduction to Kubernetes with demo
Introduction to Kubernetes with demoIntroduction to Kubernetes with demo
Introduction to Kubernetes with demoOpsta
 
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)bridgetkromhout
 
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.2Amrita Prasad
 
An overview of the Kubernetes architecture
An overview of the Kubernetes architectureAn overview of the Kubernetes architecture
An overview of the Kubernetes architectureIgor Sfiligoi
 
Docker containerd Kubernetes sig node
Docker containerd Kubernetes sig nodeDocker containerd Kubernetes sig node
Docker containerd Kubernetes sig nodePatrick Chanezon
 
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 KrangaJavaDayUA
 
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 GKESreenivas Makam
 
Continuous Delivery with Jenkins
Continuous Delivery with JenkinsContinuous Delivery with Jenkins
Continuous Delivery with JenkinsJadson Santos
 
Testing with Docker
Testing with DockerTesting with Docker
Testing with Dockertoffermann
 
Introduction of Kubernetes - Trang Nguyen
Introduction of Kubernetes - Trang NguyenIntroduction of Kubernetes - Trang Nguyen
Introduction of Kubernetes - Trang NguyenTrang 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 DevOpsDaniel Oh
 

Mais procurados (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
 

Semelhante a Pragmatic software development in kdb+

FOSDEM 2017: GitLab CI
FOSDEM 2017:  GitLab CIFOSDEM 2017:  GitLab CI
FOSDEM 2017: GitLab CIOlinData
 
Jenkins advance topic
Jenkins advance topicJenkins advance topic
Jenkins advance topicKalkey
 
[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101Naukri.com
 
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.pdfInexture Solutions
 
Container on azure
Container on azureContainer on azure
Container on azureVishwas N
 
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 KolenkinDataArt
 
DevAssistant, Docker and You
DevAssistant, Docker and YouDevAssistant, Docker and You
DevAssistant, Docker and YouBalaBit
 
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...Oleg Shalygin
 
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...Ambassador Labs
 
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 Kuberneteskloia
 

Semelhante a 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
 

Último

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 Processorsdebabhi2
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
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.pdfsudhanshuwaghmare1
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
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...Martijn de Jong
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
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...apidays
 
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?Igalia
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 

Último (20)

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
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - 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
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
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...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
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...
 
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?
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 

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.