Back-End Development Articles / Blogs / Perficient https://blogs.perficient.com/category/services/innovation-product-development/development/back-end-development/ Expert Digital Insights Fri, 03 Oct 2025 18:50:36 +0000 en-US hourly 1 https://blogs.perficient.com/files/favicon-194x194-1-150x150.png Back-End Development Articles / Blogs / Perficient https://blogs.perficient.com/category/services/innovation-product-development/development/back-end-development/ 32 32 30508587 Transform Your Data Workflow: Custom Code for Efficient Batch Processing in Talend-Part 1 https://blogs.perficient.com/2025/10/03/transform-data-workflow-custom-code-for-efficient-batch-processing-in-talend-part-1-2/ https://blogs.perficient.com/2025/10/03/transform-data-workflow-custom-code-for-efficient-batch-processing-in-talend-part-1-2/#respond Fri, 03 Oct 2025 07:22:35 +0000 https://blogs.perficient.com/?p=387572

Introduction:

Custom code in Talend offers a powerful way to enhance batch processing efficiently by allowing developers to implement specialized logic that is not available through Talend’s standard components. This can involve data transformations, custom code as per use case and integration with flat files as per specific project needs. By leveraging custom code, users can optimize performance, improve data quality, and streamline complex batch workflows within their Talend jobs.

Understand Batch Processing:

            Batch processing is a method of running high-volume, repetitive data within Talend jobs. The batch method allows users to process a bunch of data when computing resources are available, and with little or no user interaction.

Through batch processing, users gather and retain data, subsequently processing it during a designated period referred to as a “batch window.” This method enhances efficiency by establishing processing priorities and executing data tasks in a timeframe that is optimal.

Here, Talend job takes the total row count from source file then load the data from the flat file, processes it in a batch, provided input through context variable & then write the data into smaller flat files. This implementation made it possible to process enormous amounts of data more precisely and quickly than other implementation.

Batch processing is a method of executing a series of jobs sequentially without user interaction, typically used for handling large volumes of data efficiently. Talend, a prominent and extensively employed ETL (Extract, Transform, Load) tool, utilizes batch processing to facilitate the integration, transformation, and loading of data into data warehouse and various other target systems.

Talend Components:

Key components for batch processing as mention below:

  • tFileInputDelimited, tFileOutputDelimited: For reading & writing data from/to files.
  • tFileRowCount: Reads file row by row to calculate the number of rows.
  • tLoop: Executes a task automatically, based on a loop size.
  • tHashInput, tHashOutput: For high-speed data transfer and processing within a job. tHashOutput writes data to cache memory, while tHashInput reads from that cached data.
  • tFilterRow: For filtering rows from a dataset based on specified.
  • tMap: Use for data transformation which allow to map input data with output data along with use to perform data filtering, complex data manipulation, typecasting & multiple input source join.
  • tJavaRow: It can be used as an intermediate component, and we are able to access the input flow and transform the data using custom Java code.
  • tJava: It has no input or output data flow & can be used independently to Integrate custom Java code.
  • tLogCatcher: It is used in error handling within Talend job for adding runtime logging information. It catches all the exceptions and warnings raised by tWarn and tDie components during Talend job execution.
  • tLogRow: It is employed in error handling to display data or keep track of processed data in the run console.

Workflow with example:

To process the bulk of data in Talend, we can implement batch processing to efficiently process flat file data within a minimal execution time. We can read the flat file data & after execution, we can write it into a chunk of another flat file as a target & we can achieve this without batch processing. But this data flow will take quite a larger execution time to execute. If we use batch processing using the custom code, it takes minimal execution time to write the entire source file data into chunks of files at the target location.

Talend job design

Talend job design

Solution:

  • Read the number of rows in the source flat file using tFileRowCount component.
  • To determine the batch size, subtract the header count from the total row count and then divide the number by the total batch size. Take the whole number nearby which indicates the total number of batch or chunk.

    Calculate the batch / chunk by reducing the header from total row count & then divide the number by the total batch size. Take the whole number nearby which indicates the total number of batch or chunk.

    Calculate the batch size from total row count

  • Now use tFileInputDelimited component to read the source file content. In the tMap component, utilize the sequence Talend function to generate row numbers for your data mapping and transformation tasks. Then, load all of the data into the tHashOutput component, which stores the data into a cache.
  • Iterate the loop based on the calculated whole number using tLoop
  • Retrieve all the data from tHashInput component.
  • Filter the dataset retrieved from tHashInput component based on the rowNo column in the schema using tFilterRow

    Filter the dataset retrieved from tHashInput component based on the rowNo column in the schema using tFilterRow

    Filter the dataset using tFilterRow

  • If First Iteration is in progress & batch size is 100 then rowNo range will be as 1 to 100.
    If Third Iteration is in progress & batch size is 100 then rowNo range will be as 201 to 300.
    For example, if the value of current iteration is 3 then [(3-1=2)* 100]+1 = 201 & [3*100=300]. So final dataset range for the 3rd iteration will be 201 to 300.
  • Finally extract the dataset range between the rowNo column & write it into chunk of output target file using tFileOutputDelimited
  • The system uses the tLogCatcher component for error management by capturing runtime logging details, including warning or exception messages, and employs tLogRow to display the information in the execution console.
  • Regarding performance tuning, we have a tMap component that maps source data to output data, allows for complex data transformation, and offers unique join, first join, and all other join options for looking up data within the tMap component.
  • The temporary data that the tHashInput & tHashOutput components store in cache memory enhances runtime performance.

 

Advantages of Batch Processing:

  • Batch processing can efficiently handle large datasets.
  • It takes minimal time to process the data even after data transformation.
  • By grouping records from a large dataset and processing them as a single unit, it can be highly beneficial for improving performance.
  • With the batch processing, it can easily scale to accommodate growing data volumes.
  • It is particularly useful for operations like generating reports, performing data integration, and executing complex transformations on large datasets.

For more details: Get-started-talend-open-studio-data-integration

Note: Efficient Batch Processing in Talend-Part 2

]]>
https://blogs.perficient.com/2025/10/03/transform-data-workflow-custom-code-for-efficient-batch-processing-in-talend-part-1-2/feed/ 0 387572
Top 5 Drupal AI Modules to Transform Your Workflow https://blogs.perficient.com/2025/09/29/top-5-drupal-ai-modules-to-transform-your-workflow/ https://blogs.perficient.com/2025/09/29/top-5-drupal-ai-modules-to-transform-your-workflow/#respond Mon, 29 Sep 2025 14:58:30 +0000 https://blogs.perficient.com/?p=387495

The AI Revolution is in Drupal CMS 

The way we create, optimize, and deliver content has fundamentally changed. Artificial Intelligence is no longer a futuristic concept; it’s a practical, indispensable tool for content teams. For years, Drupal has been the gold standard for structured, enterprise-level content management. Now, with the rapid maturation of the community’s Artificial Intelligence Initiative, Drupal is emerging as the premier platform for an Intelligent CMS. 

This post is for every content editor, site builder, and digital marketer who spends too much time on repetitive tasks like writing alt text, crafting meta descriptions, or translating copy. We’re moving the AI power from external tools directly into your Drupal admin screen. 

We will explore five essential Drupal modules that leverage AI to supercharge your content workflow, making your team faster, your content better, and your website more effective. This is about making Drupal work smarter, not just harder. 

The collective effort to bring this intelligence to Drupal is being driven by the community, and you can see the foundational work, including the overview of many related projects, right here at the Drupal Artificial Intelligence Initiative. 

 

  1. AI CKEditor Integration: The Content Co-Pilot

This functionality is typically provided by a suite of modules, with the core framework being the AI (Artificial Intelligence) module and its submodules like AI CKEditor. It integrates large language models (LLMs) like those from OpenAI or Anthropic directly into your content editor. 

Role in the CMS 

This module places an AI assistant directly inside the CKEditor 5 toolbar, the primary rich-text editor in Drupal. It turns the editor from a passive text field into an active, helpful partner. It knows the context of your page and is ready to assist without ever requiring you to leave the edit screen. 

How It’s Useful 

  • For Content Editors: It eliminates the dreaded “blank page syndrome.” Highlight a bulleted list and ask the AI to “turn this into a formal paragraph” or “expand this summary into a 500-word article.” You can instantly check spelling and grammar, adjust the tone of voice (e.g., from professional to friendly), and summarize long blocks of text for teasers or email excerpts. It means spending less time writing the first draft and more time editing and refining the final, human-approved version. 
  • For Site Builders: It reduces the need for editors to jump between Drupal and external AI tools, streamlining the entire content creation workflow and keeping your team focused within the secure environment of the CMS. 

 

  1. AI Image Alt Text: The SEO Automator

AI Image Alt Text is a specialized module that performs one critical task exceptionally well: using computer vision to describe images for accessibility and SEO. 

