Building AI-Powered Applications (Part 1 - Architecture)
25/01/2024 Version 1.0
Pivoted to a new architecture using .NET Aspire and Azure Container Apps, this post is still very important and will set content, follow the link for the next post: https://keithtobin.cloud/viewpost/30
Introduction
In the realm of digital technology, a significant shift is occurring. We're transitioning from traditional methods of application development to an era where Artificial Intelligence (AI) plays a pivotal role in enhancing every aspect of application architecture, design, and development. This evolution offers an enriched user experience and introduces smarter, more intuitive application features.
To demonstrate the potential of AI in application development, I embarked on a project to create an AI-driven blog application. This post is hosted on this platform, leveraging AI for development and user experience features. The primary objectives are:
Concept and Goals
- 1. Illustration of AI Integration: To showcase how AI can be integrated into applications to enhance functionality and management.
- 2. Real-world Application: To explore AI features in practical scenarios over the coming months
Application Architecture
This section is a high-level overview of the application architecture, and in the next section, we will look at the AI components that set this application apart from traditional applications. My design goals for this blog application are to use the latest enterprise technologies and Azure services in the application design and architecture to minimize complexity and increase availability and reliability while minimizing cost. I also wanted to address security up front in the design
and architecture and have an infrastructure and application design that addressed standard security threats we will encounter in the wild.
The application design uses a Clean Architecture approach; you can read more
about clean architecture here. I have chosen technologies that reduce complexity by reducing the skills required to design, architect, build, and support large enterprise applications. One such technology choice is the
use of Microsoft Blazor; Microsoft Blazor enables us to focus on writing mature
typed C# code with a mature set of development tooling, libraries, and support
from Microsoft. Later in this series, I will dive deeper into the many reasons for choosing to use Microsoft Blazor.
While developing the web application's user interface, I utilized Google's Material Design principles, recognizing the extensive
groundwork already laid out in this domain. This strategic decision was
primarily to circumvent the unnecessary task of creating something anew in 2023. Material Design, known for its comprehensive blueprint of visual aesthetics and user experience frameworks, is an ideal foundation.
I integrated the MudBlazor library into the project to implement these design principles. MudBlazor is renowned for its adherence to
Material Design guidelines, particularly in constructing its user
interface components and overall user experience design. This library proved to be a vital asset, allowing me to channel my energies toward the core functionalities of the application rather than expending resources on the intricate aspects of UI design and UX considerations.
By leveraging such established design systems and tools, I ensured a
seamless and intuitive interface for users while simultaneously streamlining
the development process. This approach maximized efficiency and guaranteed design sophistication and user engagement that aligns
with contemporary web application standards.
Deciding on the technology stack for the data access layer (DAL), I opted
for the Entity Framework, coupled with an encrypted Azure SQL Database as the
backend database. The Entity Framework stands out due to its maturity and exceptional ability to abstract database complexities, yet it retains
sufficient flexibility to cater to specific needs. This framework aligns
seamlessly with the principles of clean architecture, consolidating all database models within a single, cohesive library. The encrypted Azure SQL Database is a robust and dependable foundation on the backend. It offers solid performance and high availability and
reliability, essential qualities for any scalable system. This combination
supports an agile and resilient architecture, facilitating
efficient workflows and ensuring that the system can adapt and expand in
response to evolving requirements.
Azure blob storage is used for dynamic image content, with CloudFlare acting
as a safe and DDOS-resistant CDN. CloudFlare is also used for DNS, and this means that the entire solution is extremely resistant to DNS DDOS attacks; in fact, attempting to perform DDOS on the DNS will not work due to the way CloudFlare has designed and architected the DNS solution. CloudFlare is also used on the front end to protect the services from attacks and to offload and absorb DDOS
attacks. The front end is also protected using WAF to inspect L7 requests and
provide another layer of protection.
In this blog application, I will use the following AI capabilities: LLM for the assistance of content creation, both text and image and semantic search on content to add the ability to chat with the blog site. These capabilities will
be added in the coming weeks and months, and I will create further posts
to this series.
AI Application Management
The other goal of this blog application is to create a management
layer to demonstrate how we can use AI to manage our
application, cloud, and IT infrastructure. The application monitoring layer
provides performance, logging, and security information. The AI system creates
dynamic alarms based on the guidance provided and current requirements. Alarms on key
indicators cover application internal, frameworks, supporting systems, and
infrastructure. The AI system will be capable of dynamically adding, removing,
or adjusting critical indicator alarms as required based on knowledge about the
system, current state, etc. The AI system will manage the creation and resolution of issue tickets by performing diagnostic and creation resolution plans that can be reviewed by a human and executed to resolve issues. The
operation can be intelligently automated using AI, with human oversight. The goal is to enable humans to focus on the most important tasks and also for AI to manage and operate both the application and infrastructure.