Skip to content

Architectural Requirements

Ryan Trickett edited this page Jun 27, 2023 · 11 revisions

Quality Requirements

  • Performance: Responsive for most user devices
  • Security: Data stored securely and encrypted where necessary
  • Privacy: The app must adhere to privacy regulations
  • Availability: Minimal downtown
  • Reliability: All actions performed by the user perform the results intended
  • Usability: Natural user experience, where new users easily understand the application
  • Maintainability: The app should be modular for easy updates and modifications
  • Scalability: Able to handle a high volume of concurrent users without slowdown
  • Compatibility: Usable across most user devices

Architectural Patterns

  • Three-tier: Enhance performance by distributing the workload across multiple tiers, allowing for efficient scaling and improved resource utilization. Additionally, it promotes modularization, enabling the optimization of each tier independently, leading to better overall system performance.
  • Service-oriented: Enhances reliability by enabling fault isolation and containment, ensuring that failures in one service do not impact the entire system. Furthermore, SOA supports the implementation of redundancy and failover mechanisms, allowing for seamless service continuity and improved overall system reliability.
  • MVC: Enhances usability by providing a clear separation of concerns, allowing for independent development and maintenance of the user interface (View) and the underlying data and business logic (Model). This separation simplifies the design process, making it easier to create intuitive and user-friendly interfaces.
  • Publish-subscribe: Improves usability by decoupling components and enabling asynchronous communication. This decoupling allows for flexible and modular design. Furthermore, PubSub facilitates real-time updates and event-driven interactions, enhancing usability by providing timely and responsive feedback to users.
  • Component-based Development: Enhances compatibility by promoting the reuse of modular components across different systems and platforms. This approach ensures that components can be easily integrated into various environments, reducing compatibility issues and enabling seamless interoperability. Also, allowing for the encapsulation of complex functionalities within self-contained units, making it easier to update or replace individual components without disrupting the overall system compatibility.
  • Database-centric: Prioritizes privacy by implementing privacy controls and encryption mechanisms directly at the data level, data-centric architectures can safeguard personal information, providing granular control over access and reducing the risk of unauthorized disclosure.

Design Patterns

  • Observer Pattern: This pattern is used to model the changing state of the Profile state, and to alert necessary parties affected by the Profile state.
  • Command Pattern: This pattern is used to model 2 sub-systems, namely: (1) Authentication and (2) Recipe Recommendation sub-systems
  • Strategy Pattern: This pattern is used to model the Search sub-syste; being able to search by different type of methods
  • Factory Method Pattern: Used to model the creation of recipes.
  • State Pattern: This pattern is used in conjuction with the Factory Pattern to know for which dietary plan to create a recipe; The states are then the various dietary plans
  • Decorator Pattern: This model the functionality of Review and favourites; these are the add-ons added as the recipes are viewed or displayed
  • Proxy Pattern: This pattern is used to model the manner of access to the database, which is through the APIs
  • Façade Pattern: This provides a gentle user interface and seamless user experience.
  • Singleton Pattern: This is used to model the Database; only a single instance of the database should be running when the system is operational
  • Memento Pattern: This pattern is used to model the data persistence in the database and how much is handled.

Constraints

  • Users Hardware Resources: Seeing as this application is a web app it should be light on users' system resources to allow different devices to access the application effectively.
  • AWS Client: As our client AWS ensures that we use their architecture for the deployment and execution of background resources.
  • Open Source: Our client specified that all code must be open source, meaning all libraries must be open source.
  • Cost: The system and all its infrastructure must have a total cost of less than $50 for the entirety of development and distribution.

Technology Choices

Frontend

Angular:

  • Overview: A feature-rich JS framework with TypeScript, enhancing productivity and code organization. Robust ecosystem and community support. Steep learning curve. Larger bundle sizes are suitable for complex apps and smaller projects.
  • Pros: Comprehensive set of tools and features, and active community support
  • Cons: Steep learning curve, and large bundle sizes

React:

  • Overview: A popular JavaScript library for building user interfaces, focusing on component-based development and virtual DOM rendering. React enables efficient UI updates, reusability, and scalability. It has a large community and ecosystem with extensive support and resources.
  • Pros: Component-based architecture promoting reusability and modular development, efficient virtual DOM rendering for optimized UI updates, and active community
  • Cons: Steeper learning curve for beginners, and React is a library and may require additional configuration and integration with other tools for a complete development stack.

