The weather is everywhere and always. That makes for a lot of data. This talk will walk you through how you can use MongoDB to store and analyze worldwide weather data from the entire 20th century in a graphical application. We’ll discuss loading and indexing terabytes of data in a sharded cluster, and optimizing the schema design for interactive exploration. MongoDB also natively supports geospatial indexing and querying, and it integrates easily with open source visualization tools. You'll earn high-performance techniques for querying and retrieving geospatial data, and how to create a rich visual representation of global weather data using Python, Monary, and Matplotlib.
35. Not terrifically fast
import numpy!
import pymongo!
!
data = []!
db = pymongo.MongoClient().my_database!
!
for doc in db.collection.find(query):!
data.append((!
doc['position']['coordinates'][0],!
doc['position']['coordinates'][1],!
doc['airTemperature']['value']))!
!
arrays = numpy.array(data)!
36. MongoDB-to-NumPy Performance
• Querying: 109k documents per second
• (On localhost)
• Can we go faster?
• Enter “Monary”
37. Monary
by David Beach
MongoDB PyMongo Python NumPy Matplotlib
dicts
MongoDB Monary NumPy Matplotlib