Sr. Drupal dev
Randstad IndiaSenior Drupal dev
IndegeneSr Drupal Dev
Drupal Dev
CIS IndoreDrupal developer
VinfotechSr. Drupal Developer
Relevance LabPHP Developer
Elensoft technologies pvt. ltd
WordPress

PHP
XAMPP

MySQL

jQuery

Git

Javascript

HTML5

Ajax
REST API

Apache
Jira

Visual Studio Code
.png)
CodeIgniter

Postman

Trello

Symfony

React

Vue.js

Salesforce

Lando

Visual Studio

Apache Solr

Memcache

Splunk

SQL Server

Bugzilla

AWS Cloud

Lighthouse
.png)
Docker
.png)
Jenkins

GitHub

Bitbucket

Vagrant

Apache Solr

GitHub

AWS
So my name is Piyush as well, and I'm known from multiple days. I have a total of 8 years of experience in Drupal, and a total of 10 years of IT experience. Currently, I was working with a client where I had my role as a senior triple developer, where I had to handle the team as well as work as a developer. My current role involved handling the cloud, as well as creating components and custom models. I have a site where we have a multi-site setup and integration with multilingual features. The front end is Node JS, with Next JS, and we used Drupal as an API gateway. Apart from development, I'm also involved in pipeline design. CICD means there is a cloud hosting on AWS, which requires designing the CICD pipeline to deploy Node JS and Next JS apps as well as a Drupal app. So yeah. I also have experience working with Kubernetes and Docker. That's it from my experience.
Yeah, so the technique will be involved for implementing an operation in a PHP service interacting with AWS resources. We have multiple API gateways provided by AWS, which offer gateway APIs. We have all those resources residing in AWS, which we have to integrate using Lambda functions. And then those APIs can be exposed using secret managers and PHP. And then PHP can consume those APIs. These are one way. Another way we can utilize AWS resources, like, all the images and assets will be stored in an S3 bucket. And we'll be using S3 storage for storing images and static files, like JavaScript and CSS files, to improve performance. The third one, AWS resources include DNS mapping, where we can map our DNS domain name server and change server names to configure our dev and production environments. We're also using other services, like secret managers to store all credentials in the secret manager. This can be used in PHP to handle APIs, whether related to APIs or any sensitive information, which shouldn't be stored in the database, but in AWS's secret manager and environment labels, which can be used later in PHP. So that's it.
Yeah. So real-time data syncing mechanism, we can use Ajax calls. So Ajax is an asynchronous JavaScript mechanism where all the real-time information can be populated in a front-end using JavaScript as data will be coming from the back-end, which is PHP, MySQL. And we have multiple methods to be used. 1 is a GET method. 2nd is a POST method and which can be used to fetch the data from the PHP and to show that information using an Ajax call in a front-end, JavaScript. So, dollar.ajax is a method. In that, we have to pass up a method, either GET or POST. And then there is a URL parameter, URL, which will be the path of your back-end functions and then success and error response. We have to check whether we are getting the success and failure check, and then we can return that data and handle it in a JavaScript.
So while integrating a JavaScript library with our Drupal module, we will use a Drupal library. Like, we have to create a library to include JavaScript in the module. And, we have to keep in mind such things like that JavaScript library, which should not be comparable with other libraries. It should be compatible with that. And also, the version of JavaScript library should be updated and the latest version we have to use always. And, it should not be included in all the pages, which we have a functionality. That page only, we have to include those JavaScript libraries. So it should not include all the pages which are not useful. And, always use those libraries in the particular pages where the function is getting used, so that the performance will be good. Otherwise, it will impact other pages to load unnecessary JavaScript and which will cause the performance issue later.
So server-side rendering is, means we have everything run on the server side, and the data will be dispatched to the client in the front end, so it will improve the performance as well because the logic will be executed on the server side, and then data will be written in the form of an object in the front end. This server-side rendering then requires us to use backend APIs, which are typically in another server. We have to call the APIs, and the data will come in the JSON format and be rendered in the front end. The server-side rendering is useful when we have data, and we need to perform multiple calculations on that, as well as checks on the database.
So Drupal provides REST APIs and the JSON API model and the REST resource model to create API Drupal services in Drupal. And also, we can have a custom module to create a Drupal service using the resources. So using PHP to improve performance, we have to always use the latest version of REST APIs. And we should not have put a lot of unnecessary calls in the REST API. We have whatever logic we have, we have to reduce that into a modular way so that we can reduce functions and in that way we can utilize those as a performance improvement. And let's say we have some common logic which we are using across the application. So we can create a common controller or functions, and those functions can be used in the same services multiple times. So if we are creating get services or post services, that function needs to be used so we can just utilize the same function call in the particular service. So the maintainability and the performance will be faster because we are not repeating that logic and set of code repetitively. We are just using the same function in a service, so that we should not write multiple times those function calls.
Yeah. So, the constant user one equals to create user where we are passing the John as a first parameter and age as a second parameter. So here, I'm thinking we have to create a before the create user, we have to pass and then we have to have a new keyword so that it will create a object in the object here. And then we should have in the create user functions, which will take a name and age. And instead of underscore construct method, we'll collect those name and ages as a parameter. So the constructor will be automatically called whenever the instantiation is created. So there is no need to create a write a function user. In suit of that, we can use a function underscore construct method construct method. And we should also avoid returning a new user because this is not a good way to write new keywords inside the function. We have to use the new keyword before the new create user out of the functions.
So, the line where we have an if condition, if the dollar item category is not equal to category. So here, we have to put the dollar item category equal to category, then we have an Array.push() filter item, comma, dollar item. So that it will check if the category is equal to the item category, then we have to push the element in the filtered item array. So it will have a record based on the category which we are passing. Thank you.
So, writing a business logic in a Drupal module that can be tested without external dependency. We can achieve this via creating unit test cases in the triple model. For that, we have to create test unit test files inside the src folder and the same as the APIs. So, we can create a resource, rest of resources folder. We can create a service file, and the service file will have a controller service controller. In that, we can write our business logic that the service controller can be used as an API URL. So, that API will return either a JSON record or XML. This can be logic that will be tested without any external dependency. So, we can have this kind of approach, an API-based approach where the logic, business complex logic, can be written in the form of APIs. The 2nd approach is unit test cases. Drupal introduces a new mechanism where you can write unit test cases in the form of an API, and that can be tested without any external dependency. There is another mechanism. There are two mechanisms we can write without any external dependency.
AWS gives multiple tools to resolve performance issues. The 1st tool I will introduce is CDN enabled. CDN enabled helps Drupal to give resources from easily available content resources. To use this, we have to install the CDN module and configure the CDN URL so that all assets are easily available for the application opening on a particular reason. Suppose the x user is opening the application in the US region. The content will be delivered from the US region, which will be handled by AWS internally. This is the first mechanism, CD enable. The second is storing static information like CSS, JavaScript, and images in an S3 bucket. An S3 bucket is an AWS tool where Drupal resources can be stored in S3 storage, which will also improve performance because it has a lot of capability to store high levels of data and static information in AWS. The third way is AWS scaling. We can use the scaling of the Drupal application so that performance will be fast. The 4th one is using an AWS CICD pipeline. This will make deployment faster and also check coding standards so we can have coding standards installed at the Git level. So whenever we sync our Git code into the AWS server for deployment, it will always check the coding standard platforms. So the code will be secure and standard. These are the ways we can use AWS tooling to improve performance. Also, if we have an AWS server, we can go for higher levels of CPU, storage, and server to have greater performance for the application. We'll have to go for higher levels of configuration, CPUs, and storage as well as the MySQL data server.
So, there are 2 ways. One is to create a Kubernetes platform, deploy our Docker images in the Kubernetes, and use a Jenkins pipeline. Those jobs should be run in the Jenkins, and the Kubernetes part should be created in the Jenkins server on the AWS side. That's a Docker-based approach we can use. So, for that, we have to write a Docker image in the Jenkins job, as well as the Kubernetes YAML configuration, which is in the form of YAML. So, whenever we run the Jenkins CICD pipeline, it will pick our Kubernetes configuration, which will be set aside in the GitHub. It will run all the builds and create automated parts, which will be pushed to the AWS server, EC2 instance. The 2nd approach is to use our Jenkins CICD auto pipeline, where we'll have a GitHub code URL, which will authenticate. We can also store the AWS secret key to authenticate whenever we're pushing our changes to the EC2 instance. Because we have to provide the server part, like triple w triple w HTML, where we have to copy the GitHub code into the server path. And then we have to run some set of commands, like composer installation and Drush export command and cache clear. So, there are 2 approaches we can follow.