Since 2009, we have been utilizing our extensive expertise in blockchain technologies to help businesses, both large and small, maximize their efficiency.
Explore More
With more than 400+ experts, Oodles comprises a fantastic resource of business knowledge that spans multiple industries. Whatever the circumstances, we keep to our obligations.
Explore More
At Oodles, we help our clients work with a human understanding but at superhuman speed something that others can't. They thus advance and maintain their lead
6th July 2022
17 min read
Technical Project Manager
Building a scalable Blockchain decentralized application is not an easy task because developing a blockchain-based application needs too many services and applications to deploy on a server. If you want to deploy your blockchain application with high availability system, we need to clarify that our infrastructure is scalable. It is because if there is an increase in traffic on your application, and at the same time, your infrastructure is not ready to serve that mush request. It gives a worse impact on the user experience.
Let's suppose there is an increase in traffic on your blockchain application, and at the same time, your cloud infrastructure is not ready to serve that many requests and gives a bad user experience. It affects your overall business because you miss the golden opportunity. Thus, this is the reason we need to create an automated scalable infrastructure for your DApps.
Today everyone is deploying their application on Kubernetes because it's easy to manage and scalable. But most people don't know how to deploy blockchain applications with automated horizontal pod autoscaling on Kubernetes, which is the trickiest part. Not to worry, we'll let you know how pod autoscaling work when you enable pod autoscaling in your Kubernetes deployment. It simply monitors the application CPU and memory utilization. So, whenever your CPU or memory utilization crosses a threshold (Let's suppose I have set an 85% threshold), our traffic increases on our application. If the utilization limit touches the threshold value, Kubernetes automatically launches another replica pod. Thus this is the way pod scaling works, and that's the beauty of the k8 cluster.
Here is the sample deployment file with Horizontal pod auto-scaling, and you can customize this manifest file based on your application.
deployment_file.yaml
|
--- apiVersion: apps/v1 kind: Deployment metadata: namespace: analytics name: debug-pod spec: selector: matchLabels: app.kubernetes.io/name: debug-pod replicas: 2 template: metadata: labels: app.kubernetes.io/name: debug-pod spec: containers: - image: ubuntu:latest command: - "sleep" - "604800" imagePullPolicy: Always resources: requests: memory: "1000Mi" cpu: "1000m" limits: memory: "1100Mi" cpu: "11000m" name: debug-pod --- apiVersion: autoscaling/v2beta2 kind: HorizontalPodAutoscaler metadata: namespace: analytics name: debug-pod labels: app.kubernetes.io/name: debug-pod spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: debug-pod minReplicas: 1 maxReplicas: 4 metrics: - type: Resource resource: name: cpu target: type: Utilization averageUtilization: 85 - type: Resource resource: name: memory target: type: Utilization averageUtilization: 85 behavior: scaleUp: stabilizationWindowSeconds: 90 |
Deploying your application on Kubernetes with Horizontal pod autoscaling is a good practice because I am sure that you always want your application to be highly available and automatically scalable. With fault tolerance, there is another vertical pod autoscaling feature available in Kubernetes. Thus we will talk about VPA in another blog.
Vishal Yadav
Vishal is a highly skilled backend developer with extensive 3+ years experience in developing various blockchain platforms. He has a comprehensive understanding of the technologies and has hands-on expertise in Node.js, Ethereum, Layer 1 and Layer 2 solutions, smart contract development, and databases like MySQL and MongoDB. He has a proven track record of working on a range of blockchain-related projects, including token development, staking, governance, indexes, bridges, NFT, marketplace, ICO/IDO, and more. He is adept at managing trading bots, and developing centralized exchanges, and has a creative mind with excellent analytical skills.
Technical Project Manager
By using this site, you allow our use of cookies. For more information on the cookies we use and how to delete or block them, please read our cookie notice.
We would love to
hear from you!
Innovate with confidence!