Role in the CMS 

This module hooks into the Drupal Media Library workflow. The moment an editor uploads a new image, the module sends that image to a Vision AI service (like Google Vision or an equivalent LLM) for analysis. The AI identifies objects, actions, and scenes, and then generates a descriptive text which is automatically populated into the image’s Alternative Text (Alt Text) field. 

How It’s Useful 

  • For Accessibility: Alt text is crucial for WCAG compliance. Screen readers use this text to describe images to visually impaired users. This module ensures that every image, regardless of how busy the editor is, has a meaningful description, making your site more inclusive right from the start. 
  • For SEO & Editors: Alt text is a ranking signal for search engines. It also saves the editor the most tedious part of their job. Instead of manually typing a description like “Woman sitting at a desk typing on a laptop with a cup of coffee,” the AI provides a high-quality, descriptive draft instantly, which the editor can quickly approve or slightly refine. It’s a huge time-saver and compliance booster. 

 

  1. AI Translation: The Multilingual Enabler

This feature is often a submodule within the main AI (Artificial Intelligence) framework, sometimes leveraging a dedicated integration like the AI Translate submodule, or integrating with the Translation Management Tool (TMGMT). 

Role in the CMS 

Drupal is one of the world’s most powerful platforms for building multilingual websites. This module builds upon that strength by injecting AI as a Translation Provider. Instead of waiting for a human translator for the first pass, this module allows content to be translated into dozens of languages with the click of a button. 

How It’s Useful 

  • For Global Content Teams: Imagine launching a product page simultaneously across five markets. This tool performs the initial, high-quality, machine-generated translation and saves it as a draft in the corresponding language node. The local editor then only needs to perform post-editing (reviewing and culturally adapting the text), which is significantly faster and cheaper than translating from scratch. 
  • For Site Owners: It drastically cuts the time-to-market for multilingual content and ensures translation consistency across technical terms. It leverages the AI’s power for speed while retaining the essential human oversight for cultural accuracy. 

 

  1. AI Automators: The Smart Curator

AI Automators (a powerful submodule of the main AI project) allows you to set up rules that automatically populate or modify fields based on content entered in other fields. 

Role in the CMS 

This is where the magic of “smart” content happens. An Automator is a background worker that monitors when a piece of content is saved. You can configure it to perform chained actions using an LLM. For instance, when an editor publishes a new blog post: 

  1. Read the content of the Body field. 
  2. Use a prompt to generate five relevant keywords/topics. 
  3. Automatically populate the Taxonomy/Tags field with those terms. 
  4. Use another prompt to generate a concise post for X (formerly Twitter). 
  5. Populate a new Social Media Post field with that text. 

How It’s Useful 

  • For Content Strategists: It enforces content standards and completeness. Every piece of content is automatically tagged and optimized, reducing the chance of human error and improving content discoverability through precise categorization. It ensures your SEO and content strategy is executed flawlessly on every save. 
  • For Site Builders: It brings the power of Event-Condition-Action (ECA) workflows into the AI space. It’s a no-code way to build complex, intelligent workflows that ensure data integrity and maximize the usefulness of content metadata. 

 

  1. AI Agents: The Operational Assistant

AI Agents, typically used in conjunction with the main AI framework, is a powerful new tool that uses natural language to execute administrative and site-building tasks. 

Role in the CMS

An AI Agent is like a virtual assistant for your Drupal back-end. Instead of navigating through multiple complex configuration forms to, say, create a new field on a content type, you simply tell the Agent what you want it to do in plain English. The Agent interprets your request, translates it into the necessary Drupal API calls, and executes the changes. The module comes with various built-in agents (like a Field Type Agent or a Content Type Agent). 

How It’s Useful 

  • For Site Builders and Non-Technical Admins: This is a revolutionary step toward conversational configuration. You can issue a command like: “Please create a new Content Type called ‘Product Review’ and add a new text field named ‘Reviewer Name’.” The agent handles the creation process instantly. This dramatically reduces the learning curve and time needed for common site-building tasks. 
  • For Automation: Agents can be chained together or triggered by other systems to perform complex, multi-step actions on the CMS structure itself. Need to update the taxonomy on 50 terms? A dedicated agent can handle the large-scale configuration change based on a high-level instruction, making system maintenance far more efficient. It turns administrative management into a conversation. 

 

Conclusion:

The integration of AI into Drupal is one of the most exciting developments in the platform’s history. It is a powerful affirmation of Drupal’s strength as a structured content hub. These modules—the AI CKEditor, AI Image Alt Text, AI Translation, AI Automators, and now the transformative AI Agentsare not here to replace your team. They are here to empower them. 

By automating the mundane, repetitive, and technical aspects of content management and even site configuration, these tools free up your content creators and site builders to focus on what humans do best: strategy, creativity, and high-level decision-making. The future of content management in Drupal is intelligent, efficient, and, most importantly, human-powered. It’s time to equip your team with these new essentials and watch your digital experiences flourish. 

]]>
https://blogs.perficient.com/2025/09/29/top-5-drupal-ai-modules-to-transform-your-workflow/feed/ 0 387495
ChatGPT vs Microsoft Copilot: Solving Node & Sitecore Issues https://blogs.perficient.com/2025/09/17/chatpgt-vs-microsoft-copilot/ https://blogs.perficient.com/2025/09/17/chatpgt-vs-microsoft-copilot/#comments Wed, 17 Sep 2025 05:20:30 +0000 https://blogs.perficient.com/?p=386776

In today’s world of AI-powered development tools, ChatGPT and Microsoft Copilot are often compared side by side. Both promise to make coding easier, debugging faster, and problem-solving more efficient. But when it comes to solving real-world enterprise issues, the difference in their effectiveness becomes clear.

Recently, I faced a practical challenge while working with Sitecore 10.2.0 and Sitecore SXA 11.3.0, which presented a perfect case study for comparing the two AI assistants.

The Context: Node.js & Sitecore Compatibility

I was troubleshooting an issue with Sitecore SXA where certain commands (npm run build, sxa r Main, and sxa w) weren’t behaving as expected. Initially, my environment was running on Node.js v14.17.1, but I upgraded to v20.12.2. After the upgrade, I started suspecting a compatibility issue between Node.js and Sitecore’s front-end build setup.

Naturally, I decided to put both Microsoft Copilot and ChatGPT to the test to see which one handled things better.

My Experience with Microsoft Copilot

When I first used Copilot, I gave it a very specific and clear prompt:

I am facing an issue with Sitecore SXA 11.3.0 on Sitecore 10.2.0 using Node.js v20.12.2. The gulp tasks are not running properly. Is this a compatibility issue and what should I do?

Copilot’s Response

  • Copilot generated a generic suggestion about checking the gulp configuration.
  • It repeated standard troubleshooting steps such as “try reinstalling dependencies,” “check your package.json,” and “make sure Node is installed correctly.”
  • Despite rephrasing the prompt multiple times, it failed to recognize the known compatibility issue between Sitecore SXA’s front-end tooling and newer Node versions.

Takeaway: Copilot provided a starting point, but the guidance lacked the technical depth and contextual relevance required to move the solution forward. It felt more like a general suggestion than a targeted response to the specific challenge at hand.

My Experience with ChatGPT

I then tried the same prompt in ChatGPT.

ChatGPT’s Response

  • Immediately identified that Sitecore SXA 11.3.0 running on Sitecore 10.2.0 has known compatibility issues with Node.js 20+.
  • It suggested that I should switch to Node.js v18.20.7 because it’s stable and works well with Sitecore.
  • Recommended checking SXA version compatibility matrix to confirm the supported Node versions.
  • Also guided me on how to use Node Version Manager (NVM) to switch between multiple Node versions without affecting other projects.

This response was not only accurate but also actionable. By following the steps, I was able to resolve the issue and get the build running smoothly again.

Takeaway: ChatGPT felt like talking to a teammate who understands how Sitecore and Node.js really work. In contrast, Copilot seemed more like the suggestion tool, it offered helpful prompts but didn’t fully comprehend the broader context or the specific challenge I was addressing.

Key Differences I Observed

What I Looked At Microsoft Copilot ChatGPT
Understanding the problem Gave basic answers, missed deeper context Understood the issue well and gave thoughtful replies
Sitecore knowledge Limited understanding, especially with SXA Familiar with SXA and Sitecore, provided valuable insights
Node.js compatibility Missed the Node.js 20+ issue Spotted the problem and suggested the right fix
Suggested solutions Repeated generic advice Gave clear, specific steps that actually helped
Ease of Use Good for quick code snippets Great for solving tricky problems step by step