Ionic:

  • Overview: Ionic is a popular open-source framework for building cross-platform mobile applications using web technologies such as HTML, CSS, and JavaScript. It provides a library of pre-designed UI components and tools for app development and deployment.
  • Pros: Rapid cross-platform mobile app development using web technologies, pre-designed UI components for native-like appearance, and simplified development with live-reload and easy deployment options.
  • Cons: Potentially slower performance than fully native apps, and limited access to device-specific features, requiring additional plugins or custom development.

Backend

NestJS:

  • Overview: TypeScript-based framework for scalable server-side applications. Utilizes decorators and dependency injection for modular development. Built-in support for GraphQL and WebSocket.
  • Pros: TypeScript-based, scalable and maintainable applications, modular development with decorators and dependency injection, and built-in support for GraphQL and WebSocket.
  • Cons: Requires familiarity with TypeScript and server-side concepts, has a smaller community compared to some frameworks.

Spring Boot:

  • Overview: Java-based framework for enterprise-grade applications. Extensive libraries and tools for rapid development. Dependency injection and robust security.
  • Pros: Java-based, extensive libraries for rapid development, and dependency injection with robust security features.
  • Cons: Complex configurations and boilerplate code, can have a large memory footprint.

Django:

  • Overview: Python-based web framework known for simplicity and productivity. Provides ORM, authentication, and admin interface.
  • Pros: Python-based, simplicity and productivity, and built-in ORM, authentication, and admin interface.
  • Cons: Limited scalability for high-traffic apps, may lack performance compared to lower-level frameworks, and relies heavily on Django's conventions, limiting flexibility.

Database

MySQL:

  • Overview: MySQL is a popular open-source relational database management system. It offers a robust and scalable solution for managing structured data. MySQL is widely used in various applications, providing reliability, ACID compliance, and comprehensive SQL support.
  • Pros: Open-source and widely adopted, reliable and ACID-compliant for data integrity, strong community support, and comprehensive SQL capabilities for complex querying and data manipulation.
  • Cons: Requires manual configuration and maintenance, limited scalability compared to some NoSQL databases, and may have performance limitations for highly concurrent workloads.

AWS RDS (Relational Database Service):

  • Overview: AWS RDS is a managed database service that simplifies the deployment and management of relational databases. It offers support for various database engines like MySQL, PostgreSQL, and Oracle. AWS RDS provides automated backups, scalability, and high availability.
  • Pros: Fully managed service, reducing administrative overhead, automated backups and patching, and scalability and high availability options.
  • Cons: Vendor lock-in with AWS, limited control over the underlying infrastructure, and additional costs for certain features and resources.

AWS DynamoDB:

  • Overview: AWS DynamoDB is a fully managed NoSQL database service. It provides high scalability, low latency, and automatic scaling to handle varying workloads. DynamoDB is designed for applications needing fast and flexible storage for unstructured or semi-structured data.
  • Pros: Fully managed, scalable, and highly available, with low latency for quick data retrieval, and flexible schema and easy scalability.
  • Cons: Query flexibility is limited compared to SQL databases, has a higher cost compared to self-managed databases, may require additional effort for complex data modeling, and the eventual consistency model may require careful design.

Final Tech Stack

Using Angular, Spring Boot, and DynamoDB as an application tech stack offers several benefits. Angular, with its robust framework, facilitates PubSub, MVC, and Component-based development. It provides a structured approach to building scalable and maintainable web applications, ensuring efficient data flow and component reusability. Spring Boot, on the other hand, supports Service-Oriented Architecture (SOA), enabling the development of loosely coupled and independently deployable services. It simplifies the creation of backend services, promotes modularity, and facilitates communication between different components of the application. DynamoDB, being a data-centric NoSQL database, ensures efficient storage and retrieval of data, aligning well with the data-centric approach. It offers high scalability, low latency, and flexible schema, making it suitable for applications that prioritize data-driven functionalities. Together, this tech stack allows the building of highly performant, scalable, and modular applications with a focus on efficient data handling and seamless communication between frontend and backend components.

  • Frontend: Angular
  • Backend: Spring Boot
  • Database: DynamoDB

Clone this wiki locally