Application example – Overview
In this book, we will be using an application as an example to demonstrate the different elements and patterns presented. This application will be simple but divided into different elements for demonstration purposes. The full code for the example is available on GitHub, and different parts of it will be presented in the different chapters. The example is written in Python, using well-known frameworks and modules.
The example application is a web application for microblogging, very similar to Twitter. In essence, users will write short text messages that will be available for other users to read.
The architecture of the example system is described in this diagram:
Figure 1.2: Example architecture
It has the following high-level functional elements:
- A public website in HTML that can be accessed. This includes functionality for login, logout, writing new micro-posts, and reading other users' micro-posts (no need to be logged in for this).
- A public RESTful API, to allow the usage of other clients (mobile, JavaScript, and so on) instead of the HTML site. This will authenticate the users using OAuth and perform actions similar to the website.
These two elements, while distinct, will be made into a single application, as shown in the diagram. The front-facing part of the application will include a web server, as we saw in the LAMP architecture description, which has not been displayed here for simplicity.
- A task manager that will execute event-driven tasks. We will add periodic tasks that will calculate daily statistics and send email notifications to users when they are named in a micro-post.
- A database that stores all the information. Note that access to it is shared between the different elements.
- Internally, a common package to ensure that the database is accessed correctly for all the services. This package works as a different element.