Takeaways for Developers

  1. Copilot is great for boilerplate code and inline suggestions – if you want quick syntax help, it works well.
  2. ChatGPT shines in debugging and architectural guidance – especially when working with enterprise systems like Sitecore or giving code suggestions.
  3. When you’re stuck on environment or compatibility issues, ChatGPT can save hours by pointing you in the right direction.
  4. Best workflow: Use Copilot for code-writing speed, and ChatGPT for solving bigger technical challenges.

Final Thoughts

Both Microsoft Copilot and ChatGPT are powerful AI tools, but they serve different purposes.

  • Copilot functions like a code suggestion tool integrated within your IDE.
  • ChatGPT feels like a senior consultant who understands the ecosystem and gives you actionable advice.

When working on complex platforms like Sitecore 10.2.0 with SXA 11.3.0, and specific Node.js compatibility issues, ChatGPT clearly comes out ahead.

]]>
https://blogs.perficient.com/2025/09/17/chatpgt-vs-microsoft-copilot/feed/ 2 386776
Drupal 11’s AI Features: What They Actually Mean for Your Team https://blogs.perficient.com/2025/09/04/drupal-11s-ai-features-what-they-actually-mean-for-your-team/ https://blogs.perficient.com/2025/09/04/drupal-11s-ai-features-what-they-actually-mean-for-your-team/#comments Thu, 04 Sep 2025 14:04:33 +0000 https://blogs.perficient.com/?p=386893

Drupal 11’s AI Features: What They Actually Mean for Your Team

If you’ve been following the Drupal community lately, you’ve probably heard about the excitement with AI in Drupal 11 and the new Drupal AI Initiative. With over $100,000 in funding and 290+ AI modules already available, this will be a game changer.

But here’s the thing, AI in Drupal isn’t about replacing your team. It’s about making everyone more effective at what they already do best. Let’s talk through some of these new capabilities and what they mean for different teams in your organization.

Content Teams: Finally, An Assistant That Actually Helps

Creating quality content quickly has always been a challenge, but Drupal 11’s AI features tackle this head-on. The AI CKEditor integration gives content creators real-time assistance right in the editing interface, things like spelling corrections, translations, and contextual suggestions as you type.

The AI Content module is where things get interesting. It can automatically adjust your content’s tone for different audiences, summarize long content, and even suggest relevant taxonomy terms. For marketing teams juggling multiple campaigns, this means maintaining brand consistency without the usual back-and-forth reviews.

One feature that’s already saving teams hours is the AI Image Alt Text module. Instead of manually writing alt text for accessibility compliance, it generates descriptions automatically. The AI Translate feature is another game-changer for organizations with global reach—one-click multilingual content creation that actually understands context.

The bottom line? Your content team can focus on strategy and creativity instead of getting bogged down in routine tasks.

Developers: Natural Language Site Building

Here’s where Drupal 11 gets really exciting for a dev team. The AI Agents module introduces something we haven’t seen before, text-to-action capabilities. Developers can now modify Drupal configurations, create content types, and manage taxonomies just by describing what they need in spoken english.

Instead of clicking through admin interfaces, you can literally tell Drupal what you want, “Create a content type for product reviews with fields for rating, pros, cons, and reviewer information.” The system understands and executes these commands.

The AI module ecosystem supports over 21 major providers, OpenAI, Claude, AWS Bedrock, Google Vertex, and more. This means you’re not locked into any single AI provider and can choose the best model for specific tasks. The AI Explorer gives you a testing ground to experiment with prompts before pushing anything live.

For complex workflows, AI Automators let you chain multiple AI systems together. Think automated content transformation, field population, and business logic handling with minimal custom code.

The other great aspect of Drupal AI, is the open source backbone of Drupal, allows you to extend, add and build upon these agents in any way your dev team sees fit.

Marketing Teams: Data-Driven Campaign Planning

Marketing teams might be the biggest winners here. The AI Content Strategy module analyzes your existing content and provides recommendations for what to create next based on actual data, not guesswork. It identifies gaps in your content strategy and suggests targeted content based on audience behavior and industry trends.

The AI Search functionality means visitors can find content quickly, no more keyword guessing games. The integrated chatbot framework provides intelligent customer service that can access your site’s content to give accurate responses.

For SEO, the AI SEO module generates reports with user recommendations, reviewing content and metadata automatically. This reduces the need for separate SEO tools while giving insights right where you can act on them.

Why This Matters Right Now

The Drupal AI Initiative represents something more than just new features. With dedicated teams from leading agencies and serious funding behind it, this is Drupal positioning itself as the go-to platform for AI-powered content management.

For IT executives evaluating CMS options, Drupal 11’s approach is a great fit. You maintain complete control over your data and AI interactions while getting enterprise-grade governance with approval workflows and audit trails. It’s AI augmentation rather than AI replacement.

The practical benefits are clear: faster campaign launches, consistent brand voice across all content, and teams freed from manual tasks to focus on strategic work. In today’s competitive landscape, that kind of operational efficiency can make the difference between leading your market and playing catch-up.

The Reality Check

We all know, no technology is perfect. The success of these AI features, especially within the open source community, depends heavily on implementation and team adoption. You’ll need to spend time in training and process development to see real benefits. Like any new technology, there will be a learning curve as your team figures out the best ways to leverage these new features.

Based on what we are seeing within groups that have done early adoption of the AI features, they are seeing a good ROI on improvement of team efficiency, marketing time as well as reduced SEO churn.

If you’re considering how Drupal 11’s AI features might fit your organization, it’s worth having a conversation with an experienced implementation partner like Perficient. We can help you navigate the options and develop an AI strategy that makes sense for your specific situation.

]]>
https://blogs.perficient.com/2025/09/04/drupal-11s-ai-features-what-they-actually-mean-for-your-team/feed/ 2 386893
Invoke the Mapbox Geocoding API to Populate the Location Autocomplete Functionality https://blogs.perficient.com/2025/08/21/invoke-the-mapbox-geocoding-api-to-populate-the-location-autocomplete-functionality/ https://blogs.perficient.com/2025/08/21/invoke-the-mapbox-geocoding-api-to-populate-the-location-autocomplete-functionality/#respond Thu, 21 Aug 2025 08:01:53 +0000 https://blogs.perficient.com/?p=381495

While working on one of my projects, I needed to implement an autocomplete box using Mapbox Geocoding APIs in a React/Next.js application. The goal was to filter a list of hospitals based on the selected location. The location results from the API include coordinates, which I compared with the coordinates of the hospitals in my list.

The API returns various properties, including coordinates, under the properties section (as shown in the image below). These coordinates (latitude and longitude) can be used to filter the hospital list by matching them with the selected location.

Mapboxresultproperties

The API requires an access token, which can be obtained by signing up on the Mapbox platform. You can refer to the Geocoding API documentation for more details. The documentation provides a variety of APIs that can be used depending on your specific requirements.

Below are some example APIs taken from the same link.

# A basic forward geocoding request
# Find Los Angeles

curl "https://api.mapbox.com/search/geocode/v6/forward?q=Los%20Angeles&access_token=YOUR_MAPBOX_ACCESS_TOKEN"

# Find a town called 'Chester' in a specific region
# Add the proximity parameter with local coordinates
# This ensures the town of Chester, New Jersey is in the results

curl "https://api.mapbox.com/search/geocode/v6/forward?q=chester&proximity=-74.70850,40.78375&access_token=YOUR_MAPBOX_ACCESS_TOKEN"

# Specify types=country to search only for countries named Georgia
# Results will exclude the American state of Georgia

curl "https://api.mapbox.com/search/geocode/v6/forward?q=georgia&types=country&access_token=YOUR_MAPBOX_ACCESS_TOKEN"

# Limit the results to two results using the limit option
# Even though there are many possible matches
# for "Washington", this query will only return two results.

curl "https://api.mapbox.com/search/geocode/v6/forward?q=Washington&limit=2&access_token=YOUR_MAPBOX_ACCESS_TOKEN"

# Search for the Place feature "Kaaleng" in the Ilemi Triangle. Specifying the cn worldview will return the country value South Sudan. Not including leaving the worldview parameter would default to the us worldview and return the country value Kenya.

curl "https://api.mapbox.com/search/geocode/v6/forward?q=Kaaleng&worldview=cn&access_token=YOUR_MAPBOX_ACCESS_TOKEN"

The implementation leverages React hooks along with state management for handling component behavior and data flow.

How to Create an Autocomplete Component in React

  1. Create a React component.
  2. Sign up and apply the access token and API URL to the constants.
  3. Create a type to bind the structure of the API response results.
  4. Use the useEffect hook to invoke the API.
  5. Map the fetched results to the defined type.
  6. Apply CSS to style the component and make the autocomplete feature visually appealing.
#constants.ts

export const APIConstants = {
  accessToken: 'YOUR_MAPBOX_ACCESS_TOKEN',
  geoCodeSearchForwardApiUrl: 'https://api.mapbox.com/search/geocode/v6/forward',
  searchWordCount: 3,
};
#LocationResultProps.ts

