Architectural aspects of designing and developing web applications

Lecture



Architectural features of designing a web application

A web application consists of a client part and a server part, thereby implementing the «client-server» technology. Therefore, when designing it, it is necessary to build the architecture of both the backend and the frontend applications, each with its own specifics and its own stack of technologies and requirements.
Since the modern Internet is no longer just a means of demonstrating a company's presence on the market or a marketing tool, but rather a tool for doing business, tasks related to implementing customer relationships over the Internet — such as selling goods and services — become quite important for an organization. Here, solutions for «business-to-consumer» e-commerce (B2C) are very important.
Equally important are the tasks of integrating web applications with data and partner applications to implement a «business-to-business» (B2B) scheme, which makes it possible to conclude trade deals between enterprises, exchange product catalogs, hold auctions, and create electronic trading platforms. When designing and developing a web application, it must be taken into account that the web server should be able not only to run applications and interact with the application server, but also to use integration services, application and data management services, and developer services.
Also, besides access to corporate data and partner data, web applications may have access to corporate applications. To solve this problem of integrating web applications with enterprises' internal information systems and with applications that support interaction with customers and partners, special solutions called corporate portals are used. Website content management tools are often part of a portal solution — after all, the amount of data available to users through the sites of large companies and portals is now such that it is impossible to manage this data «manually».

Currently, an approach to web application development called SPA(single page application) and Ajax. When using Ajax, the pages of a web application are not reloaded entirely, but only load the necessary data from the server, which makes them more interactive and more performant. An SPA — is a web application or website that uses a single HTML document as a shell for all web pages and organizes interaction with the user through dynamically loaded HTML, CSS, and JavaScript, usually by means of AJAX.

Also, WebSocket technology has recently been gaining great popularity; it does not require constant requests from the client to the server, but instead creates a bidirectional connection in which the server can send data to the client without a request from the latter. This makes it possible to dynamically manage content in real time.

Developing a site's architecture is an important stage in the process of creating a site; it is thought through already at the stage of designing the future resource.

Site architecture is the structuring of the information located on the site, its layout, clarity, visual presentation, and how convenient it will be to use. In fact, it consists of the frontend and the backend.

The frontend architecture of a site includes elements such as text, headings, buttons, hyperlinks, navigation bars, feedback forms, and other components of the site.

Backend architecture consists of services that directly perform the functionality of the site and is implemented using software-and-hardware tools and a technology stack. (Docker, LEMP, LAMP, etc.)

A correct architecture makes it possible to create a convenient, understandable interface for site users, with the help of which finding the necessary information will not take any effort.

A feature of developing web applications is that ready-made frontend and backend frameworks must be used, and the application must have broad interaction with third-party APIs. Let's look at these features in more detail.

Developing the frontend architecture of a site

In the process of developing a site's architecture, the following points must be taken into account:

  • - site context
  • - target audience
  • - content
  • type of site (a site providing digital or offline services, or simply an informational one)

The context of a site is determined by the client's field of activity and business processes, its specific features, and the tasks it intends to solve with the help of the site being designed. The site should be aimed at attracting a larger number of clients and generating profit or promoting something.

The target audience consists of the site's main users. For these users a scenario is written out — the main actions they will perform when visiting the site. It is necessary to picture their goals and the paths to achieving those goals.

The content on the site must be interesting and useful to its target audience.

The content itself must be unique (texts, photographs, videos, styles, and design).

Having gathered all this information together, we then move on to creating a sitemap and planning the structure. Each page of the site must carry a specific semantic and functional load.

A site can consist of the following main pages:

  • - home page
  • - services
  • - company
  • - portfolio
  • - events
  • - contacts

The logical structure of the site is shown in Figure 1

it reflects the possibilities of navigational transitions between the pages of the site

Architectural aspects of designing and developing web applications

Figure 1 - logical structure of the site

Structure of a typical page (layout)

1. Site header

Your company logo, contacts, or the address where the office is located, and a menu with links to other pages should be placed in the top-left corner.

In the top-right corner is a phone number by which the company can be reached, and an "Order a call" button which, when clicked, brings up a feedback form. The feedback form consists of the fields required to be filled in: name, phone, email, . The look of the site header is shown in the figure

