5 Signs You’ve Built a Secretly Bad Architecture (And How to Fix It)
Can Pure Scrum Actually Work?
Observability and Performance
The dawn of observability across the software ecosystem has fully disrupted standard performance monitoring and management. Enhancing these approaches with sophisticated, data-driven, and automated insights allows your organization to better identify anomalies and incidents across applications and wider systems. While monitoring and standard performance practices are still necessary, they now serve to complement organizations' comprehensive observability strategies. This year's Observability and Performance Trend Report moves beyond metrics, logs, and traces — we dive into essential topics around full-stack observability, like security considerations, AIOps, the future of hybrid and cloud-native observability, and much more.
Java Application Containerization and Deployment
Software Supply Chain Security
Managing orphaned users in SQL Server is critical to database security and administration. Orphaned users occur when a database user exists without a corresponding login in the master database. This mismatch can disrupt access and lead to potential security vulnerabilities. In this article, we'll explore what orphaned users are, how to detect them, and methods to resolve them, including updated examples and scenarios. Background To connect to an SQL Server database, a user must have a valid login in the master database. This login authenticates the user and maps to a database user for authorization. The mapping is maintained using the Security Identifier (SID), ensuring that database users and server logins are linked correctly. Exceptions to the rule of login-user mapping include: Contained Database Users: Authenticate at the database level, eliminating dependency on server logins. These users enhance database portability but require separate recreation for each database.Guest Accounts: Enabled by default, they allow access to users without explicit mapping but are generally discouraged for security reasons.Microsoft Windows Group Memberships: Windows group members can access databases if the group is added as users. A database user becomes orphaned when: The corresponding login is deleted.The database is migrated or restored without the associated logins.The SID mapping between the user and login is incorrect. What Are Orphaned Users? An orphaned user occurs when: The database user exists, but the corresponding SQL Server login in the master database does not.The database user SID and login SID mismatch. These scenarios disrupt authentication and authorization, leading to errors or restricted access. Detecting Orphaned Users For SQL Server Use the following query to identify orphaned users: MS SQL SELECT dp.type_desc, dp.sid, dp.name AS user_name FROM sys.database_principals AS dp LEFT JOIN sys.server_principals AS sp ON dp.sid = sp.sid WHERE sp.sid IS NULL AND dp.authentication_type_desc = 'INSTANCE'; For Azure SQL Database or Synapse Analytics 1. Retrieve the SIDs of logins in the master database: MS SQL SELECT sid FROM sys.sql_logins WHERE type = 'S'; 2. Retrieve SIDs of users in the target database: MS SQL SELECT name, sid, principal_id FROM sys.database_principals WHERE type = 'S' AND name NOT IN ('guest', 'INFORMATION_SCHEMA', 'sys') AND authentication_type_desc = 'INSTANCE'; 3. Compare the lists to identify mismatches. Resolving Orphaned Users 1. Recreate Missing Login with SID If the login was deleted: MS SQL CREATE LOGIN <login_name> WITH PASSWORD = '<use_a_strong_password_here>', SID = <SID>; 2. Map an Orphaned User to an Existing Login If the login exists but isn't mapped: MS SQL ALTER USER <user_name> WITH LOGIN = <login_name>; 3. Change User Password After recreating the login, update its password: MS SQL ALTER LOGIN <login_name> WITH PASSWORD = '<enterStrongPasswordHere>'; Using sp_FindOrphanedUser The stored procedure sp_FindOrphanedUser is a powerful tool for detecting and resolving orphaned users. It provides: A list of orphaned users.Auto-generated scripts for repairs.Details about schemas owned by orphaned users. Get the package code from sp_FindOrphanedUser. Running the Procedure Default execution: MS SQL EXEC sp_FindOrphanedUser; For a specific database: MS SQL EXEC sp_FindOrphanedUser @DatabaseName = '<DatabaseName>'; Examples of Orphaned User Scenarios Example 1: User Without Login Scenario A login is deleted, leaving the database user orphaned. Detect the orphaned user: MS SQL EXEC sp_FindOrphanedUser; Recreate the login: MS SQL CREATE LOGIN [User1] WITH PASSWORD = 'SecurePassword123'; USE [ExampleDB]; ALTER USER [User1] WITH LOGIN = [User1]; Example 2: SID Mismatch Scenario The login SID doesn't match the user SID. Detect the mismatch: MS SQL EXEC sp_FindOrphanedUser @DatabaseName = 'ExampleDB'; Correct the SID mapping: MS SQL USE [ExampleDB]; EXEC sp_change_users_login 'UPDATE_ONE', 'User2', 'User2'; Example 3: Orphaned User Owning a Schema Scenario Orphaned user prevents schema deletion. Detect schema ownership: MS SQL EXEC sp_FindOrphanedUser @DatabaseName = 'ExampleDB'; Reassign schema ownership: MS SQL USE [ExampleDB]; ALTER AUTHORIZATION ON SCHEMA::[User3Schema] TO [dbo]; DROP USER [User3]; Best Practices Use Contained Database Users: Avoid dependency on server logins.Synchronize Logins: Always migrate or restore logins during database migrations.Regular Audits: Periodically check for orphaned users to maintain security. Conclusion Managing orphaned users ensures database security and operational efficiency. By using queries and tools like sp_FindOrphanedUser, you can quickly identify and resolve issues, maintaining seamless access for legitimate users. Adopting best practices like contained users and regular audits can prevent such problems in the future.
Public web data is being used for various purposes, from impactful research to creating and improving products. One of the most common ways to acquire such data is through web scraping. Because it involves gathering large amounts of data published by businesses or individuals online, it raises questions such as "Is it ethical?" The short answer is yes if you're following certain practices, but we need to lay the groundwork before diving head-first into it. This article aims to shine a light on the topic of ethical web scraping and explore the intensifying debate surrounding the use of public web data for developing AI. Before proceeding, please note that this is an informational article and does not constitute legal advice. Why Is Web Scraping Important? Scraping is an automated method of large-scale data collection from the web. There are around 202 million active websites on the internet today, and each of them contains a wealth of information and a variety of data valuable to people and businesses, the scope of which is hard to put into words. A website can be a small travel blog, the world's leading online marketplace, or anything in between. One thing that all of these websites have in common is that most of them contain publicly available data. Gathering this data in an automated way is in line with the current regulatory landscape. However, certain conditions apply, and businesses need to handle public data with caution and care. Organizations use web scraping or buy services from data providers specializing in web scraping. Large amounts of valuable data from the web are being used for a variety of purposes, such as: Market researchInvestment insightsHR technologySearch enginesPrice aggregationThreat intelligence Without web scraping, some of the most commonly used services, such as some of the most popular online search tools, wouldn't exist. Web scraping also has many applications in the field of research, such as environmental research. Earlier, I pointed out that public web data must be obtained by following the current regulatory landscape as well as principles that ensure the overall safety of the process and the data gathered. However, sometimes, web scraping appears in a negative context because of cases where the legal and ethical principles are dismissed or the purpose of the action is malicious. Current Web Scraping Regulation Let's examine the legal side of the question to help us understand what web scraping activities are in line with the current regulatory standards. Website's Terms of Service In this article, I'm discussing scraping exclusively public web data from publicly available online sources, which means that such data is available to anyone without signing up or logging into the website. Usually, data located behind login-secured areas is governed by the website's terms and conditions. Copyrights Some public web data may contain copyrighted material. When working with such data, you must follow applicable copyright laws. Privacy Laws Similarly to copyrighted materials, some public web data may contain data that is protected by privacy laws. Privacy regulations around the world are continuously evolving and vary by jurisdiction. For example, the majority of the regulations in U.S. states, such as the California Consumer Privacy Act (CCPA), do not classify publicly available information as personal data. However, European regulations, like the General Data Protection Regulation (GDPR), do not exempt public data. Therefore, GDPR-related data security and privacy measures must be considered when collecting web data. Now that you are familiar with the legal side of web scraping, I'll mention one of the most notable court cases that illustrates how these legal requirements apply to the real-life use of web scraping technologies. LinkedIn vs. hiQ Labs In 2017, LinkedIn issued a cease-and-desist letter to HiQ Labs, a data science company that scraped publicly available LinkedIn data and used it to create tools and insights. This case eventually evolved into a 6-year long legal battle, which is now known as a landmark case in the web scraping industry. The first court ruling favored hiQ Labs, but LinkedIn appealed, arguing that hiQ Labs was breaching the Computer Fraud and Abuse Act (CFAA). Still, at that time, the court decided that since the data that hiQ Labs scraped from LinkedIn was public, the company was not breaching the terms of CFAA. As the legal dispute continued, the center of the case shifted to hiQ Labs’s use of fake profiles to scrape LinkedIn's data. The second ruling in 2022 stated that scraping web data behind the login wall using a fake profile was a breach of the website's terms and conditions. Eventually, companies reached a settlement in which hiQ Labs agreed to stop scraping LinkedIn. However, it is important to highlight that the previous precedent regarding CFAA and public data scraping was not overruled by the second ruling. Instead, the judgment decided on a different legal question mostly related to the User Agreement and the usage of fake accounts when collecting data from LinkedIn. It is important to note that by creating fake accounts, hiQ Labs has also accepted LinkedIn’s User Agreement prior to accessing LinkedIn’s online services, which prohibits creating false identities. Therefore, the United States District Court‘s order, dated 27 October 2022, held that LinkedIn’s User Agreement prohibits scraping and unauthorized use of the scraped data and that hiQ breached LinkedIn’s user agreement through turkers’ creation of false identities on LinkedIn’s platform. You should still note that the field of public web data scraping is constantly changing, and relevant case law developments involving web data companies should be followed. I recommend consulting legal experts about any business activities related to it. Ethics and Mindful Web Scraping As mentioned above, besides the legal side of public web data collection from the web, there are also other aspects related to the ethics of web scraping. In time, these principles became a part of an unwritten code of conduct for players in this field. The key considerations are listed below: Rate limits: Data extraction is performed by submitting requests to the website. Overloading a website with requests can impact its performance and should be avoided.Dedicated APIs: Keep in mind that some websites provide APIs for accessing their data.Proxies: Proxies used for web scraping should be sourced ethically. Responsible businesses treat ethical web scraping as a commitment inseparable from establishing themselves as reputable players in the public web data business. Last year, a group of leading web data aggregation companies launched an Ethical Web Data Collection Initiative, which focuses on encouraging dialogue and improving digital peace of mind for consumers and companies. They have since announced a list of ethical web data collection principles, for example: Mindfulness: This means that data collection companies should be mindful and aware of potential misuse of data.Social responsibility: Companies should never collect data for purposes that might do harm to society. Ethical data collection companies also support organizations and projects, such as research or NGOs, by providing them with data. Web Scraping and AI High-quality web data contributed to bringing one of the key types of AI technology, the large language model (LLM), to where it is today. Training LLMs to understand human language and generate context-aware responses requires huge amounts of data. For example, the training of GPT-3, the predecessor of Chat GPT-4, required forty-five terabytes of text. Publicly available information from the internet is one of the key pillars of information being used to train AI. The AI market is expected to grow exponentially in the next few years. Naturally, this raises questions about using web data to train AI and create AI products. AI Training and Copyright Laws Some argue that companies behind this booming technology breach copyright laws by scraping online data without permission to train AI and create new products. Furthermore, it is further argued that large language models like ChatGPT use all data from the training dataset to generate responses, sometimes "mimicking" the original content. To better understand both sides of the argument, let's look at some cases that have happened since OpenAI launched ChatGPT, one of the leading LLMs, and made it available to the public. New York Times vs. OpenAI At the end of 2023, the New York Times newspaper sued OpenAI for using its content to train AI, the first major U.S. media outlet to do so. Since then, several other media outlets have also sued OpenAI, claiming that the company violates federal copyright laws by using their articles to train AI systems. Content Licensing Agreements Some media companies took a different approach. For example, the Financial Times has made a content licensing deal with a generative AI company, allowing them to use Financial Times content to develop AI products. Using Public Data for Training AI OpenAI, on the other side of the discussion, argues that using public web data to train AI is fair use. From this point of view, many news publications are open to the public, with no logins or paywalls; therefore, they should be considered public web data. Similar to other content on the web, such as Wikipedia articles, company websites, social networking sites, and more. At the same time, AI is undoubtedly revolutionizing how we work and do business. It also provides society with tools that can be used for societal good, assisting researchers and scientists in finding solutions to environmental, medical, and other global challenges. Moreover, many for-profit AI companies offer powerful models, such as GPT-3.5 or Gemini Pro, free of charge. But it comes with challenges. This is no black-and-white issue. It is no longer necessary to discuss the importance of AI systems becoming an integral part of our personal and professional lives. The expected trajectory of AI market growth proves this point. However, it is still necessary to establish industry-specific principles that constitute acceptable use of web data for LLM training and separate the wheat from the chaff when it comes to AI training. These principles might evolve and change over time. Still, they should aim for mutual agreement and common understanding, allowing entities on both sides of the argument to operate successfully and balance commercial interests while also creating the space for AI innovation for the public good. Final Thoughts While the ethics of scraping public web data and using it for training AI sparks many discussions, there are legitimate cases that prove the value and importance of these novel technologies. Still, it is essential to follow the principles of ethical web scraping and, even more so, to continue working on maintaining a peaceful dialogue among all organizations involved as new technologies and challenges emerge.
Migrating your on-premise data warehouse to the cloud — an efficient and scalable storage solution — requires thorough planning. You'll need to evaluate cost impact, scalability benefits, performance gains, governance structures, and compliance requirements, not to mention security and privacy implications. This article will explore these critical factors while giving you a high-level overview of the challenges inherent in transitioning your data to the cloud. Understanding the Shift: On-Premise to Cloud Traditional on-premise data warehouses pose limitations — significant upfront investments, limited scalability, and hefty maintenance costs. As businesses grapple with growing data demands, these constraints can hinder scalability and agility, leading to operational inefficiencies. In this regard, moving your data warehouse to the cloud emerges as a compelling solution as it offers elastic resources, cost-effective scaling, and managed services, thus addressing many on-premises shortcomings. Yet, cloud adoption isn't one-size-fits-all since considerations such as data sovereignty, security, and latency can influence the decision. For instance, a global enterprise with variable workloads might thrive with a cloud data warehouse, leveraging its on-demand scalability for efficient resource utilization. Conversely, an organization with sensitive data subject to stringent regulatory controls might opt for an on-premise solution to maintain tighter control. The scenarios above underscore the need to weigh the benefits and limitations of each approach, setting the stage for an in-depth examination of cloud data warehousing pros and cons. Pros and Cons of Cloud Data Warehousing: Factors to Consider Before Migrating Your On-Premise Infrastructure Indeed, cloud data warehouses offer a convincing solution for many organizations with their pay-as-you-go models, seamless scalability, and reduced overhead for maintenance. However, the cloud's suitability hinges on individual use cases, which we'll explore next, ensuring you make an informed decision. Cost Implications Transitioning to a cloud data warehouse comes with many financial considerations. Initially, the shift can potentially reduce capital expenses, as the need for investing in physical infrastructure is eliminated. The cloud's pay-as-you-go pricing model offers a variable cost structure, allowing businesses to pay only for the storage and computing resources they use, leading to significant savings. Nevertheless, it's crucial to account for the total cost of ownership (TCO) when migrating to the cloud, including some “hidden” costs that are often overlooked. Think of data transfer fees (egress fees), the cost of services to manage and secure the data warehouse, and the potential charges for additional features or higher performance tiers. All in all, cloud scalability is a double-edged sword: while it allows businesses to handle increased loads without a hitch, it can also lead to unexpected costs if not managed judiciously. For instance, consider a company that traditionally maintained a sizeable on-premise data center. The operational expenses included hardware depreciation, electricity for power and cooling, and a dedicated IT staff for maintenance. Transitioning to the cloud, the company shifts to a subscription model, paying for compute and storage capacity as needed. Initially, this model reduces costs by eliminating hardware investments and lowering energy bills. However, as data usage grows, the company may choose higher-tier services for better performance, inadvertently increasing monthly subscription costs. The chosen cloud provider's pricing structure and the company's ability to manage and optimize cloud resources thus become critical in determining whether operational expenses decrease or rise post-migration. In other words, when evaluating the financial aspects of migrating your data warehouse to the cloud, consider your business's specific data needs, growth projections, and usage patterns. A meticulous analysis will help determine if the cloud's scalability and operational flexibility align with your financial goals. Last but not least, remember that the most cost-effective solution may not always be the cheapest one upfront but the one that offers the best value in the long run. Data Security and Privacy Considerations Besides costs, migrating to a cloud data warehouse introduces a new landscape of security and privacy considerations. On the one hand, major public cloud providers invest heavily in security measures, offering robust protections that may surpass what individual businesses can implement on-premise. Encrypting data, both at rest and in transit, advanced firewalls, and regular security audits are standard offerings that safeguard data. Yet, entrusting sensitive information to a third party necessitates a comprehensive understanding of the provider's security policies and compliance with regulations such as GDPR, HIPAA, or PCI DSS. For this reason, it's imperative to clarify roles and responsibilities for data security and ensure that the provider's security posture aligns with your company’s privacy standards. Data residency is another concern; the physical location of servers can affect compliance with national data sovereignty protection laws. Therefore, businesses must be vigilant about where their data is stored and processed. An illustrative example is a healthcare organization transitioning to the cloud. While the cloud provider ensures encryption and network security, the organization must still comply with HIPAA regulations, which require controls over access to patient data. The organization must establish clear access policies and ensure the cloud environment is configured to enforce these policies, potentially requiring additional governance tools or services. On the other hand, a financial institution subject to strict regulatory compliance might find a cloud data warehouse suboptimal. The reason is simple. Banks and other financial institutions handle sensitive financial data requiring stringent security protocols and immediate access control, which could be compromised by the multi-tenant nature of public cloud services, potentially exposing them to regulatory penalties and undermining client trust due to perceived security risks. All in all, while the move to a cloud data warehouse can enhance security capabilities, it also shifts some control over sensitive data to the cloud provider. That’s why it is crucial that companies perform due diligence to exhaustively evaluate the security risks to which they are exposed when migrating to the cloud and whether these risks conflict with data governance and compliance applicable to their industry. Data Governance and Compliance As you plan your cloud warehouse migration, consider data governance and compliance as pivotal to your strategy. Beyond assessing data residency and sovereignty, you must also evaluate data center certifications, ensuring they meet industry-specific standards. For instance, financial services may require an SSAE 18 assessment, while healthcare might look for HITRUST CSF compliance. Other industries, such as US government contractors, may need all that and more. Depending on your use case, you may also need to use private connections, like AWS Direct Connect, Equinix Fabric, or Azure ExpressRoute. These private connections can bolster security and compliance by establishing a dedicated network link between your premises and the cloud provider. This setup minimizes exposure to public internet vulnerabilities and enhances data transfer reliability. Moreover, you should also delve into the cloud provider's data retention policies and their ability to support your data lifecycle management, ensuring that data deletion and archival practices align with legal and business requirements. Lastly, consider the provider's compliance and auditing capabilities. That is, for regulatory reviews and internal audits, you'll need precise logs and audit trails. Ensure that your chosen cloud warehouse offers comprehensive tools for monitoring, reporting, and alerting that support your compliance workflows. Performance and Scalability Significant performance and scalability improvements are probably the main reason numerous organizations migrate to cloud data warehouses. That is, cloud warehouses provide flexible computing resources that can be scaled up or down to suit fluctuating data processing demands. This elasticity allows businesses to handle peak loads without the need for over-provisioning, optimizing resource utilization and cost. Furthermore, cloud solutions such as Amazon Redshift, Google BigQuery, Microsoft Azure Synapse Analytics, Oracle Autonomous Data Warehouse, and IBM Db2 Warehouse leverage Massively Parallel Processing (MPP) technology to offer maximum performance and scalability. For instance, a weather app could use an MPP cloud data warehouse to swiftly process and analyze vast amounts of meteorological data from multiple sources. This would provide real-time, localized weather predictions to users while seamlessly scaling during high-demand events like storms or heat waves. That’s only one example of how cloud data warehouses enable efficient data querying, allowing for real-time analytics and faster decision-making. Another advantage is the global deployment capabilities of major public cloud providers. They offer multiple regions and availability zones, reducing latency by locating data closer to end-users and ensuring higher availability and disaster recovery capabilities. For example, a retail company experiencing significant traffic spikes during holiday seasons can benefit from a cloud data warehouse. They can temporarily scale up their compute resources to handle the increased demand for real-time inventory tracking and customer analytics, ensuring smooth operations and customer satisfaction. Post-holiday, they can scale down to reduce costs and maintain efficiency. Overall, cloud data warehouses offer a level of performance and scalability that traditional on-premises solutions struggle to match. By leveraging these aspects, businesses can stay agile and competitive, with the ability to adapt to evolving data requirements. Data Migration and Integration Challenges Migrating to a cloud warehouse often presents complex data migration and integration challenges; let’s review the most important ones. Data Security: Securely transferring sensitive data is critical. Protection measures must include encryption during transit and at rest to prevent breaches.Data Format Compatibility: Legacy systems often use data formats that may not match modern cloud warehouses. For instance, a financial institution may need to convert historical transaction data from a proprietary format.Business Application Integration: Ensuring existing applications work with the new cloud warehouse can be complicated. For example, a retail company integrating its CRM system with the cloud warehouse must avoid downtime and data inconsistencies. Addressing these challenges requires detailed planning, appropriate migration tools, and potentially the assistance of data warehouse experts to ensure a smooth process. Conclusion This article has highlighted that a successful cloud data warehouse migration hinges on managing costs, ensuring data security, maintaining regulatory compliance, and assessing the benefits of performance and scalability improvements. By prioritizing these elements, organizations can harness the cloud's potential to boost data management and significantly enhance their data-driven decisions, all while maintaining operational and financial stability.
Prompt engineering is the art and science of crafting inputs to guide AI models in generating desired outputs. This involves designing and refining prompts — questions, instructions, or statements — to effectively communicate with AI language models. The quality and structure of these prompts directly influence the usefulness and reliability of the AI’s responses. What Is the Perfect Prompt? The best prompt is one that effectively communicates your requirements to the AI, ensuring that the generated output meets your expectations. You can craft prompts that yield high-quality and useful responses by incorporating clarity, specificity, context, conciseness, and relevance. Formula for a Perfect Prompt Creating a good prompt involves clearly stating the context, specifying the task, and indicating how you’d like the response formatted. This helps ensure that the AI produces a result that meets your needs. For this, you can use the CSIR formula: [Context + Specific Information + Intent or Goal + Response Format = Perfect Prompt] Software Developer Example Below is an example of how to construct a prompt for a software developer: Context: "I'm a software developer" Specific Information: "working on a Python project" Intent/Goal: "Can you explain how to implement exception handling in Python?" Response Format: "Write it in a simple paragraph or list" Perfect Prompt: "I'm a software developer working on a Python project. Can you explain how to implement exception handling in Python? Write it in a simple paragraph or list." Types of Prompts Instructional Prompts: Direct commands or questions, e.g., “Summarize this article in 200 words.”Contextual Prompts: Providing background information to guide the AI, e.g., “Given the current market trends, predict the stock prices for the next quarter.”Conversational Prompts: Mimicking human conversation to elicit natural responses, e.g., “What are your thoughts on the latest tech innovations?”Role-based Prompts: Assigning a role to the AI, e.g., “As a financial advisor, provide investment advice for a beginner.” The Formula for Effective Prompts A good prompt typically includes the following elements: Persona: Define the role of the AI, e.g., “As a historian…”Context: Provide background information, e.g., “In the context of the Renaissance period…”Task: Clearly state the task, e.g., “Explain the impact of the printing press”Example: Offer an example if needed, e.g., “For instance, how did it affect literacy rates?”Format: Specify the desired format, e.g., “Write a 300-word essay.”Tone: Indicate the tone, e.g., “In a formal tone.” Best Practices for Writing Prompts Clarity and Specificity: Be clear and specific about what you want. Ambiguous prompts lead to ambiguous responses.Context Provision: Provide enough context for the AI to understand the task fully.Iterative Refinement: Refine your prompts based on the responses you get. Iteration helps in honing the prompt for better results.Use Examples: Providing examples can help the AI understand the format and style you are looking for.Chain-of-Thought Prompting: Encourage the AI to think step-by-step by breaking down complex tasks into smaller parts.Few-Shot and Zero-Shot Learning: Use few-shot learning by providing a few examples in the prompt or zero-shot learning by relying on the AI’s pre-trained knowledge. Real-World Consequences of Prompt Misuse Prompt misuse can lead to various unintended and sometimes harmful outcomes. Here are some real-world examples: 1. Prompt Injection Attacks Prompt injection attacks occur when malicious users craft inputs that manipulate AI models into performing unintended actions. For instance, users tricked a Twitter bot powered by OpenAI’s ChatGPT into making outlandish claims by embedding malicious instructions within seemingly benign prompts. This type of attack can lead to the spread of misinformation or unauthorized actions. 2. Data Leakage In some cases, poorly crafted prompts can cause AI models to inadvertently reveal sensitive information. For example, a Stanford University student managed to get Microsoft’s Bing Chat to disclose its programming using a cleverly designed prompt. This highlights the risk of sensitive data being exposed through prompt manipulation. 3. Misinformation and Fake News AI models can be misused to generate and spread misinformation. By crafting prompts that ask the AI to create false or misleading content, users can produce fake news articles, misleading social media posts, or deceptive advertisements. This can have serious consequences, including influencing public opinion and causing panic. 4. Offensive or Harmful Content Prompts that encourage AI models to generate offensive, harmful, or inappropriate content can lead to reputational damage and emotional harm. For example, if a user crafts a prompt that leads an AI to generate hate speech or explicit content, it can result in significant backlash and ethical concerns. 5. Manipulating AI for Malicious Purposes AI models can be manipulated to perform malicious tasks, such as generating phishing emails, creating deepfake videos, or automating cyberattacks. Using specific prompts, attackers can exploit AI capabilities for harmful activities, posing significant security risks. Preventing Prompt Misuse To mitigate these risks, it’s essential to: Implement robust security measures to detect and prevent prompt injection attacks.Regularly review and update prompts to ensure they do not inadvertently lead to harmful outcomes.Educate users about the ethical use of AI and the potential consequences of prompt misuse.Develop and enforce guidelines for responsible AI usage. Python Libraries for Generating Prompts Programmatically There are several Python libraries available to generate prompts programmatically. Here are a few notable ones: 1. PromptDesk PromptDesk is an open-source prompt management platform that facilitates the creation, organization, integration, and evaluation of prompts. It supports various large language models (LLMs) and provides a minimalist prompt builder with features like prompt variable and logic support, audit logs, and vendor-agnostic LLM API integrations. Installation Plain Text pip install promptdesk Usage Plain Text from promptdesk import PromptDesk pd = PromptDesk(api_key="YOUR_PROMPTDESK_API_KEY") story = pd.generate("short-story", { "setting": "dark and stormy night", "character": "lonely farmer", "plot": "visited by a stranger" }) print(story) 2. Ppromptor Ppromptor is a Python library designed to generate and improve prompts for LLMs automatically. It uses autonomous agents to propose, evaluate, and analyze prompts, continuously improving them through collaboration with human experts. Installation Plain Text pip install ppromptor --upgrade Usage Plain Text from ppromptor import Proposer, Evaluator, Analyzer proposer = Proposer() evaluator = Evaluator() analyzer = Analyzer() prompt = proposer.propose("Generate a creative story prompt") evaluation = evaluator.evaluate(prompt) improved_prompt = analyzer.analyze(evaluation) print(improved_prompt) Why We Need to Input Prompt in Double Quotes Using double quotes in a prompt can serve several important purposes, especially when interacting with AI models or programming languages. Here are some key reasons: Defining the Boundaries of a String Double quotes help clearly define the boundaries of a string or text input. This is crucial for the AI or the programming language to understand where the input starts and ends. For example: prompt = "Summarize the following text: 'Artificial intelligence is transforming industries...'" In this case, the double quotes indicate that everything within them is part of the prompt. Handling Special Characters and Spaces Double quotes allow you to include special characters and spaces within the text without causing errors. For instance, if your prompt includes punctuation or spaces, double quotes ensure that these characters are interpreted correctly: prompt = "What is the capital of France?" When you need to include quotes within your prompt, using double quotes for the outer string and single quotes for the inner quotes helps avoid confusion: prompt = "The teacher said, 'Knowledge is power.'" This way, the AI or the programming language can distinguish between the different levels of quotes. Improving Code Clarity and Readability Using double quotes consistently helps maintain clarity and readability in your code or prompts. It makes it easier for others (or yourself) to understand and modify the prompts later. Preventing Syntax Errors Using double quotes correctly helps prevent syntax errors that can occur if the AI or the programming language misinterprets the input. This is especially important in complex prompts or when integrating with APIs. Using double quotes in prompts is a best practice that ensures clarity, accuracy, and consistency. It helps define the boundaries of the input, handle special characters, embed quotes, and avoid syntax errors. By following this practice, you can create more effective and reliable prompts for AI models and programming tasks. 7 Best Practices for Effective Prompt Engineering 1. Be Specific Provide detailed questions to get detailed answers. For example, instead of asking about all dog breeds, ask about small dog breeds suitable for apartment living. 2. State Your Intent Clearly state the purpose of your question. For instance, specify if you need an explanation. 3. Use Correct Spelling and Grammar Clear and correct prompts help ensure accurate responses. 4. Direct the Output Format Specify the desired format of the answer, such as a list or a paragraph. 5. Ask Follow-Up Questions If the initial response isn't satisfactory, ask follow-up questions for clarification. 6. Experiment with Different Phrasings Rephrase your question if you're not getting the desired response. 7. Prompt for Fact-Checking Ask the model to provide sources or fact-check information for reliability. Conclusion Mastering prompt engineering is essential for anyone looking to leverage AI tools effectively. By understanding the different types of prompts, using a structured formula like CSIR, and following best practices, you can significantly improve the quality of AI-generated outputs. Ethical considerations are crucial to ensuring responsible and fair use of AI, preventing misuse, and promoting trust in AI technologies. Ultimately, effective prompt engineering not only enhances the accuracy and relevance of AI responses but also contributes to the ethical and responsible use of AI in various domains.
Traditional monitoring is not enough. We need developer-centric solutions that only Observability 2.0 can give us. Read on to see why. Beyond Traditional Monitoring In today's software development landscape, creating cutting-edge applications requires an acute focus on the developers who craft these digital experiences from start to finish; henceforth, contemporary tools are not just expected but demanded to be inherently developer-centric-offering environments that promote efficiency and creativity. Observability 2.0 goes beyond traditional monitoring paradigms by embedding a continuous feedback mechanism directly into the development lifecycle itself rather than as an afterthought or separate process, demanding transparency across every phase of software production to maintain system health at all times while ensuring that code quality and application performance adhere strictly to enterprise standards. This modern approach mandates developers work within a cohesive platform ecosystem where debugging tools are tightly integrated with the IDE. This immediate access allows for quick identification, analysis, and resolution of issues directly from their coding space without extraneous context switching or external dependency on legacy systems often associated with traditional observability setups. Additionally, modern developer-centric solutions facilitate real-time collaboration through shared canvases where developers can visually track system states alongside peers. This not only streamlines the debugging process but also enhances knowledge sharing and collective problem solving which is pivotal for developing complex software systems that are robust against failure. Telemetry Is the Key Observability 2.0 demands a sophisticated layer of telemetry capture, where metrics related to performance (response times), throughput (transactions per second), resource utilization (CPU and memory usage) as well as log files from each unit test or integration phase are all recorded with precision. This data is then processed using advanced analytics tools that provide a granular view of system health, enabling developers to proactively pinpoint the root cause before problems escalate into critical failures. Furthermore, more than just flagging issues when performance dips below acceptable thresholds, these solutions incorporate machine learning techniques for predictive analysis. This means identifying patterns and potential future risks based on historical data, which in turn allows developers to iterate with an awareness of possible scaling concerns or resource bottlenecks. This next-gen observability approach also integrates into the Continuous Integration/Continuous Deployment (CI/CD) pipelines. By doing so it informs build automation and deployment strategies, ensuring that only applications with verified metrics pass through to subsequent stages of testing or release. Developers are empowered by dashboards within their workflow which highlight the health status of different modules; these visual indicators provide clarity on areas in need of immediate attention thus enabling an accelerated development cycle while keeping developers abreast without distracting them from writing quality code under real-time conditions. To truly be modern and developer-centric, observability solutions must also incorporate robust logging mechanisms that allow for tracing execution flow. This granular detail in log files becomes essential when debugging complex application flows or distributed systems where component interactions can lead to obscure interdependencies causing unexpected errors. Advanced monitoring tools now provide contextual information about these logs while still within the developer's environment, thus not only facilitating rapid issue resolution but also allowing for a deeper understanding of how code elements interact throughout their lifecycle. This insight is critical when developing with microservices or serverless architectures where traditional observability techniques may fail to capture subtle inter-service communication nuances. Moreover, Observability 2.0 in the context of developer tools means implementing end-to-end trace visualization capabilities so that developers can comprehensively understand how their code interacts with various system components. This is not only about pinpointing issues but also validating design choices; for example, understanding latency between API calls within a service mesh or tracing data flows through multiphase transactions. Integration With Developers’ Tools Integration of developer-centric observability tools into the daily workflow requires careful planning and thoughtful architecture that supports various testing environments. This may range from unit tests to endurance runs in production replicas, ensuring that monitoring is not just an afterthought but a pervasive element throughout development. It becomes part of their armor as they write code; visualization dashboards are embedded within IDEs or dedicated developer hub applications enabling immediate insights into the behavior and health metrics at all times. This transparency builds trust among teams, fostering an environment where developers can confidently push new features without fearing that a bug introduced today could cause tomorrow’ extraneous distractions. Modern solutions must also facilitate observability in containerized or cloud-native environments which are becoming increasingly common. This means adaptive tools capable of spanning across multiple infrastructure layers whether it's monitoring containers, Kubernetes pods, serverless functions, and beyond — each layer offering unique challenges but equally demanding precise telemetry collection for effective observability. Developers should leverage these modern solutions to not only maintain the high performance expected by end-users today but also architect futureproof systems that can rapidly scale without compromising on reliability or stability during sudden traffic surges, all while retaining their focus on writing clean and robust code where developers are empowered through observance of how every line they write impacts overall system behavior. In summary, a modern developer-centric approach to Observability 2.0 insists on integrating real-time analytics into the development process for maintaining software health. A multiprong strategy encompasses embedding debugging tools within IDES offering immediate feedback and collaborative canvases that align with contemporary cloud workflows, incorporating advanced metrics processing in CI/CD pipelines, adopting comprehensive logging to trace execution flow through complex application structures while providing end-to-end visualization for full contextual understanding of code interactions. Modern software development demands these solutions not just as optional but as core components driving efficiency and precision: the bedrock upon which developers construct systems that are resilient, performant, and scalable, maintaining fidelity to enterprise standards while fostering a transparent environment for rapid iteration leading towards the ultimate goal of high-quality software delivery. Observability 2.0 Is a Must In conclusion, embracing developer tools with Observability 2.0 in mind is no longer optional but rather an imperative element. Developers today require these advanced features as part and parcel of their everyday coding practice just like they would rely on any other essential toolkit such as version control systems or build automation. Modern solutions must evolve beyond conventional boundaries, becoming intrinsic aspects of a developer's environment where each keystroke is informed by real-time metrics that influence immediate decisions and promote an enriched understanding. This harmony between coding fluency and observance ensures not just delivery but also sustainability in today’s ever-evolving landscape.
There are a number of legacy systems being used in different industries. These range from government entities to the financial sector, healthcare, transportation, manufacturing, and more. Many systems adopted in these industries were developed in the late 20th century and, therefore, face inherent limitations. The monolithic architectures and tightly coupled components they adopt are the prime reason for this. But that’s not the end of it, though. Previous-century development aside, some systems built using relatively more recent technologies also present several legacy issues. This is because of the rigid, stateful sessions and the management nature of these platforms. As a result, the modern “scalable architecture” has come to light. For example, microservices, based on a number of technologies, adopt a great way to solve this issue. It uses: Spring Boot for microservices development,Kubernetes for container orchestration, andKafka for event-driven communication. The key principle that makes the architecture “scalable” is how it decomposes monolithic applications into smaller, independent services. Each of these services can be independently developed, deployed, and scaled; be it individually or simultaneously. This, in turn, improves resilience and agility. This article will dive into scalable architectures, discussing how they can promote legacy system transformation for overall system maintainability. IBM IMS, COBOL, JSP Servlets, WebSphere, and other technologies often lead to performance bottlenecks. This is primarily because of the monolithic architecture they adopt, as well as the non-distributed design. Each process is analyzed and performed in a single flow instead of being distributed, hence leading to bottlenecks. The connection speed, processing power, and other limitations may result in slow data processing or other related issues. Modernization Requirement Itinerary Based on the findings, we can then craft a modernization requirement itinerary. It is important to note, though, that the plan for the modernized architecture must adopt a technical and business-based approach. This means that the new architecture to be created must meet the technical demands that operations present as well as the overall business environment requirements. The most important improvements it must offer are functional upgrades. This means that the new system must improve elements such as: Real-time data processing,User experience,Request queuing,Reduced latency,User interface (humanistic design elements), and more. The new architecture must also meet non-functional requirements, with a particular focus on scalability, maintainability, and security. Legacy systems are often prone to cyber threats, but newly developed architectures are also a hallmark for becoming direct targets by potential attackers. A microservices-enabled architecture via Spring Boot can help decentralized services. Kubernetes may be used for container orchestration, while Docker may be adopted for containerization. For secure communications, Kafka presents a viable alternative due to its event-driven communications and scalability capabilities. Principles of Scalable Architecture Several key principles make up a scalable architecture. Developers must keep in mind these principles during modernization. One of the most important aspects of a scalable architecture is its ability to handle bigger loads without impacting performance. Essentially, there are two types of scalabilities expected from a modernized architecture; Vertical Scaling (Scale-Up), which involves an increased software or hardware capacity. This may be done via upgrades to the CPU, RAM, or storage. For monolithic architectures, this is achieved via more powerful servers. Horizontal Scaling (Scale-Out), which involves increased load capacity, i.e., more requests being handled per second. This can be done by introducing more threads into the system with the help of Apache Cassandra. For scalability, load balancing, statelessness, and asynchronous processing is also equally important. This involves distributing requests, stateless components to be able to handle any request, and decoupling components via message queues, respectively. There are several modern architectural patterns that developers may adopt, such as: A microservices architecture, where each microservice handles a different capability but works independently and cohesively at the same time. Implementing an event-driven architecture, which adopts asynchronous communications. It decouples services while maintaining the ability to trigger different components as the need arises. A serverless architecture can execute different functions based on stimuli automatically instead of being provided by managers. Spring Boot and Spring Cloud, Docker, Kubernetes, Apache Kafka, and AWS Lambda are some of the more modern technologies that developers can use to implement a modernized architecture. However, the choice of technology will ultimately depend on the architecture being integrated, budgetary constraints, and the final expected outcome. Redesigning Legacy Systems The strategy to be used for architectural redesign also requires careful consideration. The whole idea of the architecture being scalable means that the end result must be efficient and maintainable, even under increased load. Developers may also use a service-oriented migration model. This migration model is best suited for an architecture that will adopt microservices moving forward. Furthermore, the domain-driven design (DDD) is also a great option for modernization. Here, the legacy system will be broken down into smaller chunks or “contexts.” Developers can then create their own microservices with any other technology for each of the contexts individually. Modernization Strategies and Benefits Post-Migration Once migrated, developers will need to focus on performance tuning and optimization. One of the most important aspects of the scalability of the platform is load balancing, which can be accomplished by distributing requests evenly across multiple services. This isn’t limited to individual requests, though. Even larger requests can be decoupled and distributed, allowing for asynchronous processing. Finally, implementing auto-scaling via adaptive AI or Kubernetes can help adjust the number of running instances. For improved processes, developers can also adjust the garbage collection (GC) settings to improve overall memory management. This, in turn, helps minimize pauses during processes and can, therefore, allow for more reliable scalability. Implementing these best practices can help achieve several benefits, such as: Better execution speeds,Reduced latency,Optimized code and database queries,Better load handling,Lower costs due to auto-scaling and lower resource demands,Easier maintenance,Better security,Improved resource allocation,Faster development cycles,Better adaptability, Higher availabilityMore reliability, Better fault-tolerance,Better disaster recovery, and more. Conclusion It's widely recognized that replacing the old with the new brings numerous advantages in various contexts. Scalable architecture, in general, has proven to be a lifeline for organizations looking to reduce operating costs and improve performance. Decoupling services, asynchronous processing, and horizontal scaling alone can be enough to help manage surges in traffic or workload. Microservices, for example, can help improve virtually any functionality, reallocating resources as and when needed. This flexibility offered by scalable architecture can be critical for all organizations, especially when it comes to healthcare, finance, and e-commerce.
Companies across the globe spend more than $65 billion each year to maintain their legacy mainframe systems. Moving from mainframes to serverless systems on AWS gives businesses a great chance to cut operating costs. They can also benefit from cloud-native architecture. This fundamental change lets companies replace their rigid, monolithic systems with adaptable ones that meet market needs. AWS serverless technologies offer modern alternatives to traditional mainframe parts. Amazon EventBridge and Amazon API Gateway stand out as prime examples. These services make infrastructure management simple. They also deliver better scaling options and lower operating costs. This piece gets into the technical hurdles, strategies, and best practices you need for a successful mainframe-to-AWS serverless move. Your organization can direct this complex transition with confidence. Understanding Mainframe Architecture and AWS Serverless Components Mainframe systems have remained the backbone of enterprise computing since the 1950s. The world's largest banks still depend on these systems, with 96 out of the top 100 using them. About 71 percent of Fortune 500 companies rely on mainframes for their critical operations. A single powerful computer handles multiple users through terminal connections, which defines the traditional mainframe architecture. These systems handle both batch and online transaction processing. They use Job Control Language (JCL) for batch operations and let users interact through GUI or 3270 terminal interfaces. Mainframes excel at processing massive I/O volumes. They manage huge data repositories with databases that range from gigabytes to terabytes. AWS serverless architecture brings a radical alteration to computing. It offers a complete suite of services that removes infrastructure management worries. The main AWS serverless components are: AWS Lambda: Provides event-driven compute service that scales automaticallyAmazon API Gateway: Lets you create and manage RESTful APIsAmazon EventBridge: Makes serverless event bus implementation easierAWS Step Functions: Coordinates complex workflows and state management The serverless platform shows impressive scalability. AWS Lambda can handle concurrent executions of multiple functions while keeping costs low through a pay-per-use model. AWS has launched many fully-managed serverless services over the last several years. These services combine smoothly with existing AWS services and third-party solutions. Organizations must assess several critical factors before moving from mainframe to serverless architecture. The AWS Migration Acceleration Program (MAP) for Mainframe provides a structured approach. It offers processes, tools, and services built specifically for cloud migration projects. The program follows three steps: assess readiness, mobilize resources, and migrate workloads. Data migration needs careful planning because mainframes store data in Direct Access Storage Device (DASD) or Virtual Tape Library (VTL) formats. AWS offers storage options like Amazon S3, Amazon EFS, and Amazon FSx. These alternatives improve scalability and security while delivering high performance. The move to serverless requires attention to performance optimization. New challenges like cold start latencies can take 5-10 seconds for inactive functions. However, the benefits often outweigh these challenges. Customers report 60 to 90 percent cost savings after moving mainframe workloads to AWS. Automatic scaling and reduced operational overhead make the transition worthwhile. Technical Migration Challenges Organizations face major technical hurdles when moving from mainframe to serverless architecture. Studies show that more than 80% of data migration projects fail to achieve their goals. This highlights how complex these changes can be. Data Migration Complexities Data migration stands as a critical challenge in mainframe modernization. Legacy systems store massive amounts of data that could be flawed, inconsistent, or fail to meet current industry standards. The task becomes even more complex because mainframe systems use proprietary languages and technologies. This makes adapting data to cloud platforms extremely difficult. Organizations should put these measures in place to tackle these challenges: Resilient data management systems with strong backup and recovery protocolsStep-by-step migration phases with thorough validation testingAutomated validation tools that check compliance with GDPR and HIPAA Code Conversion and Refactoring Challenges We see fewer professionals who know mainframe legacy programming languages like COBOL/DB2 and NATURAL/ADABAS. This talent gap leads to higher costs and risks in maintaining legacy systems. Teams must handle complex tasks like flow normalization, code restructuring, and data layer extraction during refactoring. Large and complex mainframe systems often lack proper documentation, which makes code conversion harder. Teams find it difficult to integrate with modern agile development processes. This affects how quickly organizations can bring products to market and create new solutions. Performance and Scalability Concerns Many believe cloud migration offers unlimited scalability. Cloud platforms do offer better scalability than on-premises setups, but they have their limits. Organizations must work hard to maintain performance levels during and after migration, especially with high-volume transaction processing. Teams need to optimize performance by carefully planning resource use and capacity. Well-executed modernization projects can cut infrastructure costs by up to 70%. Legacy mainframe systems often can't keep up with modern needs. This creates bottlenecks that stop organizations from moving forward. The COVID-19 pandemic has made these challenges more obvious, especially with remote access issues and unpredictable demand patterns. Organizations now need to break down data silos faster and use data analysis better to stay competitive. Implementation Strategy and Architecture A successful move from mainframe to serverless migration needs a well-laid-out plan that tackles both technical and operational aspects. AWS provides complete solutions that help organizations modernize their legacy systems and keep their business running smoothly. Choosing the Right AWS Services AWS ecosystem gives you a strong set of services built specifically for mainframe modernization. The solution typically runs modernized applications inside Docker containers that Amazon Elastic Container Service (Amazon ECS) arranges, while AWS Secrets Manager and Parameter Store manage environmental configurations. Here are the most important AWS services for modernization: Amazon Aurora PostgreSQL: Serves as a replacement for mainframe database enginesAmazon S3: Handles task inputs and outputsAWS Step Functions: Manages workflow arrangementAmazon EventBridge: Enables live event processingAmazon API Gateway: Helps with service integration Breaking Down Monolithic Applications Moving from monolithic to microservices architecture needs a systematic approach. Organizations should use a two-phase transformation strategy: 1. Technical Stack Transformation Convert programs to REST APIsChange COBOL programs and JCLs into single executablesImplement in-memory cache optimizationDeploy services to chosen servers 2. Business Split Transformation Apply Domain-Driven Design principlesIdentify bounded contextsSeparate business functionalitiesCreate independent microservices Designing Serverless Microservices Serverless architecture implementation aims to create expandable, maintainable services. AWS Mainframe Modernization service supports both automated refactoring and replatforming patterns. It delivers cloud-native deployment by changing online and batch COBOL and PL/I applications to Java. This approach has shown remarkable results. One implementation delivered 1,018 transactions per second — equivalent to a 15,200 MIPS IBM Mainframe — and reduced annual infrastructure costs from $16 million to $365,000. The architecture makes use of AWS-managed services and serverless technology. Each microservice stays elastic and reduces system administrator tasks. Application Load Balancers provide encryption in transit and application health checks for HTTP-based services. Network Load Balancers handle other services, such as IBM CICS. AWS Secrets Manager handles sensitive data, while Parameter Store manages non-sensitive configurations for environmental settings, including database endpoints and credentials. This separation provides secure and efficient configuration management while maintaining operational flexibility. Security and Compliance Considerations Cloud migration security has changed substantially with serverless architectures. AWS shared responsibility model moves about 43% of compliance requirements to AWS. This allows organizations to concentrate on securing their applications. Identity and Access Management AWS Identity and Access Management (IAM) is the lifeblood of security control in serverless environments. Organizations need to set up detailed permissions that follow the principle of least privilege. Users should only get the permissions they need for their specific job functions. IAM offers a complete system for authentication and authorization that includes: Multi-factor authentication (MFA) to improve securityRole-based access control to manage resourcesProgrammatic and console-based access managementIntegration with existing identity providers Data Encryption and Protection The mainframe for serverless migration needs multiple security layers for data protection. AWS Mainframe Modernization works with AWS Key Management Service (KMS) to encrypt all stored data on the server side. The service creates and manages symmetric encryption keys. This helps organizations meet strict encryption requirements and reduces operational complexity. Security measures protect data in different states: TLS 1.2 or higher protocols safeguard data in transitAWS KMS-managed keys encrypt data at restAWS Secrets Manager protects application secrets Regulatory Compliance Requirements AWS serverless architecture supports various compliance frameworks with built-in controls for major regulatory standards. Organizations can make use of information from AWS compliance programs certified for: SOC (System and Organization Controls)PCI DSS (Payment Card Industry Data Security Standard)HIPAA (Health Insurance Portability and Accountability Act)FedRAMP (Federal Risk and Authorization Management Program)ISO (International Organization for Standardization) Container security needs a different approach than traditional environments, especially in highly regulated industries. Serverless environments change rapidly. This demands automated security controls throughout the software development lifecycle. Traditional security tools don't deal very well with the dynamic nature of serverless architectures. Risk intelligence plays a vital role in container security. Organizations need complete scanning and monitoring capabilities to maintain their security posture. AWS provides integrated security services that enable automated vulnerability scanning, compliance monitoring, and threat detection across serverless infrastructure. Performance Optimization and Testing Performance optimization and testing are crucial for successful mainframe to serverless migration on AWS. Studies show that performance standards of serverless platforms focused on CPU performance, network speed, and memory capacity measurements. Load Testing and Benchmarking Testing serverless infrastructure needs a systematic approach to confirm system performance. Artillery Community Edition has become a popular open-source tool to test serverless APIs. It shows median response times of 111ms with a p95 time of 218ms in standard implementations. Organizations can utilize Serverless Artillery to handle higher throughput scenarios. It runs the Artillery package on Lambda functions to achieve boosted performance metrics. Performance testing tools show that AWS serverless platforms have decreased tail latency, boosted bursty behavior, and improved image fetch speed. The ServerlessBench framework stands out with its detailed performance analysis capabilities. Monitoring and Observability Setup AWS CloudWatch works as the core monitoring solution and gives detailed insights into serverless application performance. Lambda Insights delivers essential metrics such as: Invocation rates and duration trackingSystem-level CPU utilizationMemory usage patternsNetwork performance indicatorsError count and failure rates CloudWatch Application Insights makes use of machine learning to create dashboards that spot potential problems, including metric anomalies and log error detection. AWS X-Ray helps developers create service maps with visual representations of tracing results that identify bottlenecks and connection latencies. Performance Tuning Strategies You can optimize serverless performance through smart capacity planning and resource allocation. Lambda functions support memory configurations from 128 MB to 10, 240 MB. CPU allocation increases proportionally with memory allocation. This scalability lets organizations fine-tune performance based on specific workload needs. Key optimization steps include: Function startup time evaluation and optimizationSDK client initialization outside function handlersImplementation of execution environment reuseSmart use of local file system cachingConnection pooling for database operations The AWS Lambda Power Tuning tool makes the optimization process automatic. It tests different memory configurations systematically to find the most efficient settings for specific use cases. Testing data shows that importing individual service libraries instead of the entire AWS SDK can cut initialization time by up to 125ms. CloudWatch Container Insights gives live visibility into containerized workloads. It offers detailed monitoring at the task, service, and cluster levels. Organizations can maintain optimal performance while managing complex serverless architectures during and after migration from mainframe systems. Conclusion AWS's complete suite of services helps organizations plan and execute their mainframe to serverless migration carefully. This technological move needs thorough planning. Companies that begin this experience can address complex modernization challenges while keeping their operations stable. Several key aspects lead to successful migration: AWS services like Lambda, EventBridge, and API Gateway offer strategic ways to apply changesSecurity frameworks protect data through encryption, access management, and compliance measuresSystem optimization techniques ensure strong operationsTesting methods verify migration success and system reliability Organizations that switched from mainframe to serverless architecture showed remarkable benefits. Many achieved 90% cost reduction and improved operational efficiency. AWS's serverless platform meets modern enterprise computing's needs through scalability, security, and performance. Your mainframe modernization success depends on monitoring, optimization, and adaptation to new technologies. Smart organizations embrace this change, and they position themselves well to gain agility, reduce costs, and gain competitive advantages.
What’s GitOps All About? GitOps is a way to manage infrastructure and applications through Git, using it as a single source of truth. In simple terms, you treat infrastructure configurations the same way you treat code: everything is defined, versioned, and stored in Git. By using Git’s familiar workflows (pull requests, commits, reviews), you make infrastructure changes with full visibility and control. The magic of GitOps lies in automation. With tools like Flux or ArgoCD, every change committed to Git triggers updates to the live environment. These tools constantly monitor for any drift between what’s in Git and what’s live, and they reconcile the differences automatically, keeping your systems aligned with your intended setup. Why Is GitOps So Popular Right Now? 1. Total Visibility and Accountability GitOps provides an audit trail by tracking all infrastructure changes in Git. Since Git records every change with a clear history, you know exactly who made what change and when. This makes troubleshooting and audits a breeze. 2. Seamless Team Collaboration By using Git, both developers and operations can collaborate seamlessly. Instead of using separate processes for application and infrastructure updates, GitOps aligns everything under one workflow. Changes are proposed through pull requests, reviewed by the team, and then applied, creating a unified workflow for both code and infrastructure. 3. Easy Rollbacks and Fewer Risks GitOps makes rolling back to a previous state as simple as reverting to an earlier commit in Git. This is invaluable during incidents or after unexpected changes because it restores stability without manual reconfiguration. 4. Stability and Consistency in Deployments With automated monitoring, GitOps tools detect any divergence from the intended setup and bring things back in line. This reconciliation process helps reduce configuration drift, ensuring that your environment always matches what’s in Git. 5. Scalability and Automation GitOps scales well, especially in cloud environments. As systems grow, the automation provided by GitOps handles scaling seamlessly, adjusting configurations based on changes in Git rather than requiring manual intervention. How GitOps Works: The Core Components Implementing GitOps involves a few key components: Git repository as the source of truth: All infrastructure configurations live here, representing the desired state of your environment.Declarative configurations: Infrastructure is defined through files like Kubernetes YAMLs or Terraform, making it easy to track and manage.Automated reconciliation: Tools like Flux or ArgoCD constantly check for differences between Git and the live environment, correcting any deviations.Change management via PRs: Teams propose infrastructure updates through pull requests, ensuring every change is reviewed and authorized before going live. This setup ensures that infrastructure updates follow a consistent, transparent process with versioning and rollback options, making deployments safer and more predictable. Implementing GitOps: A Simple Workflow Setting up GitOps can be broken down into a few basic steps: Create a Git repository for configurations: Organize configurations by environments (e.g., staging, production) to keep things clear.Define Infrastructure as Code: Use declarative configurations like Kubernetes manifests or Terraform files. Each environment can have unique configurations to avoid mix-ups.Deploy a GitOps operator: Tools like Flux or ArgoCD monitor the Git repo, applying changes automatically whenever there’s an update.PR workflow for changes: Changes go through a pull request review process. Once approved and merged, the GitOps operator will apply them automatically.Monitor and reconcile drift: Automated alerts notify you of any drift, and GitOps tools handle reconciling live environments back to the desired state. Popular GitOps Tools: Choices for Every Team If you’re implementing GitOps, some popular tools to consider include: Flux: Monitors Git and applies changes to Kubernetes clusters; works well with Helm and Kustomize for more complex setupsArgoCD: Known for its user-friendly interface, ArgoCD is ideal for managing multiple apps and environments in Kubernetes.Jenkins X: Combines CI/CD with GitOps, making it a great option for teams already using JenkinsTerraform: While not GitOps-specific, Terraform’s Infrastructure as Code approach fits well into GitOps workflows, especially for multi-cloud environments. Real-World Applications of GitOps GitOps is gaining traction in industries where infrastructure needs to be reliable, secure, and scalable. E-commerce: With frequent updates and high traffic, GitOps helps e-commerce companies keep deployments stable across multiple regions.Finance: Financial institutions benefit from GitOps’ audit trails and secure PR workflows, which enforce compliance.SaaS companies: For SaaS, GitOps speeds up feature rollouts and improves recovery times, crucial for customer satisfaction in cloud-based services. Challenges and Considerations With GitOps As great as GitOps sounds, it’s not without its challenges: Learning curve: Teams new to Kubernetes, Helm, or GitOps tools like Flux will need time to ramp up.Managing secrets: Sensitive information (like API keys) requires extra steps for secure management. Tools like HashiCorp Vault or Sealed Secrets can help.Non-Kubernetes environments: GitOps works well with Kubernetes, but extending it to other infrastructure types may require extra setup.Network dependency: Since GitOps agents need constant access to Git, network issues can disrupt synchronization. Future of GitOps: What’s Next? GitOps is growing beyond just managing infrastructure. It’s starting to touch areas like security (with GitOps workflows for managing policies and permissions), data operations (DataOps), and even MLOps, where models and data pipelines are managed as code. The potential to apply GitOps to nearly every aspect of the tech stack is on the horizon. In addition, GitOps is pushing DevOps toward “continuous everything” — continuous deployment, monitoring, and even continuous security. This means that as infrastructure grows more complex, GitOps can help teams keep up without needing to scale operations manually. Wrapping It Up: Why GitOps Is Here to Stay GitOps has quickly gained popularity because it solves real problems for DevOps teams: it improves visibility, simplifies collaboration, and offers safe, scalable deployment methods. By aligning infrastructure management with Git-based workflows, GitOps is empowering teams to manage infrastructure with the same precision and control as application code. In the coming years, as more organizations adopt hybrid and multi-cloud environments, GitOps will likely become the default approach, bringing even more consistency, transparency, and automation to DevOps practices.
Back-end development can feel like you’re constantly putting out fires — one messy query here, a crashing API call there. But it doesn’t have to be that way! By using well-established design patterns, you can make your codebase more organized, scalable, and easier to maintain. Plus, it’ll keep your boss impressed and your weekends stress-free. Here are some essential back-end patterns every developer should know, with examples in Java to get you started. 1. Repository Pattern: Tidy Up Your Data Layer If your application’s data access logic is scattered across your codebase, debugging becomes a nightmare. The Repository Pattern organizes this mess by acting as an intermediary between the business logic and the database. It abstracts data access so you can switch databases or frameworks without rewriting your app logic. Why It’s Useful Simplifies testing by decoupling business logic from data access.Reduces repetitive SQL or ORM code.Provides a single source of truth for data access. Example in Java Java public interface UserRepository { User findById(String id); List<User> findAll(); void save(User user); } public class UserRepositoryImpl implements UserRepository { private EntityManager entityManager; public UserRepositoryImpl(EntityManager entityManager) { this.entityManager = entityManager; } @Override public User findById(String id) { return entityManager.find(User.class, id); } @Override public List<User> findAll() { return entityManager.createQuery("SELECT u FROM User u", User.class).getResultList(); } @Override public void save(User user) { entityManager.persist(user); } } 2. CQRS Pattern: Give Reads and Writes Their Space The Command Query Responsibility Segregation (CQRS) pattern is all about separating read and write operations into different models. This allows you to optimize each one independently. For example, you could use an optimized database for reads (like Elasticsearch) and a transactional database for writes (like PostgreSQL). Why It’s Awesome Optimizes performance for read-heavy or write-heavy systems.Simplifies scalability by isolating workloads.Allows different data structures for reading and writing. Example in Java Java // Command: Writing data public void createOrder(Order order) { entityManager.persist(order); } // Query: Reading data public Order getOrderById(String id) { return entityManager.find(Order.class, id); } 3. Builder Pattern: Create Complex Objects With Ease Constructing objects with multiple optional parameters can lead to bloated constructors. The Builder Pattern solves this problem by providing a step-by-step approach to creating objects. Why You’ll Love It Keeps constructors clean and readable.Makes object creation more modular and flexible.Simplifies debugging and testing. Example in Java Java public class Order { private String id; private double amount; private Order(Builder builder) { this.id = builder.id; this.amount = builder.amount; } public static class Builder { private String id; private double amount; public Builder setId(String id) { this.id = id; return this; } public Builder setAmount(double amount) { this.amount = amount; return this; } public Order build() { return new Order(this); } } } // Usage Order order = new Order.Builder() .setId("123") .setAmount(99.99) .build(); 4. Event-Driven Architecture: Let Services Communicate Smoothly Microservices thrive on asynchronous communication. The Event-Driven Architecture pattern allows services to publish events that other services can subscribe to. It decouples systems and ensures they remain independent yet coordinated. Why It Works Simplifies scaling individual services.Handles asynchronous workflows like notifications or audit logs.Makes your architecture more resilient to failures. Example in Java Java // Event publisher public class EventPublisher { private final List<EventListener> listeners = new ArrayList<>(); public void subscribe(EventListener listener) { listeners.add(listener); } public void publish(String event) { for (EventListener listener : listeners) { listener.handle(event); } } } // Event listener public interface EventListener { void handle(String event); } // Usage EventPublisher publisher = new EventPublisher(); publisher.subscribe(event -> System.out.println("Received event: " + event)); publisher.publish("OrderCreated"); 5. Saga Pattern: Keep Distributed Transactions in Check When multiple services are involved in a single transaction, things can get messy. The Saga Pattern coordinates distributed transactions by breaking them into smaller steps. If something goes wrong, it rolls back previously completed steps gracefully. Why It’s Essential Ensures data consistency in distributed systems.Simplifies failure handling with compensating actions.Avoids the need for a central transaction manager. Example in Java Java public class OrderSaga { public boolean processOrder(Order order) { try { createOrder(order); deductInventory(order); processPayment(order); return true; } catch (Exception e) { rollbackOrder(order); return false; } } private void createOrder(Order order) { // Create order logic } private void deductInventory(Order order) { // Deduct inventory logic } private void processPayment(Order order) { // Payment processing logic } private void rollbackOrder(Order order) { System.out.println("Rolling back transaction for order: " + order.getId()); // Rollback logic } } Wrapping Up: Patterns Are Your Best Friend Design patterns aren’t just fancy concepts — they’re practical solutions to everyday back-end challenges. Whether you’re managing messy data access, handling distributed transactions, or just trying to keep your codebase sane, these patterns are here to help. So, the next time someone asks how you built such an efficient, maintainable backend, just smile and say, “It’s all about the patterns.”
AWS Sagemaker has simplified the deployment of machine learning models at scale. Configuring effective autoscaling policies is crucial for balancing performance and cost. This article aims to demonstrate how to set up various autoscaling policies using TypeScript CDK, focusing on request, memory, and CPU-based autoscaling for different ML model types. Model Types Based on Invocation Patterns At a high level, model deployment in SageMaker can be broken into three main categories based on invocation patterns: 1. Synchronous (Real-Time) Inference Synchronous inference is suitable when immediate response or feedback is required by end users, such as when a website interaction is required. This approach is particularly well-suited for applications that demand quick response times with minimal delay. Examples include fraud detection in financial transactions and dynamic pricing in ride-sharing. 2. Asynchronous Inference Asynchronous inference is ideal for handling queued requests when it is acceptable to process messages with a delay. This type of inference is preferred when the model is memory/CPU intensive and takes more than a few seconds to respond. For instance, video content moderation, analytics pipeline, and Natural Language Processing (NLP) for textbooks. 3. Batch Processing Batch processing is ideal when data needs to be processed in chunks (batches) or at scheduled intervals. Batch processing is mostly used for non-time-sensitive tasks when you need the output to be available at periodic intervals like daily or weekly. For example, periodic recommendation updates, where an online retailer generates personalized product recommendations for its customers weekly. Predictive maintenance, where daily jobs are run to predict machines that are likely to fail, is another good example. Types of Autoscaling in SageMaker With CDK Autoscaling in SageMaker can be tailored to optimize different aspects of performance based on the model’s workload: 1. Request-Based Autoscaling Use Case Best for real-time (synchronous) inference models that need low latency. Example Scaling up during peak shopping seasons for an e-commerce recommendation model to meet high traffic. 2. Memory-Based Autoscaling Use Case Beneficial for memory-intensive models, such as large NLP models. Example Increasing instance count when memory usage exceeds 80% for image processing models that require high resolution. 3. CPU-Based Autoscaling Use Case Ideal for CPU-bound models that require more processing power. Example Scaling for high-performance recommendation engines by adjusting instance count as CPU usage reaches 75%. Configuring Autoscaling Policies in TypeScript CDK Below is an example configuration of different scaling policies using AWS CDK with TypeScript: TypeScript import * as cdk from 'aws-cdk-lib'; import * as sagemaker from 'aws-cdk-lib/aws-sagemaker'; import * as autoscaling from 'aws-cdk-lib/aws-applicationautoscaling'; import { Construct } from 'constructs'; export class SageMakerEndpointStack extends cdk.Stack { constructor(scope: Construct, id: string, props?: cdk.StackProps) { super(scope, id, props); const AUTO_SCALE_CONFIG = { MIN_CAPACITY: 1, MAX_CAPACITY: 3, TARGET_REQUESTS_PER_INSTANCE: 1000, CPU_TARGET_UTILIZATION: 70, MEMORY_TARGET_UTILIZATION: 80 }; // Create SageMaker Endpoint const endpointConfig = new sagemaker.CfnEndpointConfig(this, 'EndpointConfig', { productionVariants: [{ modelName: 'YourModelName', // Replace with your model name variantName: 'prod', initialInstanceCount: AUTO_SCALE_CONFIG.MIN_CAPACITY, instanceType: 'ml.c5.2xlarge' }] }); const endpoint = new sagemaker.CfnEndpoint(this, 'Endpoint', { endpointName: 'YourEndpointName', // Replace with your endpoint name endpointConfig: endpointConfig }); // Set up autoscaling const scalableTarget = endpoint.createScalableInstanceCount({ minCapacity: AUTO_SCALE_CONFIG.MIN_CAPACITY, maxCapacity: AUTO_SCALE_CONFIG.MAX_CAPACITY }); this.setupRequestBasedAutoscaling(scalableTarget); this.setupCpuBasedAutoscaling(scalableTarget, endpoint); this.setupMemoryBasedAutoscaling(scalableTarget, endpoint); this.setupStepAutoscaling(scalableTarget, endpoint); } private setupRequestBasedAutoscaling(scalableTarget: sagemaker.ScalableInstanceCount) { scalableTarget.scaleOnRequestCount('ScaleOnRequestCount', { targetRequestsPerInstance: AUTO_SCALE_CONFIG.TARGET_REQUESTS_PER_INSTANCE }); } private setupCpuBasedAutoscaling(scalableTarget: sagemaker.ScalableInstanceCount, endpoint: sagemaker.CfnEndpoint) { scalableTarget.scaleOnMetric('ScaleOnCpuUtilization', { metric: endpoint.metricCPUUtilization(), targetValue: AUTO_SCALE_CONFIG.CPU_TARGET_UTILIZATION }); } private setupMemoryBasedAutoscaling(scalableTarget: sagemaker.ScalableInstanceCount, endpoint: sagemaker.CfnEndpoint) { scalableTarget.scaleOnMetric('ScaleOnMemoryUtilization', { metric: endpoint.metricMemoryUtilization(), targetValue: AUTO_SCALE_CONFIG.MEMORY_TARGET_UTILIZATION }); } // Example configuration of step scaling. // Changes the number of instances to scale up and down based on CPU usage private setupStepAutoscaling(scalableTarget: sagemaker.ScalableInstanceCount, endpoint: sagemaker.CfnEndpoint) { scalableTarget.scaleOnMetric('StepScalingOnCpu', { metric: endpoint.metricCPUUtilization(), scalingSteps: [ { upper: 30, change: -1 }, { lower: 60, change: 0 }, { lower: 70, upper: 100, change: 1 }, { lower: 100, change: 2 } ], adjustmentType: autoscaling.AdjustmentType.CHANGE_IN_CAPACITY }); } } Note: CPU metrics can exceed 100% when instances have multiple cores, as they measure total CPU utilization. Balancing Autoscaling Policies by Model Type Autoscaling policies differ based on model requirements: Batch Processing Models Request- or CPU-based autoscaling is ideal here since you won't have to pay for resources when traffic is low or none. Synchronous Models In order to provide a swift response to spikes in real-time requests, request-based autoscaling is recommended. Asynchronous Models CPU-based scaling with longer cooldowns prevents over-scaling and maintains efficiency. Key Considerations for Effective Autoscaling 1. Cost Management Tune metric thresholds to optimize cost without sacrificing performance. 2. Latency Requirements For real-time models, prioritize low-latency scaling; batch and asynchronous models can handle slight delays. 3. Performance Monitoring Regularly assess model performance and adjust configurations to adapt to demand changes. Like in the example above, we can use more than one autoscaling policy to balance cost and performance, but that can lead to increased complexity in setup and management. Conclusion With AWS SageMaker's autoscaling options, you can effectively configure resource management for different types of ML models. By setting up request-based, memory-based, and CPU-based policies in CDK, you can optimize both performance and costs across diverse applications.
December 20, 2024 by
How to Write for DZone Publications: Trend Reports and Refcards
December 19, 2024 by
December 18, 2024 by CORE
The Next Big Thing: How Generative AI Is Reshaping DevOps in the Cloud
December 20, 2024 by CORE
December 20, 2024 by CORE
Exploring the New Boolean Data Type in Oracle 23c AI
December 19, 2024 by
The Next Big Thing: How Generative AI Is Reshaping DevOps in the Cloud
December 20, 2024 by CORE
How to Test PATCH Requests for API Testing With Playwright Java
December 20, 2024 by CORE
December 20, 2024 by CORE
How to Test PATCH Requests for API Testing With Playwright Java
December 20, 2024 by CORE
December 20, 2024 by CORE
The Next Big Thing: How Generative AI Is Reshaping DevOps in the Cloud
December 20, 2024 by CORE
How to Test PATCH Requests for API Testing With Playwright Java
December 20, 2024 by CORE
December 20, 2024 by CORE
The Next Big Thing: How Generative AI Is Reshaping DevOps in the Cloud
December 20, 2024 by CORE
How to Test PATCH Requests for API Testing With Playwright Java
December 20, 2024 by CORE
December 20, 2024 by CORE