type Suggetions = {
  properties: {
    feature_type: string;
    full_address: string;
    name: string;
    name_preferred: string;
    coordinates: {
      longitude: number;
      latitude: number;
    };
  };
};
export type LocationResults = {
  features: Array<Suggetions>;
};
#Styles.ts

export const autoComplete = {
  container: {
    width: '250px',
    margin: '20px auto',
  },
  input: {
    width: '100%',
    padding: '10px',
    fontSize: '16px',
    border: '1px solid #ccc',
    borderRadius: '4px',
  },
  dropdown: {
    top: '42px',
    left: '0',
    right: '0',
    backgroundColor: '#fff',
    border: '1px solid #ccc',
    borderTop: 'none',
    maxHeight: '150px',
    listStyleType: 'none',
    padding: '0',
    margin: '0',
    zIndex: 1000,
  },
  item: {
    padding: '5px',
    cursor: 'pointer',
    borderBottom: '1px solid #eee',
  },
};

#LocationSearchInput.tsx

import React, { useEffect, useState } from 'react';
import { APIConstants } from 'lib/constants';
import { autoComplete } from '../Styles';
import { LocationResults } from 'lib/LocationResultProps';

export const Default = (): JSX.Element => {
  const apiUrlParam: string[][] = [
    //['country', 'us%2Cpr'],
    ['types', 'region%2Cpostcode%2Clocality%2Cplace%2Cdistrict%2Ccountry'],
    ['language', 'en'],
    //['worldview', 'us'],
  ];

  const [inputValue, setInputValue] = useState<string>('');
  const [results, setresults] = useState<LocationResults>();
  const [submitted, setSubmitted] = useState<boolean>(false);

  // When the input changes, reset the "submitted" flag.
  const handleChange = (value: string) => {
    setSubmitted(false);
    setInputValue(value);
  };
  const handleSubmit = (value: string) => {
    setSubmitted(true);
    setInputValue(value);
  };

  // Fetch results when the input value changes
  useEffect(() => {
    if (inputValue.length < APIConstants?.searchWordCount) {
      setresults(undefined);
      return;
    }
    if (submitted) {
      return;
    }
    const queryInputParam = [
      ['q', inputValue],
      ['access_token', APIConstants?.accessToken ?? ''],
    ];

    const fetchData = async () => {
      const queryString = apiUrlParam
        .concat(queryInputParam)
        .map((inner) => inner.join('='))
        .join('&');
      const url = APIConstants?.geoCodeSearchForwardApiUrl + '?' + queryString;

      try {
        const response: LocationResults = await (await fetch(url)).json();
        setresults(response);
        console.log(response);
      } catch (err: unknown) {
        console.error('Error obtaining location results for autocomplete', err);
      }
    };

    fetchData();
  }, [inputValue]);

  return (
    <div>
      <div style={autoComplete.container}>
        <input
          style={autoComplete.input}
          onChange={(e) => handleChange(e.target?.value)}
          value={inputValue}
          placeholder="Find Location"
        />

        {inputValue &&
          !submitted &&
          results?.features?.map((x) => {
            return (
              <ul style={autoComplete.dropdown}>
                <li style={autoComplete.item}>
                  <span onClick={() => handleSubmit(x?.properties?.full_address)}>
                    {x?.properties?.full_address}
                  </span>
                </li>
              </ul>
            );
          })}
      </div>
    </div>
  );
};

Finally, we can search for a location using a zip code, state, or country.

Recording 20250520 135312 (1)

 

Additionally, the reverse geocoding API is used similarly, requiring only minor adjustments to the parameters and API URL. The location autocomplete box offers a wide range of use cases. It can be integrated into user forms such as registration or contact forms, where exact location coordinates or a full address need to be captured upon selection. Each location result includes various properties. Based on the user’s input, whether it’s a city, ZIP code, or state, the autocomplete displays matching results.

 

]]>
https://blogs.perficient.com/2025/08/21/invoke-the-mapbox-geocoding-api-to-populate-the-location-autocomplete-functionality/feed/ 0 381495
AI: Security Threat to Personal Data? https://blogs.perficient.com/2025/08/18/ai-security-threat-to-personal-data/ https://blogs.perficient.com/2025/08/18/ai-security-threat-to-personal-data/#respond Mon, 18 Aug 2025 07:33:26 +0000 https://blogs.perficient.com/?p=385942

In recent years, AI chatbots like ChatGPT have gone from fun tools for answering questions to serious helpers in workplaces, education, and even personal decision-making. With ChatGPT-5 now being the latest and most advanced version, it’s no surprise that people are asking a critical question:

“Is my personal data safe when I use ChatGPT-5?”

First, What Is ChatGPT-5?

ChatGPT-5 is an AI language model created by OpenAI. You can think of it like a super-smart digital assistant that can:

  • Answering questions across a wide range of topics
  • Drafting emails, essays, and creative content
  • Writing and debugging code
  • Assisting with research and brainstorming
  • Supporting productivity and learning

It learns from patterns in data, but here’s an important point – it doesn’t “remember” your conversations unless the developer has built a special memory feature and you’ve agreed to it.

How Your Data Is Used

When you chat with ChatGPT-5, your messages are processed to generate a response. Depending on the app or platform you use, your conversations may be:

  • Temporarily stored to improve the AI’s performance
  • Reviewed by humans (in rare cases) to train and fine-tune the system
  • Deleted or anonymized after a specific period, depending on the service’s privacy policy

This is why reading the privacy policy is not just boring legal stuff – it’s how you find out precisely what happens to your data.

Real Security Risks to Be Aware Of

The concerns about ChatGPT-5 (and similar AI tools) are less about it being “evil” and more about how your data could be exposed if not appropriately handled.

Here are the main risks:

1. Accidental Sharing of Sensitive Information

Many users unknowingly type personal details – such as their full name, home address, phone number, passwords, or banking information – into AI chat windows. While the chatbot itself may not misuse this data, it is still transmitted over the internet and may be temporarily stored by the platform. If the platform suffers a data breach or if the information is accessed by unauthorized personnel, your sensitive data could be exposed or exploited.

Best Practice: Treat AI chats like public forums – never share confidential or personally identifiable information.

2. Data Retention by Third-Party Platforms

AI chatbots are often integrated into third-party platforms, such as browser extensions, productivity tools, or mobile apps. These integrations may collect and store your chat data on their own servers, sometimes without clearly informing you. Unlike official platforms with strict privacy policies, third-party services may lack robust security measures or transparency.

Risk Example: A browser extension that logs your AI chats could be hacked, exposing all stored conversations.

Best Practice: Use only trusted, official apps and review their privacy policies before granting access.

3. Misuse of Login Credentials

In rare but serious cases, malicious AI integrations or compromised platforms could capture login credentials you enter during a conversation. If you share usernames, passwords, or OTPs (one-time passwords), these could be used to access your accounts and perform unauthorized actions – such as placing orders, transferring money, or changing account settings.

Real-World Consequence: You might wake up to find that someone used your credentials to order expensive items or access private services.

Best Practice: Never enter login details into any AI chat, and always use two-factor authentication (2FA) for added protection.

4. Phishing & Targeted Attacks

If chat logs containing personal information are accessed by cybercriminals, they can use that data to craft highly convincing phishing emails or social engineering attacks. For example, knowing your name, location, or recent purchases allows attackers to impersonate trusted services and trick you into clicking malicious links or revealing more sensitive data.

Best Practice: Be cautious of unsolicited messages and verify the sender before responding or clicking links.

5. Overtrusting AI Responses

AI chatbots are trained on vast datasets, but they can still generate inaccurate, outdated, or misleading information. Relying on AI responses without verifying facts can lead to poor decisions, especially in areas like health, finance, or legal advice.

Risk Example: Acting on incorrect medical advice or sharing false information publicly could have serious consequences.

Best Practice: Always cross-check AI-generated content with reputable sources before taking action or sharing it.

How to Protect Yourself

Here are simple steps you can take:

  • Never share sensitive login credentials or card details inside a chat.
  • Stick to official apps and platforms to reduce the risk of malicious AI clones.
  • Use 2-factor authentication (2FA) for all accounts, so even stolen passwords can’t be used easily.
  • Check permissions before connecting ChatGPT-5 to any service – don’t allow unnecessary access.
  • Regularly clear chat history if your platform stores conversations.

Final Thoughts

ChatGPT-5 is a tool, and like any tool, it can be used for good or misused. The AI itself isn’t plotting to steal your logins or credentials, but if you use it carelessly or through untrusted apps, your data could be at risk.