Architectural aspects of designing and developing web applications

Figure 2 - site header

Main form

Below is the main form, which calls the user to action. For example, the "Learn more" button takes an interested person straight to the services page, and the "Portfolio" button to the page with recent work, so that the user can see what the company has already done and what it offers. The feedback form prompts the user to fill in the necessary fields right away (name, email, phone) so that a company specialist can contact them and consult them on the questions they need. The look of the main form is shown in Figure 3.

Architectural aspects of designing and developing web applications

Figure 3 - main form

3. Company Advantages block

The advantages block explains the company's main strengths and why a user who visits the site should choose the "GIK" company specifically. The advantages block is shown in Figure 4.

Architectural aspects of designing and developing web applications

Figure 4 - advantages block

4. Reviews block

The "Reviews" block shows the latest comments and recommendations from clients who have worked with the "GIK" company. The block is shown in Figure 5.

Architectural aspects of designing and developing web applications

Figure 5 - reviews block

6. Footer block

The site's footer contains contacts that can be used to reach the company, a copyright notice, and links to feedback forms for any questions that arise. There are also links to social networks and the blog. The site footer is shown in Figure 11.

Architectural aspects of designing and developing web applications

Figure 7 - site footer

Site content must have a responsive web design

Responsive web design is web page design that ensures the correct display of a site on various devices connected to the Internet and that dynamically adapts to the given browser window size.

The goal of responsive web design is the universality of a website across different devices. So that a website can be conveniently viewed from devices of various resolutions and formats, the technology of responsive web design means there is no need to create separate versions of the website for individual types of devices.

For the site's design it is better to use a CSS framework, for example Twitter Bootstrap. Twitter Bootstrap is a free set of tools for building sites and web applications. It includes HTML and CSS design templates for typography, web forms, buttons, labels, navigation blocks, and other components of web interfaces, including JavaScript extensions. Bootstrap uses the most modern developments in the field of CSS and HTML.

The main advantages of Twitter Bootstrap:

  • - time savings - Bootstrap saves time and effort by using design templates and classes, letting you concentrate on other development work;
  • - high speed - Bootstrap's dynamic layouts scale to different devices and screen resolutions without any changes to the markup;
  • - harmonious design - all components of the Bootstrap platform use a unified style and templates by means of a central library. The design and layouts of the web pages are consistent with one another;
  • - ease of use - the platform is easy to use; a user with basic knowledge of HTML and CSS can start developing with Twitter Bootstrap;
  • - browser compatibility - Twitter Bootstrap is compatible with Mozilla Firefox, Google Chrome, Safari, Internet Explorer, and Opera;
  • - open source software - a feature of Twitter Bootstrap that provides ease of use through the openness of its source code and free download.

All elements of Twitter Bootstrap can automatically adapt to the screen size, which means that the site will be displayed correctly on various devices with different screen sizes.

The look of the site on the screen of various devices using this framework is shown in Figure 8.

Architectural aspects of designing and developing web applications

Figure 8 - responsive design

The look of the site on a mobile device is shown in Figure 18.

2 Backend architecture of the site


Architectural aspects of designing and developing web applications

1. DNS

DNS stands for «Domain Name System». This is a fundamental technology that makes the operation of the Internet possible. At the most basic level, DNS provides lookup for a pair consisting of a domain name and an IP address (for example, intellect.icu and 2.49.53.126), which allows a computer to send a request to the corresponding server.

When designing a site's architecture, it is necessary to decide on the name of the site and acquire a domain, or several domains, in advance

2. Site script storage (hosting) and the load balancer used for high-load and fault-tolerant projects

Before starting a discussion of load balancing, we need to take a step back and discuss horizontal and vertical scaling of applications. What is it and what's the difference? «Horizontal» scaling is characterized by adding new machines to the resource pool, whereas «vertical» scaling means increasing the capacity (for example, increasing the CPU or RAM) of an existing machine.

