DEV Community

chetan venkatesh
chetan venkatesh

Posted on

Building a low latency, globally distributed Python app using Macrometa's geo-distributed database cloud

In this tutorial Im going to show you how to quickly and easily build a distributed database backend that spans across North America (Los Angeles & Ashburn VA), Europe (Frankfurt) and Asia (Mumbai, India).

We're going to build simple python application on Macrometa's serverless geo-distributed database cloud (https://www.macrometa.co) to create a data serving backend that will span across multiple worldwide data centers.

This is so that when end users run your app, it doesn't need to fetch data from a database that is thousands of miles and hundreds of milliseconds away but instead gets its data from the closest running database in a region closest to it.

So if you're wondering what Macrometa is? Macrometa is a geo-distributed database cloud service and available for free for developers to build apps on. Macrometa provides the following capabilities:

  1. A Serverless real time noSQL geo-distributed database that serves data as Key/Value pairs, JSON Documents, Streams, Graphs and time series. The geo-distributed bit is important here because that what makes Macrometa special - it can very efficiently, quickly and accurately replicate and synchronize your data across 100s of worldwide locations while hiding the complexities in providing correct concurrent behavior.

  2. A fully integrated Stream engine to let you query and manipulate data in motion without needing to wait for it to be ingested into the database (I will do a separate tutorial on this in a few days)

  3. A serverless compute runtime that provides a Web Assembly in V8 engine for you to run your code with hyper-locality to your data (this will be coming out in the second half of 2019 and is not in the currently available product)

learn more at https://www.macrometa.co

So with that background - let's dive right in.

There are 2 ways to do this tutorial:

  1. For those who want to code - the repl.it below is for you. You can see how to build a simple application to call Macrometa's APIs in Python to do interesting things.
  2. For those of you who prefer a web console or GUI - go to https://www.macrometa.co/quickstart

Building an application consists of 3 basic steps:

  1. Create a geo fabric or use the global fabric
  2. Create a collection for your data (a collection is like a table in SQL)
  3. Send queries to CReate, Update, Delete (CRUD) documents (rows) in your collection

Top comments (0)