Golden rule: Enjoy the benefits of AI, but treat it like a stranger online – don’t overshare, and keep control of your personal data.

]]>
https://blogs.perficient.com/2025/08/18/ai-security-threat-to-personal-data/feed/ 0 385942
Smart Failure Handling in HCL Commerce with Circuit Breakers https://blogs.perficient.com/2025/08/15/smart-failure-handling-in-hcl-commerce-with-circuit-breakers/ https://blogs.perficient.com/2025/08/15/smart-failure-handling-in-hcl-commerce-with-circuit-breakers/#respond Fri, 15 Aug 2025 05:48:28 +0000 https://blogs.perficient.com/?p=386135

In modern enterprise systems, stability and fault tolerance are not optional; they are essential. One proven approach to ensure robustness is the Circuit Breaker pattern, widely used in API development to prevent cascading failures. HCL Commerce takes this principle further by embedding circuit breakers into its HCL Cache to effectively manage Redis failures.

 What Is a Circuit Breaker?
The Circuit Breaker is a design pattern commonly used in API development to stop continuous requests to a service that is currently failing, thereby protecting the system from further issues. It helps maintain system stability by detecting failures and stopping the flow of requests until the issue is resolved.

The circuit breaker typically operates in three main (or “normal”) states. These are part of the standard global pattern of Circuit Breaker design.

Normal States:

  1. CLOSED:
  • At the start, the circuit breaker allows all outbound requests to external services without restrictions.
  • It monitors the success and failure of these calls.
  1. OPEN:
  • The circuit breaker rejects all external calls.
  • This state is triggered when the failure threshold is reached (e.g., 50% failure rate).
  • It remains in this state for a specified duration (e.g., 60 seconds).
  1. HALF_OPEN:
  • After the wait duration in the OPEN state, the circuit breaker transitions to HALF_OPEN.
  • It allows a limited number of calls to check if the external service has recovered.
  • If these calls succeed (e.g., receive a 200 status), the circuit breaker transitions back to  CLOSED.
  • If the error rate continues to be high, the circuit breaker reverts to the OPEN state.
Circuit Breaker Pattern

Circuit breaker pattern with normal states

Special States:

  1. FORCED_OPEN:
  • The circuit breaker is manually set to reject all external calls.
  • No calls are allowed, regardless of the external service’s status.
  1. DISABLED:
  • The circuit breaker is manually set to allow all external calls.
  • It does not monitor or track the success or failure of these calls.
Circuit breaker pattern with special states

Circuit breaker pattern with special states

Circuit Breaker in HCL Cache (for Redis)

In HCL Commerce, the HCL Cache layer interacts with Redis for remote coaching. But what if Redis becomes unavailable or slow? HCL Cache uses circuit breakers to detect issues and temporarily stop calls to Redis, thus protecting the rest of the system from being affected.

Behavior Overview:

  • If 20 consecutive failures occur in 10 seconds, the Redis connection is cut off.
  • The circuit remains open for 60 seconds.
  • At this stage, the circuit enters a HALF_OPEN state, where it sends limited test requests to evaluate if the external service has recovered.
  • If even 2 of these test calls fail, the circuit reopens for another 60 seconds.

Configuration Snapshot

To manage Redis outages effectively, HCL Commerce provides fine-grained configuration settings for both Redis client behavior and circuit breaker logic. These settings are defined in the Cache YAML file, allowing teams to tailor fault-handling based on their system’s performance and resilience needs.

 Redis Request Timeout Configuration

Slow Redis responses are not treated as failures unless they exceed the defined timeout threshold. The Redis client in HCL Cache supports timeout and retry configurations to control how persistent the system should be before declaring a failure:

timeout: 3000           # Max time (in ms) to wait for a Redis response
retryAttempts: 3        # Number of retry attempts on failure
retryInterval: 1500    # Specifies the delay (in milliseconds) between each retry attempt.

With the above configuration, the system will spend up to 16.5 seconds (3000 + 3 × (3000 + 1500)) trying to get a response before returning a failure. While these settings offer robustness, overly long retries can result in delayed user responses or log flooding, so tuning is essential.

Circuit Breaker Configuration

Circuit breakers are configured under the redis.circuitBreaker section of the Cache YAML file. Here’s an example configuration:

redis:
  circuitBreaker:
    scope: auto
    retryWaitTimeMs: 60000
    minimumFailureTimeMs: 10000
    minimumConsecutiveFailures: 20
    minimumConsecutiveFailuresResumeOutage: 2 
cacheConfigs:
  defaultCacheConfig:
    localCache:
      enabled: true
      maxTimeToLiveWithRemoteOutage: 300

Explanation of Key Fields:

  • scope: auto: Automatically determines whether the circuit breaker operates at the client or cache/shard level, depending on the topology.
  • retryWaitTimeMs (Default: 60000): Time to wait before attempting Redis connections after circuit breaker is triggered.
  • minimumFailureTimeMs (Default: 10000): Minimum duration during which consecutive failures must occur before opening the circuit.
  • minimumConsecutiveFailures (Default: 20): Number of continuous failures required to trigger outage mode.
  • minimumConsecutiveFailuresResumeOutage (Default: 2): Number of failures after retrying that will put the system back into outage mode.
  • maxTimeToLiveWithRemoteOutage: During Redis outages, local cache entries use this TTL value (in seconds) to serve data without invalidation messages.

Real-world Analogy

Imagine you have a web service that fetches data from an external API. Here’s how the circuit breaker would work:

  1. CLOSED: The service makes calls to the API and monitors the responses.
  2. OPEN: If the API fails too often (e.g., 50% of the time), the circuit breaker stops making calls for 60 seconds.
  3. HALF_OPEN: After 60 seconds, the circuit breaker allows a few calls to the API to see if it’s working again.
  4. CLOSED: If the API responds successfully, the circuit breaker resumes normal operation.
  5. OPEN: If the API still fails, the circuit breaker stops making calls again and waits.

Final Thought

By combining the classic circuit breaker pattern with HCL Cache’s advanced configuration, HCL Commerce ensures graceful degradation during Redis outages. It’s not just about availability—it’s about intelligent fault recovery.

For more detailed information, you can refer to the official documentation here:
🔗 HCL Commerce Circuit Breakers – Official Docs

]]>
https://blogs.perficient.com/2025/08/15/smart-failure-handling-in-hcl-commerce-with-circuit-breakers/feed/ 0 386135
Mastering GitHub Copilot in VS Code https://blogs.perficient.com/2025/08/12/mastering-github-copilot-in-vs-code/ https://blogs.perficient.com/2025/08/12/mastering-github-copilot-in-vs-code/#respond Tue, 12 Aug 2025 07:55:43 +0000 https://blogs.perficient.com/?p=385832

Ready to go from “meh” to “whoa” with your AI coding assistant? Here’s how to get started.

You’ve installed GitHub Copilot. Now what?

Here’s how to actually get it to work for you – not just with you.

In the blog Using GitHub Copilot in VS Code, we have already seen how to use GitHub Copilot in VS Code.

1. Write for Copilot, Not Just Yourself

Copilot is like a teammate who’s really fast at coding but only understands what you clearly explain.

Start with Intention:

Use descriptive comments or function names to guide Copilot.

