Home / Companies / Cockroach Labs / Blog / Post Details
Content Deep Dive

Tutorial: How to Build Low-Latency Flask App that Runs Across Multiple Regions

Blog post from Cockroach Labs

Post Details
Company
Date Published
Author
Eric Harmeling
Word Count
2,228
Language
English
Hacker News Points
-
Summary

Eric Harmeling's tutorial addresses the challenge of reducing latency in global applications by detailing the deployment of a low-latency, multi-region Flask app for MovR, a fictional vehicle-sharing company. The app, designed to serve a global customer base, leverages CockroachDB's multi-region capabilities and geo-partitioned replicas to minimize latency, utilizing Google Cloud's Kubernetes Engine for deployment across the US and Europe. By strategically deploying both the application and its database, the tutorial demonstrates significant latency reduction—from 150ms in a single-region setup to under 2.5ms in a multi-region configuration—highlighting the importance of proximity in data requests. The detailed implementation includes Python class definitions, SQLAlchemy transactions, and a backend API, with the full codebase available on GitHub for readers to explore through an end-to-end tutorial.