In web development, a project scales horizontally at the very least because everything breaks. Servers go down for unclear reasons. Networks degrade. In some data centers the power goes out from time to time. Having several servers makes it possible to survive unplanned outages without disrupting the application's operation. In other words, the application becomes «fault-tolerant». Horizontal scaling makes it possible to minimize coupling between different parts of the project (the web server, the database, etc.), because each of them runs on a different server. Finally, a moment may come when vertical scaling is no longer possible, because there is no computer in the world powerful enough to perform all of the application's computations.

Thanks to them, horizontal scaling is possible. They direct incoming requests to one of many application servers, which are usually mirror copies of each other, and send the response back to the user. Any server handles requests in the same way, so the balancer takes care of distributing the workload so that none of them gets overloaded.

When designing a site's architecture, it is necessary to decide whether a load balancer will be used in cloud hosting or collocation or on dedicated hosting or on a VPS or on a VDS, or whether it will be your own server with an uninterruptible power supply).

3. Web application servers and the server-side technology stack

From a distance, web application servers are relatively simple. They perform the core business logic that processes a user request and sends HTML back to the browser. To do their job, they typically communicate with various backend infrastructures, such as databases, caching servers, job queues, search services, and so on. As mentioned above, there are usually at least two, if not more, servers connected to a load balancer to handle user requests.