// Fetch user data from API and cache it locally
function fetchUserData() {

Copilot will often generate useful logic based on that. It works best when you think one step ahead.

2. Break Problems Into Small Pieces

Copilot shines when your code is modular.

Instead of writing:

function processEverything() {
  // 50 lines of logic
}

Break it down:

// Validate form input
function validateInput(data) {

}

// Submit form to backend
function submitForm(data) {

}

This way, you get smarter, more accurate completions.

3. Use Keyboard Shortcuts to Stay in Flow

Speed = flow. These shortcuts help you ride Copilot without breaking rhythm:

Action Shortcut (Windows) Shortcut (Mac)
Accept Suggestion Tab Tab
Next Suggestion Alt + ] Option + ]
Previous Suggestion Alt + [ Option + [
Dismiss Suggestion Esc Esc
Open Copilot Panel Ctrl + Enter Cmd + Enter

Power Tip: Hold Tab to preview full suggestion before accepting it.

4. Experiment With Different Prompts

Don’t settle for the first suggestion. Try giving Copilot:

  • Function names like: generateInvoicePDF()
  • Comments like: // Merge two sorted arrays
  • Descriptions like: // Validate email format

Copilot might generate multiple versions. Pick or tweak the one that fits best.

5. Review & Refactor – Always

Copilot is smart, but not perfect.

  • Always read the output. Don’t blindly accept.
  • Add your own edge case handling and error checks.
  • Use tools like ESLint or TypeScript for safety.

Think of Copilot as your fast-thinking intern. You still need to double-check their work.

6. Use It Across File Types

Copilot isn’t just for JS or Python. Try it in:

  • HTML/CSS → Suggest complete sections
  • SQL → Generate queries from comments
  • Markdown → Draft docs and README files
  • Dockerfiles, .env, YAML, Regex patterns

Write a comment like # Dockerfile for Node.js app – and watch the magic.

7. Pair It With Unit Tests

Use Copilot to write your test cases too:

// Test case for addTwoNumbers function
describe('addTwoNumbers', () => {

It will generate a full Jest test block. Use this to write tests faster – especially for legacy code.

8. Learn From Copilot (Not Just Use It)

Treat Copilot suggestions as learning opportunities:

  • Ask: “Why did it suggest that?”
  • Compare with your original approach
  • Check docs or MDN if you see unfamiliar code

It’s like having a senior dev whispering best practices in your ear.

9. Use Copilot Chat (If Available)

If you have access to GitHub Copilot Chat, try it. Ask questions like:

  • What does this error mean?
  • Explain this function
  • Suggest improvements for this code

It works like a Stack Overflow built into your IDE.

Quick Recap

Tip Benefit
Write clear comments Better suggestions
Break logic into chunks Modular, reusable code
Use shortcuts Stay in flow
Cycle suggestions Explore better options
Review output Avoid bugs
Test case generation Faster TDD
Learn as you go Level up coding skills

Final Thoughts: Practice With Purpose

To truly master Copilot:

  • Build small projects and let Copilot help
  • Refactor old code using Copilot suggestions
  • Try documenting your code with its help

You’ll slowly build trust – and skill.

]]>
https://blogs.perficient.com/2025/08/12/mastering-github-copilot-in-vs-code/feed/ 0 385832
House Price Predictor – An MLOps Learning Project Using Azure DevOps https://blogs.perficient.com/2025/08/06/house-price-predictor-an-mlops-learning-project-using-azure-devops/ https://blogs.perficient.com/2025/08/06/house-price-predictor-an-mlops-learning-project-using-azure-devops/#comments Wed, 06 Aug 2025 12:28:37 +0000 https://blogs.perficient.com/?p=385548

Machine Learning (ML) is no longer limited to research labs — it’s actively driving decisions in real estate, finance, healthcare, and more. But deploying and managing ML models in production is a different ballgame. That’s where MLOps comes in.

In this blog, we’ll walk through a practical MLOps learning project — building a House Price Predictor using Azure DevOps as the CI/CD backbone. We’ll explore the evolution from DevOps to MLOps, understand the model development lifecycle, and see how to automate and manage it effectively.

What is MLOps?

MLOps (Machine Learning Operations) is the discipline of combining Machine Learning, DevOps, and Data Engineering to streamline the end-to-end ML lifecycle.

It aims to:

  • Automate training, testing, and deployment of models
  • Enable reproducibility and version control for data and models
  • Support continuous integration and delivery (CI/CD) for ML workflows
  • Monitor model performance in production

MLOps ensures that your model doesn’t just work in Jupyter notebooks but continues to deliver accurate predictions in production environments over time.

From DevOps to MLOps: The Evolution

DevOps revolutionized software engineering by integrating development and operations through automation, CI/CD, and infrastructure as code (IaC). However, ML projects add new complexity:

Aspect Traditional DevOps MLOps
Artifact Source code Code + data + models
Version Control Git Git + Data Versioning (e.g., DVC)
Testing Unit & integration tests Data validation + model validation
Deployment Web services, APIs ML models, pipelines, batch jobs
Monitoring Logs, uptime, errors Model drift, data drift, accuracy decay

So, MLOps builds on DevOps but extends it with data-centric workflows, experimentation tracking, and model governance.

House Price Prediction: Project Overview

Our goal is to build an ML model that predicts house prices based on input features like square footage, number of bedrooms, location, etc. This learning project is structured to follow MLOps best practices, using Azure DevOps pipelines for automation.

 Project Structure

house-price-predictor/

├── configs/               # Model configurations stored in YAML format

├── data/                  # Contains both raw and processed data files

├── deployment/  

│    └── mlflow/           # Docker Compose files to set up MLflow tracking

├── models/                # Saved model artifacts and preprocessing objects

├── notebooks/             # Jupyter notebooks for exploratory analysis and prototyping

├── src/

│    ├── data/             # Scripts for data preparation and transformation

│    ├── features/         # Logic for generating and engineering features

│    ├── models/           # Code for model building, training, and validation

├── k8s/

│    ├── deployment.yaml        # Kubernetes specs to deploy the Streamlit frontend

│    └── fast_model.yaml        # Kubernetes specs to deploy the FastAPI model service

├── requirements.txt       # List of required Python packages

 Setting Up Your Development Environment

Before getting started, make sure the following tools are installed on your machine:

 Preparing Your Environment

  • Fork this repo on GitHub to your personal or organization account.
  • Clone your forked repository
# Replace 'xxxxxx' with your GitHub username or organization
git clone https://github.com/xxxxxx/house-price-predictor.git
cd house-price-predictor
  • Create a virtual environment using UV:
uv venv --python python3.11
source .venv/bin/activate
  • Install the required Python packages:
uv pip install -r requirements.txt

 Configure MLflow for Experiment Tracking

To enable experiment and model run tracking with MLflow:

cd deployment/mlflow
docker compose -f mlflow-docker-compose.yml up -d
docker compose ps

 Using Podman Instead of Docker?

podman compose -f mlflow-docker-compose.yml up -d
podman compose ps

Access the MLflow UI. Once running, open your browser and navigate to http://localhost:5555

Model Workflow

 Step 1: Data Processing

Perform cleaning and preprocessing on the raw housing dataset:

python src/data/run_processing.py   --input data/raw/house_data.csv   --output data/processed/cleaned_house_data.csv

 Step 2: Feature Engineering

Perform data transformations and feature generation:

python src/features/engineer.py   --input data/processed/cleaned_house_data.csv   --output data/processed/featured_house_data.csv   --preprocessor models/trained/preprocessor.pkl

 Step 3: Modeling & Experimentation

Train the model and track all metrics using MLflow:

python src/models/train_model.py   --config configs/model_config.yaml   --data data/processed/featured_house_data.csv   --models-dir models   --mlflow-tracking-uri http://localhost:5555

Step 4: Building FastAPI and Streamlit

The source code for both applications — the FastAPI backend and the Streamlit frontend — is already available in the src/api and streamlit_app directories, respectively. To build and launch these applications:

  • Add a Dockerfile in the src/api directory to containerize the FastAPI service.
  • Add a Dockerfile inside streamlit_app/ to package the Streamlit interface.
  • Create a docker-compose.yaml file at the project root to orchestrate both containers.
    Make sure to set the environment variable API_URL=http://fastapi:8000 for the Streamlit app to connect to the FastAPI backend.

Once both services are up and running, you can access the Streamlit web UI in your browser to make predictions.

You can also test the prediction API directly by sending requests to the FastAPI endpoint.

curl -X POST "http://localhost:8000/predict" \

-H "Content-Type: application/json" \

-d '{

  "sqft": 1500,

  "bedrooms": 3,

  "bathrooms": 2,

  "location": "suburban",

  "year_built": 2000,

  "condition": fair

}'

Be sure to replace http://localhost:8000/predict with the actual endpoint based on where it’s running.

At this stage, your project is running locally. Now it’s time to implement the same workflow using Azure DevOps.

Prerequisites for Implementing This Approach in Azure DevOps.

To implement a similar MLOps pipeline using Azure DevOps, the following prerequisites must be in place:

  1. Azure Service Connection (Workload Identity-based)
    • Create a Workload Identity Service Connection in Azure DevOps.
    • Assign it Contributor access to the target Azure subscription or resource group.
    • This enables secure and passwordless access to Azure resources from the pipeline.
  2. Azure Kubernetes Service (AKS) Cluster
    • Provision an AKS cluster to serve as the deployment environment for your ML application.
    • Ensure the service connection has sufficient permissions (e.g., Azure Kubernetes Service Cluster User RBAC role) to interact with the cluster.

Start by cloning the existing GitHub repository into your Azure Repos. Inside the repository, you’ll find the azure-pipeline.yaml file, which defines the Azure DevOps CI/CD pipeline consisting of the following four stages:

  1. Data Processing Stage – Handles data cleaning and preparation.
  2. Model Training Stage – Trains the machine learning model and logs experiments.
  3. Build and Publish Stage – Builds Docker images and publishes them to the container registry.
  4. Deploy to AKS Stage – Deploys the application components to Azure Kubernetes Service (AKS).

This pipeline automates the end-to-end ML workflow from raw data to production deployment.

The CI/CD pipeline is already defined in the existing YAML file and is configured to run manually based on the parameters specified at runtime.

This pipeline is manually triggered (no automatic trigger on commits or pull requests) and supports the conditional execution of specific stages using parameters.

It consists of four stages, each representing a step in the MLOps lifecycle:

  1. Data Processing Stage

Condition: Runs if run_all or run_data_processing is set to true.

What it does:

  • Check out the code.
  • Sets up Python 3.11.13 and installs dependencies.
  • Runs scripts to:
    • Clean and preprocess the raw dataset.
    • Perform feature engineering.
  • Publishes the processed data and the trained preprocessor as pipeline artifacts
  1. Model Training Stage

Depends on: DataProcessing
Condition: Runs if run_all or run_model_training is set to true.

What it does:

  • Downloads the processed data artifact.
  • Spins up an MLflow server using Docker.
  • Waits for MLflow to be ready.
  • Trains the machine learning model using the processed data.
  • Logs the training results to MLflow.
  • Publishes the trained model as a pipeline artifact.
  • Stops and removes the temporary MLflow container.
  1. Build and Publish Stage

Depends on: ModelTraining
Condition: Runs if run_all or run_build_and_publish is set to true.

What it does:

  • Downloads trained model and preprocessor artifacts.
  • Builds Docker images for:
    • FastAPI (model API)
    • Streamlit (frontend)
  • Tag both images using the current commit hash and the latest.
  • Runs and tests both containers locally (verifies /health and web access).
  • Pushes the tested Docker images to Docker Hub using credentials stored in the pipeline.
  1. Deploy to AKS Stage

Depends on: BuildAndPublish
Condition: Runs only if the previous stages succeed.

What it does:

  • Uses the Azure CLI to:
    • Set the AKS cluster context. #Make sure to update the cluster name
    • Update Kubernetes deployment YAML files with the new Docker image tags.
    • Apply the updated deployment configurations to the AKS cluster using kubectl.

Now, the next step is to set up the Kubernetes deployment and service configuration for both components of the application:

  • Streamlit App: This serves as the frontend interface for users.
  • FastAPI App: This functions as the backend, handling API requests from the Streamlit frontend and returning model predictions.

Both deployment and service YAML files for these components are already present in the k8s/ folder and will be used for deploying to Azure Kubernetes Service (AKS).

This k8s/deployment.yaml file sets up a Streamlit app on Kubernetes with two key components:

  • Deployment: Runs 2 replicas of the Streamlit app using a Docker image. It exposes port 8501 and sets the API_URL environment variable to connect with the FastAPI backend.
  • Service: Creates a LoadBalancer service that exposes the app on port 80, making it accessible externally.

In short, it deploys the Streamlit frontend and makes it publicly accessible while connecting it to the FastAPI backend for predictions.

This k8s/fastapi_model.yaml file deploys the FastAPI backend for the house price prediction app:

  • It creates a Deployment named house-price-api with 2 replicas running the FastAPI app on port 8000.
  • A LoadBalancer Service named house-price-api-service exposes the app externally on port 8000, allowing other services (like Streamlit) or users to access the API.

In short, it runs the backend API in Kubernetes and makes it accessible for predictions.

Now it’s time for the final run to verify the deployment on the AKS cluster. Trigger the pipeline by selecting the run_all parameter.

Run All Image

 

After the pipeline completes successfully, all four stages and their corresponding jobs will be executed, confirming that the application has been successfully deployed to the AKS cluster.

 

Mlops Stages

Mlops Jobs

 

Now, log in to the Azure portal and retrieve the external IP address of the Streamlit app service. Once accessed in your browser, you’ll see the House Price Prediction Streamlit application up and running.

 

Aks Ips

 

Mlops Page

 

Now, go ahead and perform model inference by selecting the appropriate parameter values and clicking on “Predict Price” to see how the model generates the prediction.

 

Mlops Predict

Conclusion

In this blog, we explored the fundamentals of MLOps and how it bridges the gap between machine learning development and scalable, production-ready deployment. We walked through a complete MLOps workflow—from data processing and feature engineering to model training, packaging, and deployment—using modern tools like FastAPI, Streamlit, and MLflow.

Using Azure DevOps, we implemented a robust CI/CD pipeline to automate each step of the ML lifecycle. Finally, we deployed the complete House Price Predictor application on an Azure Kubernetes Service (AKS) cluster, enabling a user-friendly frontend (Streamlit) to interact seamlessly with a predictive backend (FastAPI).

This end-to-end project not only showcases how MLOps principles can be applied in real-world scenarios but also provides a strong foundation for deploying scalable and maintainable ML solutions in production.

]]>
https://blogs.perficient.com/2025/08/06/house-price-predictor-an-mlops-learning-project-using-azure-devops/feed/ 1 385548
Using GitHub Copilot in VS Code https://blogs.perficient.com/2025/08/04/using-github-copilot-in-vs-code/ https://blogs.perficient.com/2025/08/04/using-github-copilot-in-vs-code/#respond Mon, 04 Aug 2025 09:21:50 +0000 https://blogs.perficient.com/?p=384796

