Skip to content

Learning Resources

Derek Goss edited this page Apr 16, 2017 · 1 revision

If you are unfamiliar with the technology used in this repository or backend development in general, this page serves as a quick guidebook for important concepts, ideas, and technologies.

REST API

A web APIs (aka API, HTTP API, web service) are what allows computers to talk to each other, from servers across a data center to servers across the world, even the web browser you are using to view this comment. Representational state transfer (REST, aka a REST API) is one way to design such a web API, and currently a very popular one.

Beginner's Guide

Work/job/task Queue

When you click a button or do an action in a web browser, the server on the other end does a little bit of work. When power UIs, it only does a few milliseconds of work and returns a result quickly. For complex tasks, it takes more time, a web browser can't wait for minutes or hours. Complex tasks may also require a large amount of computational resources, like transforming 10k scanned documents into text. This is where task queues and task management comes in. It manages complex tasks and distributes them among many "workers" which are other servers, potentially thousands. Sometimes people use the term job or task, they are the same in this context.

Web Server

Traditionally a web application (ex. Django) will receive requests via a web server. When the user sends a request, the web server receives the request and can do things like reroute to other servers, limit the file size of requests, coordinate SSL/HTTPS, and more. Examples of these are nginx, apache, etc. Nginx is pretty popular in the python world.

WSGI

WSGI is a python-specific standard that bridges web servers and application servers. A "WSGI server" allows a web server and an application server to talk/interact. Examples of WSGI servers are uWSGI and Gunicorn.

Django

There are many ways to implement a REST API. Django is a python-based web framework that that makes building an "application server" (processing requests and returning responses) much simpler than doing it from scratch. This project uses Django REST Framework (see below) on top Django in order to serve Cognoma's REST API.

Django REST Framework

Django REST Framework is an add-on/package that you can add to Django, which allows you to easily implement what is called a REST (representational state transfer) API (application program interface). Some people only use Django to fill in HTML templates and return web pages to requests. However, if for example you wanted to interface with a phone application or if you want to allow developers to interact with your web application programmatically, a REST API created with the help of "DRF" (Django REST Framework) gives you a super flexible and powerful way to return data to user requests in a standardized and readable format (normally JSON). DRF puts many tools and libraries at your hand, and the project has extensive documentation. Here are two guides: one and two.

Clone this wiki locally