To implement an application server, you need to choose a specific language (Node.js, Ruby, PHP, Scala, Java, C#, .NET, etc.) and an MVC framework for that language (Express for Node.js, Ruby on Rails, Play for Scala, Laravel for PHP, etc.).

When designing a site's architecture, it is necessary to decide whether a web server will be used and which one or ones

  • LEMP — Nginx instead of Apache (Nginx is pronounced Engine-X)
    • LNMP — another variant of the name 'Nginx instead of Apache'
  • LLSMP - Linux, LiteSpeed, MySQL, PHP
  • BAMP — BSD instead of Linux
  • MAMP — Mac OS X instead of Linux.
  • SAMP — Solaris instead of Linux
  • WAMP — Microsoft Windows instead of Linux
  • WASP — Windows, Apache, SQL Server, and PHP
  • WIMP — Windows, IIS, MySQL, and PHP
  • PAMP — Personal Apache MySQL PHP — a server bundle for the S60 platform. The specifics of the platform leave their mark on how the bundle works. In particular, PHP modules receive and return strings only in UTF-8 encoding.
  • FNMP FreeBSD and Nginx instead of Linux and Apache.

4. SQL and NoSQL database server (DBMS)

Every modern web application uses one or more databases to store information. Databases provide tools for organizing, adding, searching, updating, deleting, and performing computations on data. In most cases, web application servers communicate directly with job servers. In addition, each backend service may have its own corresponding database, isolated from the rest of the application.

SQL stands for «Structured Query Language». SQL databases store data in tables that are linked to one another by shared keys. Such keys are usually represented by integers.

NoSQL means «not only SQL» and represents a newer set of database technologies. It was developed to handle the very large volumes of information that can be generated by large-scale web applications. Most SQL implementations scale poorly horizontally, and can only scale vertically up to a certain point

When designing a site's architecture, it is necessary to decide whether a DBMS will be used and which one

5. Caching (four levels of caching on the network: client-side, network, server-side, and application-level)

A caching service provides a simple key-value data store that allows information to be stored and looked up in close to linear time (O(1)). Applications typically use caching functions to save the results of expensive computations and reuse them later from the cache instead of recalculating them again. An application can cache the results of database queries, the results of calls to external services, HTML for a given URL, and much more. Here are some real-world examples:

  • Google caches search results for popular search queries, such as «how to make a million dollars» or «which real estate is better», instead of searching for them again every time;
  • Facebook caches most of the data you see when you log in, for example lists of posts or friends. More details on the caching technology used at Facebook;

When designing a site's architecture, it is necessary to decide whether a cache will be used and at which levels

6. Task queues

Most web applications need to perform some work that is not directly related to responding to user requests, asynchronously, in the background. For example, Google needs to crawl and index the entire Internet in order to return relevant search results. It does not do this on every request, but instead crawls the web asynchronously, updating the search indexes «along the way».

Different architectures make it possible to perform asynchronous work, but the most common is the «task queue» architecture. It consists of two components: a queue of «jobs» that need to be performed, and one or more worker servers (often called «workers») that process jobs from the queue.

Task queues store lists of jobs that need to be performed asynchronously. Whenever an application needs to perform some task that must run on a schedule or in response to a user action, it adds that task to the queue. FIFO queues are the simplest to organize — «first in, first out» — but most applications eventually need some kind of queue balancing system.

For example, you might need a task queue to perform many hidden jobs needed to maintain a project: sending emails or notifications, exporting or importing or synchronizing data, indexing internal search, optimizing images, encoding video, aggregating user statistics, and so on. A project can use either a simple FIFO queue or a priority queue, so that operations with more important actions are performed as quickly as possible, such as sending password-reset notifications.

Job servers execute jobs from the queue. They poll it to determine whether there is work to do, and if there is — they start executing it.

7. Full-text search

Many web applications have a search function over text input (often called a «query»), in which the application returns the most «relevant» results. The technology behind this feature is usually called «full-text search» and uses an inverted index to quickly find documents containing the query's keywords.

Architectural aspects of designing and developing web applications

In this example, three document titles are converted into inverted indexes, which makes it easier to search for a given keyword among the documents whose title contains that keyword. Note that common words, also called stop words («in», «the», «with», etc.), are usually not included in the inverted index.

In practice, full-text search can be performed directly from some databases (for example, MySQL supports it), but it is usually common to run a separate service that computes and stores the inverted indexes and provides an interface for queries. The most popular full-text search platform today is Elasticsearch, although there are other options such as Sphinx or Apache Solr.

8. Services and microservices

When an application reaches a certain scale, certain «services» typically emerge, built specifically to run as separate applications. They are not exposed to the public, but the application and other services interact with them. For example, these might include:

  • an account service that stores user data for all of the company's sites, which allows cross-site functionality and creates a more unified user experience;
  • a content service that stores metadata for video, audio, and images, and also provides interfaces for uploading content and viewing upload history;
  • a payment service;
  • a statistics service.

9. Data storage

Working with data goes through three main stages:

  1. The application sends data to a «firehose» store, which provides a streaming interface for ingesting and processing data. This is typically information about user actions. Often, raw data is transformed or enriched and passed on to other «firehose» stores. The most common technologies for this process are AWS Kinesis and Kafka.
  2. The original data, as well as the finally transformed and enriched data, is stored in cloud storage. AWS Kinesis offers a service called Firehose, which lets you save raw data to cloud storage (S3), and it is extremely simple to set up.
  3. The transformed and enriched data is loaded into a data warehouse for analysis. A typical example is AWS Redshift, used by most startups, although larger companies prefer solutions from Oracle or other proprietary storage technologies. If the datasets are large enough, a NoSQL MapReduce technology such as Hadoop may be required for analysis.

The diagram does not show one more step: loading data from the application and the databases of various services into the warehouse. For example, every night Storyblocks loads VideoBlocks, AudioBlocks, Storyblocks, the account service, and the developer portal databases into Redshift. This gives analysts a unified view, since the core business data and user action data are stored in the same place.

10. Third party APIs

Third-party APIs are APIs provided by third parties — typically companies such as payment systems from PrivatBank or Visa, Facebook, Twitter, Google — so that you can access their functionality on a paid basis

There are many third-party APIs; some of the most popular ones that you will sooner or later end up using include:

  • the Twitter API for adding functionality such as showing recent tweets on a website.
  • the Google Maps API for working with maps on a web page (interestingly, Google Maps itself also uses this API). It is now a whole family of APIs that can handle a wide range of tasks, as shown by the Google Maps API Picker.
  • the Facebook API suite lets you use various parts of the Facebook platform in your application, providing, for example, the ability to log in with a Facebook account, pay for in-app purchases, display targeted ads, and so on.
  • the YouTube API, which provides the ability to embed YouTube videos on your site, perform searches, create playlists, and so on.
  • frameworks for embedding voice and video call functionality in your application, sending SMS/MMS from the application, and so on.
  • systems for collecting and analyzing site traffic statistics
  • online payment systems

11. CDN

Architectural aspects of designing and developing web applications

CDN stands for «Content Delivery Network» (content delivery system). This technology makes it possible to deliver static HTML, CSS, JavaScript files and images much faster than from the origin server. It distributes content from many «edge» servers around the world, so that users load various resources from them instead of from the origin server. For example, in the image below a user from Bananashiki requests a web page from a site whose servers are located in Pomidorovo, but the static resources for that page are loaded from a «edge» CDN server in Apelsinovo, avoiding long transatlantic HTTP requests.

3. Site design. Why is design needed?

  1. Increases the likelihood of achieving the desired look of the resource. A clear statement of objectives, defining the target audience, and modeling user journeys can produce the desired development outcome.

  2. Saves time and money. Fixing inaccuracies during the creation of a site prototype is a simple process, it is enough to change a few text or graphic fragments. Doing the same at the layout stage will be much longer and more expensive. And for a programmer, such fixes will be even more labor-intensive.
  3. Logically separates the work. The site prototype is a standalone document, on the basis of which the client can already build the site, either on their own or with the help of another development team.Architectural aspects of designing and developing web applications

Stages of website design


The development order is determined depending on the type, scale, and needs of the project. It will differ somewhat for developing mobile applications, embedded software, automation solutions, or a regular website, but the general sequence of actions for creating software is universal:

Architectural aspects of designing and developing web applications

1. Preparation and creation of the site concept

At the stage of developing the site concept, it is necessary to form an ideological basis and agree on the direction of development with the client. Developing the site concept provides feedback on whether you (is this the site you need) and the development team share a unified vision of the project. The resulting concept must clearly answer the question of whether it is the best solution to the tasks at hand. We also take into account the emotional response of the target users.

In summary, the concept must answer the following questions:

  • the goals of the resource;

  • the target audience;

  • the site's functionality;

  • the main content of the resource;

  • ways of monetizing the site;

  • positioning and unique characteristics of the resource;

  • mechanisms for development after launch.

2. Designing the structure and architecture of the site

Loyalty largely depends on how well the design of the new site's graphical interface matches users' mental model – their expectations. Therefore, it is necessary to establish an arrangement of the site's pages relative to one another such that this structure is intuitively understandable to users. Developing the site structure involves two levels: internal and external. The internal structure defines the logical relationship between pages and depends on the UX design. It is also shaped by the external structure (site navigation).

At this stage, the information structure is also developed, that is, the scheme of the resource's sections and navigation. Ideally, the section scheme includes the following elements: tasks, parts of the functionality, and user behavior scenarios.

At the same time, it is necessary to determine, at a conceptual level, what the front-end and back-end architecture of the site will be.

​Zeplin, Figma, or just on a piece of paper))

