Automating deployment pipelines is a great way to increase developer productivity and APIs are the easiest way to achieve that. In this blog, we will specifically talk about how developers can use REST APIs to interact with Portworx Data Services and in order to accelerate their deployment frequency and reduce the lead time for changes.
Organizations with higher developer productivity rates often outperform their competitors in the market. Developer productivity is basically the measure of how productive your developers are in any given period. Developers are the most expensive resource an organization has, so to get the most bang for the buck, you need to ensure that you are doing everything you can to increase developer productivity—achieving higher productivity rates will directly translate into better customer experience, leading to lower churn and lower customer acquisition costs.
For the past four years, the State of DevOps Report from DORA (DevOps Research and Assessment) has clearly laid out four key metrics to measure software delivery performance. They are
Lead time for changes
Change failure rate
Time to restore service
In addition to these four, DORA has identified a fifth key metric: reliability to measure operational performance. Organizations are always trying to move from the lower end of the spectrum to the higher/elite end, and there are a few key ways to do that:
Increasing deployment frequency (how often you can push new code to production) from once per month or once every six months to multiple deploys per day
Reducing lead time for changes (how long it takes to go from code committed to code running in production) from once per month or once every six months to once a day or once a week
Reducing change failure rate (the percentage of changes that lead to a service incident that requires remediation) from 46–60% to 0–15%
Reducing time to restore service (how long it takes to restore service after an incident) from one week or one month to less than a day.
Note: Improving these software delivery performance metrics won’t increase your organizational performance if your operational performance or reliability is low (e.g., it won’t matter that you are pushing new features to end users if they aren’t able to access your application reliably).
Improve Developer Productivity Using Portworx Data Services
Portworx Data Services is a database platform as-a-service solution that allows users to deploy data services on any Kubernetes cluster using either a UI-based or a REST API-based workflow. Either of these approaches can be used as the unified way to deploy data services like PostgreSQL, MongoDB, Apache Kafka, Redis, MySQL, and others on Kubernetes clusters running on-prem or in the public cloud. Since REST APIs allow developers to perform operations programmatically these data services can be integrated into application deployment pipelines. Additionally, scale-out and backup procedures can be automated through REST APIs for further application lifecycle management. Portworx Data Services also eliminates the need for the developer to learn Kubernetes in depth—which results in significant time savings for developers, as they don’t need to go through a huge learning curve to understand how Kubernetes works or how to deploy or maintain data services on Kubernetes.
Using REST APIs to interact with Portworx Data Services, developers can use any programming languages that support common HTTP(s) requests to deploy production-grade data services on Kubernetes clusters—without ever having to access the underlying Kubernetes cluster. Developers can also use REST APIs to integrate with existing tools that they might be using as part of their CICD pipelines.
REST APIs with Portworx Data Services
To interact with PDS using REST APIs, a developer simply needs to generate an API key or token that they can use to authenticate with the PDS API Server. To generate a new token, navigate to the Portworx Data Services control plane and click on Profile from the bottom left section of the screen.
You can monitor all the previously generated keys from this page, or you can also create a new key to interact with the PDS API Server.
To create a new key, click + New Key on the right and then enter a name and select the expiration period for the key. Generating a key with an expiration allows users to enforce key rotation to keep access to PDS secured.
Once you have created a new key, you can use it in your REST calls to execute GET, PUT, DELETE or POST calls against the PDS API Server.
If you are just getting started with PDS REST APIs, Portworx also offers a Swagger interface to help you learn more about the different APIs available to perform Day 0 and Day 2 operations for your data services running on Kubernetes.
Once you access the Swagger interface, you can authenticate using the API key that you created in Step 3 and use any APIs to test and generate CURL commands to use in your scripts.
Here are a few examples of CURL commands to help you get started:
If you would like to see more, you can also check out the demo below that walks you through the whole process of generating an API key, using that to deploy a PostgreSQL database instance on an Amazon EKS cluster, and using that database as the backend for a demo stateful application.
Developer productivity is an important metric to improve when you are looking to propel your business forward. Using solutions like Portworx Data Services, you can reduce the time your developers need to wait for resources to be provisioned. To learn more about Portworx Data Services and the features it provides, check out the other blogs on our website.