Today I worked out an example of using InfluxDB from Django in Docker. Using Docker containers to run databases greatly reduces the amount of database configuration you need to worry about when you’re trying to work out a proof of concept.
InfluxDB is a great tool for storing timestamped data. Storing a timestamp and a set of measurements, one timestamp per row, in a Postgres database is possible, but inefficient. InfluxDB offers you a way to store a set of values, and a set of indexed meta-data tags per row.
For example, if you’re collecting hourly production data from multiple wells, you can store the rates as data values, and wells as indexed tags. Then looking up the production from a set of wells over some time period becomes very efficient due to indexing. Looking up wells by production rates, however, would be very inefficient, unless you stored rate data as a tag, and well names as values. Learn more here from the InfluxDB documentation.
Continue reading Using InfluxDB with Django and Docker →
In a previous post I deployed a Flask app with Docker. This time around I wanted to see if it was any different to host a Django app. It turns out that it wasn’t that much different.
Continue reading Deploy a Django App with Docker →
I thought I’d show some examples of solving some common statistical word problems using Python. Today I’ll look at exponential random variables; this is a continuous random variable used to model the waiting time between independent events. Sometimes this is posed as the waiting time for the first event in a Poisson process.
Continue reading Exponential Random Variable Examples →
I think that using
make in Python development is a fantastic idea. Reproducing someone’s work is difficult, and using Makefiles minimizes that guesswork. I created a simple Makefile for a Docker project from a previous post
Continue reading Create a Makefile for Docker →
I wanted to understand how to host a simple Flask app inside a Docker container, so I went through the following exercise. In the future, I would use something more like the tiangolo/uwsgi-nginx-flask docker image.
Continue reading Deploy a Flask App with Docker →