3. UI design of interfaces: designing the site's look

Design is the second most important component of a product after technical characteristics, affecting the efficiency and speed of the user's interaction with it. Design requirements are defined by the specification — as a rule, simplicity, intuitiveness, and minimal effort to perform an action (achieve a result) are important, as well as beauty and consistency with the company's and/or product's style.

Creative design of websites provides a pleasant and simple human-computer interaction experience. The UI designer relies on the UX designer's recommendations, trying to convey as much ease of working with the site as possible. At this stage, emotional response plays the main role in deciding in favor of one design or another. In doing so, we rely not on our own subjective impressions, but on an analysis of the site's target audience.

4. Technical specification for site development

The result of interface design is a detailed technical specification for the development of the website, accompanied by references and mockups. Why is this so important? Designing the structure and interface of the future site is not just a sketch of the future design. It is careful planning of a system that will function successfully and become convenient for both users and search engines.

It makes sense to include in the specification:

  • software requirements;

  • technology requirements for specific tasks;

  • design requirements, or artistic styling;
  • expected load.

In essence, the specification answers all of the site developer's questions. It is a fairly extensive document describing the future functioning and appearance of the system. The specification must be approved by the client and remains unchanged until the end of development.Architectural aspects of designing and developing web applications

The technical specification must include a section on site functionality (features)

They are conveniently described either as a table similar to a responsibility (authority) matrix, or using a UML use-case diagram