Let’s be honest – coding isn’t always easy. Some days, you’re laser-focused, knocking out feature after feature. Other days, you stare at your screen, wondering,
“What’s the fastest way to write this function?”
“Is there a cleaner way to loop through this data?”

That’s where GitHub Copilot comes in.

If you haven’t tried it yet, you’re seriously missing out on one of the biggest productivity boosters available to developers today. In this blog, I’ll walk you through how to use GitHub Copilot with Visual Studio Code (VS Code), share my personal experience, and help you decide if it’s worth adding to your workflow.

What is GitHub Copilot?

Think of GitHub Copilot as your AI pair programmer.
It’s trained on billions of lines of public code from GitHub repositories and can:

  • Suggest whole lines of code or entire functions
  • Autocomplete loops, conditions, or boilerplate code
  • Help you learn new frameworks or syntaxes on the fly

It’s like having a coding buddy that never sleeps, doesn’t get tired, and is always ready to assist.

Setting Up Copilot in VS Code

Getting started is easy. Here’s a step-by-step guide:

Step 1: Install Visual Studio Code

If you don’t have VS Code installed yet, you can install it from here.

Step 2: Install the GitHub Copilot Extension

  • Open VS Code
  • Go to the Extensions tab (Ctrl+Shift+X)
  • Search for GitHub Copilot
  • Click Install

Or directly visit here to find the extension.

Step 3: Sign in with GitHub

After installing, you’ll be prompted to sign in using your GitHub account.

Note: GitHub Copilot is a paid service (currently), but there’s usually a free trial to test it out.

How Does Copilot Work?

Once set up, Copilot starts making suggestions as you code. It’s kind of magical.

Here’s how it typically works:

  • Type a comment describing what you want
    • Example:
// Function to reverse a string

Copilot will automatically generate the function for you!

  • Write part of the code, and Copilot completes the rest
    • Start writing a “\for\” loop or an API call, and Copilot will suggest the following lines.
  • Cycle through suggestions
    • Press Tab to accept a suggestion, or use Alt + [ / Alt + ] to browse different options.

Real-Life Use Cases

Here’s how I personally use Copilot in my day-to-day coding:

Use Case Why I Use Copilot
Boilerplate Code Saves time writing repetitive patterns
API Calls Auto-completes fetch or axios calls quickly
Learning New Syntax Helps with unfamiliar frameworks like Rust or Go
Unit Tests Suggests test cases faster than starting from scratch
Regular Expressions Generates regex patterns (saves Googling!)

Tips to Get the Most Out of Copilot

  1. Write clear comments:
    • Copilot works better when you describe what you want.
  2. Don’t blindly trust the output:
    • It’s smart, but not always correct.
    • Review the suggestions carefully, especially for security-sensitive code.
  3. Pair it with documentation:
    • Use Copilot for assistance, but keep the official docs open.
    • Copilot is great, but it doesn’t replace your understanding of the framework.
  4. Use Copilot Labs (Optional):
    • If you want more experimental features like code explanation or refactoring suggestions, try Copilot Labs.

Is Copilot Replacing Developers?

Short answer? No.

Copilot is a tool, not a replacement for developers.
It speeds up the boring parts, but:

  • Critical thinking? Still you.
  • Architecture decisions? Still you.
  • Debugging complex issues? Yes, still you.

Think of Copilot as an assistant, not a boss. It helps you code faster, but you’re still in charge of the logic and creativity.

Pros and Cons of Copilot

Pros

  • Saves time on repetitive coding tasks
  • Reduces context-switching to StackOverflow or Google
  • Helps you learn new syntaxes quickly
  • Available right inside VS Code

Cons

  • Requires an active subscription after the free trial
  • Sometimes generates incorrect or outdated code
  • Can make you over-rely on suggestions if you’re not careful

Final Thoughts: Is Copilot Worth It?

If you’re someone who:

  • Codes daily
  • Works across multiple languages or frameworks
  • Wants to focus on the “what” and less on the “how”

Then GitHub Copilot is absolutely worth trying out.

Personally, I’ve found it to be a game-changer for productivity. It doesn’t write all my code, but it takes away the mental fatigue of boilerplate so I can focus on solving real problems.