«Feature» is a popular concept with a long and varied history (including as part of the Rational Unified Process (RUP), Feature-Driven Development (FDD), the Scaled Agile Framework (SAFe), etc.), and unfortunately it is defined and applied differently each time (for example, http://www.jot.fm/issues/issue_2009_07/column5/ lists 10 different definitions). In general, and roughly speaking, a feature tends to be something meaningful and independent — something that could be stated «on the back of the box» (or in a brief app description in an app store), and this is the general sense in which I use it here. Note that features in SAFe have a very specific meaning and play a very specific role in that framework

Use case UML

Architectural aspects of designing and developing web applications

Figure 1: A use case allows a type of user (an actor) to achieve a goal (and, consequently, obtain value)

There are two different directions in which we can start «slicing» — horizontal or vertical.

An obvious way to split such a use case vertically into «steps», for example, as shown below:

Architectural aspects of designing and developing web applications Figure 2: Defining smaller «steps toward achieving value» in a usage scenario

Architectural aspects of designing and developing web applications

Figure 3: Use case slices are end-to-end paths through the use case, drawn from a subset of the scenarios.

Architectural aspects of designing and developing web applications

Figure 4 Example of a UML use case

Architectural aspects of designing and developing web applications

Figure 5 Example of a UML use case

Architectural aspects of designing and developing web applications

Figure 5 Example of an authority matrix and features

5 Coding or implementation

Coding, or implementation, is the part of the work usually associated with software development as such. It is important that the code be sufficiently optimized, concise, and understandable. Programmers who specialize in the languages selected to match the specifics of the task in the specification are assigned to this work.

6 Testing

It is best to carry out testing at every stage of development, and it includes a range of tests according to a test plan customized to the project's specifics at the stage of drawing up the technical specification. Testing results are documented and available to the client in real time. Payment for the product is made only after passing all types of tests, including client-side ones.

7 Documentation

— a procedure that records the plan, process, and outcome of software development. It includes all source information (specification, mockups), plans for work, costs, and testing, the list of tasks assigned to each contributor at any given time, progress reports, and so on. Documentation is necessary for the quick and accurate identification of errors, for transparency of joint work, and as a mandatory legal part of the contract.

8. Support, deployment, and maintenance

Software deployment is the process of configuring the software for specific conditions of use, as well as training users to work with the software product.

Maintenance (support) of software and websites is the process of improving, optimizing, and fixing defects in them, or adapting them to a changing environment after they are put into operation. Maintenance is one of the phases of the software life cycle that follows the phase of putting the software into operation. During maintenance, changes are made to the program in order to fix defects and shortcomings discovered during use, as well as to add new functionality, with the goal of improving usability and the applicability of the software.

Features of website design

  1. During the development of a site prototype, it is important to maintain a consistent style for the design of elements.

  2. In order to build a site prototype, it is necessary to develop its structure, clearly indicating the hierarchy of blocks, sections, and subsections.

  3. It is not recommended to create similar pages if it is possible to place the same information on one page. For example: contact information is placed either in the «about the company» section or in the page footer, so it simply does not make sense to allocate a separate page for it.
  4. If the functionality of one block duplicates the functionality of another, it is better to remove it, since duplication confuses the resource's users.
  5. When creating a site prototype, it is important to define the user's path to the most important sections of the site.
  6. Creating a site prototype involves creating a scheme of the main pages with their priority. For example, if a company does not plan to post news often, there is no point in laying out a separate page for it

See also

  • Software development
  • Software architecture
  • programming language paradigms
  • SEO, SMM, site promotion, digital marketing
  • UML use-case diagram
  • minimum viable product (MVP)
  • Scrum, Kanban and SAFe
  • [[b9246]]
  • [[b7884]]
  • SPA(single page application)
  • Ajax
  • web application
  • WebSocket
  • Docker
  • LEMP,LNMP,LLSMP,BAMP,MAMP,SAMP,WAMP,WASP,WIMP,PAMP ,FNMP
  • hosting, collocation, dedicated , VPS , VDS , load balancer
  • microservice
  • back end, front end
  • site usability, user interface
  • [[b5820]]
  • [[b11050]]
  • [[b11062]]
  • [[b5894]]
  • [[b5895]]
  • [[b889]]
  • [[b9]]
  • [[b6486]]

See also

Comments

To leave a comment

If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Lectures and tutorial on "Informatics"

Terms: Informatics