Useful Links

]]>
https://blogs.perficient.com/2025/08/04/using-github-copilot-in-vs-code/feed/ 0 384796
C# + GitHub Copilot in Visual Studio 2022 https://blogs.perficient.com/2025/07/29/c-github-copilot-in-visual-studio-2022/ https://blogs.perficient.com/2025/07/29/c-github-copilot-in-visual-studio-2022/#comments Tue, 29 Jul 2025 14:40:32 +0000 https://blogs.perficient.com/?p=385097

What is GitHub Copilot?

GitHub Copilot is an AI-powered programming assistant that assists developers by generating code based on their comments and existing code. Now natively integrated into Visual Studio 2022, it supports multiple languages, including C#.

Steps to Set Up GitHub Copilot in Visual Studio 2022

Prerequisites

  • Visual Studio 2022 – Version 17.10 or later
  • .NET Desktop Development workload installed
  • GitHub Account – With an active Copilot subscription
  • GitHub Copilot Extension – Installed via Visual Studio Installer
  • Local Git RepositoryEnsure your C# project is under Git version control

After installation, sign in with your GitHub account that has Copilot access. You’ll see a GitHub Copilot icon in the top-right corner of the IDE indicating its status.

Githublogin

Activating GitHub Copilot in Visual Studio

If GitHub Copilot is installed but in an inactive state, it may be because:

  • You’re not yet signed into Visual Studio with a GitHub account

To Activate Copilot

  1. Click the Copilot status icon in the Visual Studio toolbar,
  2. From the dropdown menu, choose Sign in.
  3. Sign in with a GitHub account that has an active Copilot subscription.

Or…

  1. Select Open Chat Window
  2. Choose:
    • Sign up for Copilot Free to sign up for Copilot Free
    • Sign in if you already have a Copilot-enabled account.

Once signed in, the Copilot status icon will change to indicate it’s active.

Using GitHub Copilot to Generate C# Methods

  1. Generating Simple Code with Copilot

    Step 1: Add a comment, e.g.

    // Prompt: Write a method to calculate the factorial of a number using recursion

    Step 2: GitHub Copilot will suggest code based on your comment after a few seconds.

    Step 3: Accept or Modify

    • Press Tab to accept.
    • Use Alt +] or Alt + [ to cycle through suggestions.
    • Modify as needed.

    Please watch the video below which helps us to use GitHub Copilot in C#

    copilot with c#

    You can even prompt GitHub Copilot to generate unit tests:

    // Unit test for Factorial method using MSTest

    GitHub Copilot will suggest

    [TestMethod]
    public void TestFactorial()
    {
        var calc = new Calculator();
        Assert.AreEqual(120, calc.Factorial(5));
    }
  2. Generating Complex Code with Copilot

    If we need the list of customers from the database with some filters, then we can prompt like

    // Method to get active customers from a specific city using DbContext

    GitHub Copilot will generate like below sample code

    public class CustomerService
    {
        private readonly AppDbContext _context;
    
        public CustomerService(AppDbContext context)
        {
            _context = context;
        }
    
        public async Task<List<Customer>> GetActiveCustomersByCityAsync(string cityName)
        {
            return await _context.Customers
                .Where(c => c.IsActive && c.City == cityName)
                .OrderBy(c => c.LastName)
                .ToListAsync();
        }
    }

Benefits of Using GitHub Copilot

  • Speeds up development by generating boilerplate and repetitive code.
  • Understands your intent through comments and method names.
  • Reduces manual errors in common data access patterns.
  • Supports clean architecture by suggesting service-layer methods.

Things to Keep in Mind

  • Always review the code for correctness and performance.
  • Copilot doesn’t know your business logic, so suggestions may need tweaking.
  • Security and validation are your responsibility.
  • Suggestions can vary, so results may not always be consistent.
  • Over-reliance can hinder learning if used without understanding the code.

Conclusion

For C# developers, GitHub Copilot in Visual Studio 2022 is revolutionary. It decreases complexity and increases productivity in everything from creating methods to writing tests. Experience the future of AI-assisted development by giving it a try.

Reference:  https://learn.microsoft.com/en-us/visualstudio/ide/visual-studio-github-copilot-extension?view=vs-2022

]]>
https://blogs.perficient.com/2025/07/29/c-github-copilot-in-visual-studio-2022/feed/ 6 385097
Optimize Sitecore Docker Instance: Increase Memory Limits https://blogs.perficient.com/2025/07/28/optimize-sitecore-docker-instance-increase-memory/ https://blogs.perficient.com/2025/07/28/optimize-sitecore-docker-instance-increase-memory/#respond Mon, 28 Jul 2025 07:39:39 +0000 https://blogs.perficient.com/?p=384666

Running a Sitecore Docker instance is a game-changer for developers. It streamlines deployments, accelerates local setup, and ensures consistency across environments. However, performance can suffer – even on high-end laptops – if Docker resources aren’t properly optimized, especially after a hardware upgrade.

I recently faced this exact issue. My Sitecore XP0 instance, running on Docker, became noticeably sluggish after I upgraded my laptop. Pages loaded slowly, publishing dragged on forever, and SQL queries timed out.

The good news? The fix was surprisingly simple: allocate more memory to the proper containers using docker-compose.override.yml

What Went Wrong?

After the upgrade, I noticed:

  • The Content Management (CM) UI was lagging.
  • Publishing and indexing took ages.
  • SQL queries and Sitecore services kept timing out.

At first, this was puzzling because my new laptop had better specs. However, I then realized that Docker was still running with outdated memory limits for containers. By default, these limits are often too low for heavy workloads, such as Sitecore.

Root Cause

Docker containers run with memory constraints either from:

  • docker-compose.override.yml
  • Docker Desktop global settings

When memory is too low, Sitecore roles such as CM and MSSQL can’t perform optimally. They need significant RAM for caching, pipelines, and database operations.

The Solution: Increase Memory in docker-compose.override.yml

To fix the issue, I updated the memory allocation for key containers (mssql and cm) in the docker-compose.override.yml file.

Here’s what I did:

Before

mssql: 
 mem_limit: 2G

After

mssql:
  mem_limit: 4GB

cm:
  image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-xp0-cm:${VERSION:-latest}
  build:
    context: ./build/cm
    args:
      BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-xp0-cm:${SITECORE_VERSION}
      SPE_IMAGE: ${SITECORE_MODULE_REGISTRY}sitecore-spe-assets:${SPE_VERSION}
      SXA_IMAGE: ${SITECORE_MODULE_REGISTRY}sitecore-sxa-xp1-assets:${SXA_VERSION}
      TOOLING_IMAGE: ${SITECORE_TOOLS_REGISTRY}sitecore-docker-tools-assets:${TOOLS_VERSION}
      SOLUTION_IMAGE: ${REGISTRY}${COMPOSE_PROJECT_NAME}-solution:${VERSION:-latest}
      HORIZON_RESOURCES_IMAGE: ${SITECORE_MODULE_REGISTRY}horizon-integration-xp0-assets:${HORIZON_ASSET_VERSION}
  depends_on:
    - solution
  mem_limit: 8GB
  volumes:
    - ${LOCAL_DEPLOY_PATH}\platform:C:\deploy
    - ${LOCAL_DATA_PATH}\cm:C:\inetpub\wwwroot\App_Data\logs
    - ${HOST_LICENSE_FOLDER}:c:\license
    - ${LOCAL_ITEM_PATH}:c:\items-mounted

How to Apply the Changes

  1. Open docker-compose.override.yml.
  2. Locate the mssql and cm services.
  3. Update or add the mem_limit property:
    • mssql → 4GB
    • cm → 8GB
  4. Rebuild containers:
    
    docker compose down
    docker compose up --build -d
  1. Check updated limits:
  docker stats

Impact After Change

After increasing memory:

  • CM dashboard loaded significantly faster.
  • Publishing operations completed in less time.
  • SQL queries executed smoothly without timeouts.

Why It Works

Sitecore roles (especially CM) and SQL Server are memory-hungry. If Docker allocates too little memory:

  • Containers start swapping.
  • Performance tanks.
  • Operations fail under load.

By increasing memory:

  • CM handles ASP.NET, Sitecore pipelines, and caching more efficiently.
  • SQL Server caches queries better and reduces disk I/O.

Pro Tips

  • Ensure Docker Desktop or Docker Engine is configured with enough memory globally.
  • Avoid setting memory limits too high if your laptop has limited RAM.
  • If using multiple Sitecore roles, adjust memory allocation proportionally.

Final Thoughts

A simple tweak in docker-compose.override.yml can drastically improve your Sitecore Docker instance performance. If your Sitecore CM is sluggish or SQL queries are slow, try increasing the memory limit for critical containers.

]]>
https://blogs.perficient.com/2025/07/28/optimize-sitecore-docker-instance-increase-memory/feed/ 0 384666