Ralph Barbagallo's Self Indulgent Blog

I'm from the future.

Archive for the category “coding”

App Engine Geospatial Datastore Search: A New Way!

One of my pet peeves with Google App Engine is its horrible support for geospatial indexes. Although you can store a GeoPt in the Datastore, you can’t really query it. You can use various hacks such as Geomodel, but they end up being slow and potentially expensive.

Last year Google released the beta API for Google App Engine search. This lets you search documents for text, HTML, numbers, dates, and location. However, it searches documents instead of datastore entities.

If documents are separate from your datastore, how do you use the new search API to do geospatial queries on your database? Simply store the location for each entity inside a document instead. To do this, make a document with a GeoField with the location and a string that contains the id of the associated datastore entity’s key (this code is based on Google’s own location example):

key = str(entity.key())
geopoint = search.GeoPoint(lat, lng)
index = search.Index(_INDEX_NAME)
document = search.Document( fields=[search.TextField(name='key', value=str(key)),
                                                    search.GeoField(name='loc', value=geopoint)])
search.Index(name=_INDEX_NAME).put(document)

Note that you have to store the key’s id as a string since you can’t store a long in a document.

Now, when you perform a geolocation search like this:

index = search.Index(_INDEX_NAME)
query = "distance(loc, geopoint(" + str(lat) + "," + str(lng) + ")) < 1000"
     
try:
     results = index.search(query)
     for doc in results:
         logging.info('Document! ' + str(doc.field("key")))
except search.Error:
     logging.exception('Error!')

You can grab the id field from the document and query the datastore for it to get the rest of your data.

There are several problems with this method. First, it doesn’t work on the local dev_app_server. Currently, GeoField searches only work on the appspot production servers. Also, because the API is in beta you are restricted to the free quotas which don’t allow for very many operations. Finally, when Google reveals pricing changes, it can have disastrous results. It’s very risky to build an app using this method when you have no idea how much it costs.

At least it works! It’s still a mystery to me why they can’t add this feature to the datastore itself.

Donut Vision: Google App Engine Experiments 2

Some (well, very few) of you may remember my previous post on Google App Engine. Developing a GAE app using JSP was a trip down memory lane, using a technology that has seemingly been left unchanged since 2001.

I recently began a project that involves using Vine and Twitter to sort through video clips. I decided to build on Google App Engine again. This time I’m using Python. My initial hacking has resulted in Donut Vision–a search portal for donut videos on Vine. Hey, don’t laugh. These guys are trying to build an actual business off of the same type of sites–Presumably with cokehead money.

Using Python (GAE’s original language) has been an absolute pleasure. On GAE, it really does seem much faster than using Java. GAE’s built in webapp2 framework and Django templates make building sites and APIs a breeze. I swear not having to type brackets has given me some kind of minor productivity boost–Or not. But placebo is a real thing.

My general “get off my lawn” nitpicks with Python are mostly due to it being a weird hybrid of a dynamic language, yet strongly typed. This gives PyDev in Eclipse a problem performing autocomplete since it really doesn’t know what type you’re referring to in most cases. PyDev and Eclipse is a decent combination due to the convenience of deploying to GAE within the IDE. I’d switch to something else with better autocomplete support, though.

As for the details of how this works, it’s really pretty simple. There’s no Vine API yet, so I simply use the Twitter API to search for Vines with relevant hashtags and pull the URLs out of them. Originally I was using Vine’s new embed code to display videos, but I eventually resorted to grabbing the URL of the MP4 file in the S3 bucket it’s stored in to have more control over the video when playing it with video-js. I expect Vine to shut down this method since I’m just running up their AWS bill with no benefit to them–not even a link back to the Vine app. Hey, if Vine provides a proper API, I’d use it.

Oh also, in my earlier post I stated that Google App Engine is not available in China. This is only partially true. The default appspot domain is indeed blocked in China. Yet, when putting my custom domain, donuts.pw, through GreatFirewallOfChina.org I get nothing but green status. Yes, I’m boldly sparking a democratic revolution one French Cruller at a time. So, if you want to serve Chinese customers via GAE, just map a custom domain to it.

I’m seriously considering using Google App Engine as a backend for a new game. The only problem is cost estimation. I have constant paranoia of real-world usage patterns running up my bill. Especially with improperly indexed datastores, you can rack up charges pretty fast. Still, simply writing an app and uploading it to Google’s cloud is significantly easier than fiddling with Amazon Web Services and Beanstalk. If you haven’t checked it out since the early days, GAE is worth another look.

Oh, also the latest version of GAE has sockets support. It’s still experimental, but this may lead to GAE being suitable for real-time applications such as multiplayer game servers.

Unity3D 4 Pet Peeves

I’ve been updating my older apps to use the newly released Unity3D 4 engine, as well as starting an entirely new project. I haven’t used many of Unity3D 4’s new features yet, but I figured this is as good a time as any to list a few of my pet peeves with Unity3D 4 as I did with Unity3D 3 a few years back.

It’s time Unity3D had a package manager.

Unity3D plug-ins and assets purchased from the Asset Store are invaluable. It’s becoming the most important feature that makes Unity3D the superior choice. However, managing projects with multiple plug-ins is can be a nightmare. A lot of this is how Unity3D handles file deletions.

If you click the “update” button to overwrite an existing plug-in with the latest version from the Asset Store, it may wreak havoc upon your entire project. Unity3D’s file hashing system will sometimes fail to overwrite files with the same name, even if you are importing a newer one. You’ll end up with a mess of old and new plug-in files causing chaos and mayhem. The only way to prevent this is to manually find delete all the old plug-in files before updating with the latest version.

Not to mention the fact that native plug-ins either require you to manually setup your own XCode project with external libraries or have their own proprietary scripts that edit your XCode project. Unity3D should provide an API and package manager that lets plug-ins forcibly delete and update their own files as well as modify settings in the XCode project Unity3D generates.

Let me import files with arbitrary extensions.

A minor annoyance is how Unity3D will only accept files with specific extensions in your project. If you want a custom binary data file you HAVE to give it the txt extension. It’s the only way you can drag the file in to the project. Unity3D should allow you to import files with any extension you want, but provide a method in the AssetPostprocessor API to be called when an unknown file extension is detected.

Where’s the GUI?

Come on now. It’s 2013. The new GUI has been “coming soon” for years. Unity hired the NGUI guy, which leads me to believe the mythical Unity3D 4 GUI is merely the stuff of legends and fantasies. I like NGUI but I’m really looking forward to an official solution from Unity. Although I’m not looking forward to re-writing all my GUIs once it arrives. Let’s just get it over with. Bring it on.

Monodevelop sucks.

My god. Monodevelop sucks. Lots of people use other text editors for code, but you still can’t avoid touching Monodevelop when it comes to debugging on OSX. I’m sure it can be whipped into shape with a minor overhaul, but it’s been awful for so long perhaps this is unlikely. Aside from the crashes and interface weirdness, how much human productivity has been destroyed waiting for Monodevelop to reload the solution every time so much as a single file has been moved to a different folder?

Is it time to update Mono?

While we’re at it, Mono recently updated to C# 5.0. I’m not sure if this is a big performance drag or not, but I’d love to see Unity3D’s Mono implementation updated to the latest. There are some C# 5.0 features I’ve been dying to use in Unity3D.

Tough Love

Don’t take it personally, Unity3D is still my engine of choice. This list of annoyances is pretty minor compared to previous ones. Every year, Unity gives me fewer and fewer things to whine about. It seems competing solutions are having trouble keeping up.

Google App Engine Experiments

For a while I’ve been complaining about the fact that sites such as AppAnnie and AppFigures don’t send daily summary emails of not just your apps, but the top apps in the App Store. I want to know what’s trending and topping the charts every day.

I could have made something in PHP to do this in a matter of hours, but I like to use side projects to learn something new. As an excuse to learn Google App Engine I built UpTopR: a site that emails a daily summary of the top 10 apps for iOS and iPad. It’s slow and ugly, but does what I need it to.

I used the Java API since I couldn’t find a way to deploy Python projects to GAE as easily as the Google plug-in for Eclipse does. I only had to learn how to use Google’s NoSQL App Engine Datastore and caching APIs. Otherwise, getting up and running on GAE is as easy, if not easier, than deploying a servlet on Tomcat. The whole process of learning GAE and finishing the app took about 4 days.

I’m big on PaaS now. Writing an application that magically scales inside Google’s environment is much easier than managing a cluster of EC2 instances as virtual infrastructure. Of course, writing a giant scaling servlet isn’t appropriate for a lot of tasks–but for the back-end of an asynchronous mobile game it makes a lot of sense.

Although last year’s pricing changes caused a revolt with long time GAE users, low traffic applications fall under the free usage quotas. Noodling around on GAE costs you nothing. This is great for prototyping.

Unfortunately, Google App Engine doesn’t work in China. The vast majority of IAPs in China are fraudulent, but China is kind of a big deal. Also, as useful as Google’s Datastore is, it still can’t search using geolocation without some suspect hacks. Amazon Web Services is available in China, and I can attach any kind of database I want to Amazon’s GAE equivalent, Beanstalk. This includes the geohash-supporting MongoDB. For these reasons I’m most likely going to use Amazon’s Beanstalk as a GAE alternative on future projects.

PROTIP: I had this problem for a while when trying to use uptopr.com as the domain for the app. Here’s what you have to know about using custom domains for GAE apps:

  • Only domain aliases for your main domain your App Engine Account is hosted on can be used with Google App Engine apps.

  • For mysterious reasons, naked domains can’t be used. You have to use a subdomain such as http://www.uptopr.com and use a URL redirect to point the naked domain at the subdomain.

  • Once your domain alias is registered with Google Apps, you have to type in the main active domain the alias is for on the Domain settings page for the GAE app. Then it will direct you to your Google Apps administration panel where you will be able select the alias from a dropdown.

I wish I knew this earlier! It took a few days of banging my head against a wall to figure out how to host my App Engine app on a custom domain.

How To Prevent Performance Spikes in Unity3D When a Model is First Visible

In my latest Unity3D app I dynamically load assets from the Resources folder and place them in the world after the initial scene load. These assets use new materials and textures that must be uploaded to the GPU. I thought I was being slick by caching prefabs to prevent a loading hiccup when I needed to instantiate. However, that’s only part of the problem. After placing the object in the scene, my game would freeze up for a frame or two when the newly created object first became visible. The profiler showed this spike attributed to a function called AwakeFromLoad.

It turns out Unity3D does not load the GPU with your new object’s assets until it’s first visible. Apparently, this is what AwakeFromLoad does. This is an optimization technique presumably to prevent thrashing on the GPU by loaded assets that won’t be visible immediately. The downside is you’ll see a pause as Unity3D uploads data to the GPU. From what I can tell, this can even mean compiling the shader if it hasn’t been used in the scene yet.

Unity doesn’t provide a function to force the GPU to load assets. From looking at Unity forum threads, the most common solution is to put up a loading screen and show newly instantiated assets to the main camera for a frame to force a GPU load. Once all the assets have been made visible, the loading screen is dropped.

Putting up a loading screen just seemed like a huge pain in the ass, not to mention an ugly hack. So, I came up with a solution using Unity Pro’s RenderTexture and a second camera. Now, my game scene has two cameras: the Main Camera and a disabled secondary camera with a tiny 32×32 RenderTexture as its target. Whenever I instantiate a new asset in the world, I position the second camera in front of it and render a frame to this texture. This forced rendering does the trick of uploading all necessary data to the GPU. Yes, there still is a loading spike, but you decide when it’s going to happen and you don’t have to reposition your object in view of the main camera for a frame.

I put this in a behavior called AssetGPULoader, you can grab it here. It only works with Unity3D Pro as it needs RenderTexture. As far as I can tell, this does the trick. It has removed my unpredictable performance spikes. For an alternative solution, I also found this technique in the Unity forums.

Extremely Rapid Prototyping Tools

Perhaps you’re competing in a hackathon or you’re trying to deliver a minimum viable product in a compressed timeframe. This list of prototyping and development resources might help you crank out wireframes, demos, and even full products quicker and cheaper.

Interface Mockups: Balsamiq

Balsamiq is the first tool I use when trying to design a UI flow for an application. It’s is a simple layout tool that lets you drag sketches of widgets, controls, and other UI elements on a canvas to quickly build mockups of interface screens.

The best thing about Balsamiq is that the end result looks like a hand drawn sketch. This way it’s clear to the UI artist that the design is just for layout and flow, not for the actual look and style. I’ve seen horrible GUI designs delivered as a result of prototyping tools that use actual widget images for mockup layouts. This can confuse artists and clients, making them think the mockup is how the interface is actually supposed to look.

The original Balsamiq mockups for Brick Buddies

Brick Buddies as mocked up in Balsamiq

Icons: iconfinder.com

If you need interface graphics or even a simple app icon for a prototype, just use this search engine. It contains a large amount of royalty-free icons you can use right away or massage in Photoshop to your liking. Iconfinder is invaluable for delivering professional looking interfaces with no graphic designers in a hackathon crunch. I wish I knew about it before doing NTheMiddle!

Sounds: freesound.org

Freesound.org is a great resource for free sounds and much easier to use than professional sound libraries you pay thousands of dollars for. The sounds here vary in quality greatly, but most have pretty loose terms that allow you to use them commercially or otherwise. If I can’t find what I’m looking for here, then I drop a few bucks on Soundsnap for more professional sound effects.

Server Back End: Parse

It seems you end up writing the same back-end code over and over for most mobile apps. In recognition of this pain point, a bunch of cloud APIs for common mobile back-end functions have popped up this year. I’m still evaluating them, but from a cursory glance I think Parse is the best.

Parse has the clearest billing terms, the easiest to use API regardless of platform (including a Unity3D plug-in!), and a solid feature set. If you need to make a user account system, send out push notifications, or store and query geolocation data, Parse is pretty easy to use. For anything real-time, you’ll need another solution.

How To Survive A Hackathon

My team came in second at the CityGrid LA Hackathon at CoLoft in Santa Monica this past weekend. We created NTheMiddle, an iPhone app that helps you find a place to meet in between your current location and someone else’s. It’s basic, but I might polish it up over the next weekend or two and toss it in the App Store.

Screenshot of NTheMiddle

Our 2nd place app at the CityGrid hackathon: NTheMiddle

Since this was the first hackathon I ever attended, I figured I’d post some survival tips.

Figure out compensation at the start.

If there are prizes involved, plan out how you’ll cut up the rewards first. Especially if you just met at the event. I’m not sure on what the best method is to split the pie with complete strangers, considering you may find that some do absolutely no work and will still expect their ‘fair’ share. We just divided it based on how much work we thought everyone was going to do.

Check your ego at the door.

It’s more important to complete something than to have your brilliant vision materialize by the end of the weekend. If you see another pitch that you like, ditch your project and join the other team! In my case, I abandoned my idea and became the sole developer on another because I really liked the concept and it seemed possible to do in a weekend.

Stick with it.

The most interesting thing about a hackathon is you go through the entire Paul Graham Startup Curve in 48 hours. Some teams seemed to fall apart during the mini Trough of Sorrow which hits around the second day. Seriously–it’s only 48 hours, get it together. It might not come out the way you wanted, but there’s absolutely no reason to give up on such a short project. Cross the finish line, even if it’s a spectacular failure.

Focus.

I pretty much ignored my other team members and forged ahead developing the project as it was originally envisioned on the first day. This was easy for me to do since I didn’t have another programmer to debate with. There’s no feature creep allowed in a 48 hour cycle. The most valuable skill in life is to know what to work on and what is a distraction. A hackathon can be a good training exercise to develop this ability.

Don’t be selfish.

Although it’s a competition, there’s no reason to not help others out. Offering a quick bug fix, feature suggestions, or even QA on another team’s project is a good way to meet future collaborators.

You don’t have to win to get value out of it.

Winning is nice, but that’s not the only objective of a hackathon. Hackathons are great places to find developers for other projects or seek new opportunities. It’s also a good way to network with the sponsors. They are usually underwriting the event to scout for talent or new uses for their APIs.

You don’t need to be a hacker to attend a hackathon.

I think only one-third of the attendees at this hackathon were programmers. The rest were, uh, “business” people and other mundanes. However, there are a lot of talents necessary for a successful hackathon project. I know I could have used a decent graphic designer on my team. Some developers were great engineers, but desperately needed an additional member to do the final presentation.

Hack!

Hackathons are held all over the world. They usually have themes–some are based on a specific technology, others on a type of app. There are resources out there to find hackathons near you if you’re interested in doing one.

3 Ways To Capture A Screenshot In Unity3D

For my equally ridiculous follow-up to Brick Buddies, I need to save a screenshot both as a texture and as a file in Unity3D. Although the game I’m currently writing has screenshots as an integral gameplay element, it’s still useful to integrate screenshots into any Unity3D project. Using Prime31’s Social Networking plug-in, it’s possible to Tweet pictures or post screens to user’s Facebook galleries. Having a screenshot capture feature can boost your viral reach. Especially if you design your application in such a way that people want to share screenshots. In Unity3D, there are a number of ways to do this.

Application.CaptureScreenshot

CaptureScreenshot is a method in the Application class that does exactly what it says; it saves the screenshot as a PNG file. On iOS devices, this screenshot will be put in the Documents folder. On other platforms you can specify an absolute path to put the file anywhere.

What the documentation doesn’t tell you is CaptureScreenshot is asynchronous. This is because capturing and saving the screen can take awhile. The API call itself isn’t a coroutine, so there’s no easy way to monitor its progress. One hack is to write your own method which checks for the existence of the screenshot file. Once the screenshot has completed saving, the file will be there.

Also note that it’s good practice to put CaptureScreenshot calls in the LateUpdate method. This way you capture the contents of the frame as it will look at the end of that update. If you have made any objects active or inactive during that frame, the results of those operations will be seen in LateUpdate.

RenderTexture

One convoluted way to take a screenshot is to use the RenderTexture feature in Unity Pro. You can create a RenderTexture object and tell any camera to write to it. You can then access the color buffer of the RenderTexture if you want to write out the pixels to a PNG.

CaptureScreenshot was just way too slow for my needs (I needed immediate access to the frame buffer) so I started writing a RenderTexture solution, until I found an easier way. If you want to check out this technique, I suggest this example.

Texture2D.ReadPixels

ReadPixels will read the pixel data from a specified rectangle on the screen and copy it to the source texture. It’s fairly fast and works with a few lines of code. Much like CaptureScreenshot, it’s a good idea to queue up the action somehow and then actually call ReadPixels in LateUpdate. Works like a charm:

Texture2D tex = new Texture2D(Screen.width, Screen.height);
tex.ReadPixels(new Rect(0,0,Screen.width,Screen.height),0,0);
tex.Apply();

ReadPixels still introduces some delay, so in the end I might try to see if RenderTexture is faster. If you are using the screenshots as a real-time texture effect, then RenderTexture is your best bet.

Unity3D Pet Peeves

I’ve been using Unity3D a lot lately and naturally have developed a list of gripes. Let me clear my throat…

The GUI.

Having fluid 3D graphics in a Unity3D game isn’t a major accomplishment. It’s when a game has a great GUI that Unity developers crowd around and wonder how it was done. The fact is, Unity3D’s GUI system is absolutely atrocious. Getting anything decent out of it is worthy of a Congressional Medal of Honor. I shudder to think how much work it took to craft Battleheart’s amazing GUI in Unity3D.

Back in 2005 when Unity3D was preparing for its first release, Immediate Mode GUIs were a hot new trend. However, game interfaces can be complex beasts. Especially on iOS platforms, there’s a certain level of polish expected that Unity’s IMGUI implementation can’t come close to. Also, Unity3D’s GUI has weird performance issues on mobile devices that makes it pretty much useless on iPhone.

Unity3D 3.5 supposedly has an all-new GUI system that I’m eager to see. Unity hasn’t uttered a word about it. Instead they have been going on about AAA console game features such as light probes that are largely irrelevant to anyone doing mobile games.

AnimationEvents can only be called on the first script.

Adding and manipulating animations in Unity3D can’t be much easier. Just drag and drop animations on to a prefab. Blending between animations is just a simple API call. You can even point and click to add AnimationEvents on any animation’s timeline. These are function calls that are made on the timeline, usually to trigger sounds, particle effects, etc.

The problem is, the AnimationEvent system can only call functions on the first script component attached to the object. This wouldn’t be a big deal if you could re-order the scripts in the Inspector. Instead, the only way to change the script order is to remove all script components and re-add them with the one containing AnimationEvent code first.

Asset Server should merge binary objects.

Before Unity3D supported source control in the Pro version, your only option was the $500 a seat Asset Server. This is a no frills source control system that allows multiple users to collaborate on scenes together. Unity should be able to craft a source control system that knows its own object format. If you could merge changes of binary objects down to the component level, Asset Server would be invaluable. Otherwise, Perforce is a better alternative. Even with Perforce, scaling a Unity3D development team beyond 10 or so people can be a nightmare.

Why are you using Unity3D at all?

Here’s the thing. Why are you even using Unity3D? Is it for 3D graphics? Who cares? There might be one or two 3D games in the top 50 iPhone apps sorted by revenue. On Facebook, nobody cares about 3D either.

The fact is, Unity3D is busy trying to attack the collapsing AAA game market with high end features such as multi-core renderers and light probes while ignoring what the vast majority of their users need–mobile friendly features such as GUI and 2D support.

My interest in Unity3D stems from its multi-platform features. The ability to effortlessly spit out web, iOS and Android builds from the same code is attractive. Still, when %80 of your revenue comes from iOS, do you really think it’s worth the hassle of dealing with Unity’s shortcomings just to scrape up a few extra dollars?

The amount of time I’ve spent searching for the ultimate cross-platform solution would probably have been better spent nailing an excellent iOS version and dealing with other platforms later. Still, in the past I’ve been bitten by tying a codebase closely to a single platform when the market shifts. This is an open question, but 3.5’s new GUI may be the make or break moment for my Unity support.

An Overview of Geospatial Databases

In preparation for my talk at LOGIN 2011 (and my own location-based stuff), I’ve done a lot of research into using databases to store geospatial information. I figured I’d put a partial brain dump up here. Maybe some of you folks can debunk any of this info before I start spreading misinformation in my presentation slides.

MySQL:

When developing my new platform, my first choice was MySQL. After all, I know how to use MySQL and so do a lot of people. MySQL has had spatial extensions since version 4.1, so it seemed like a good bet. Right?

MySQL stores geospatial information as Well-known Text (WKT) or its binary equivalent, well-known binary (WKB). You can store points, lines, and polygons as well as perform intersection and distance tests on this data.

WKT is an old markup language for geospatial data that’s just a plaintext representation of points and geometry. For instance, if we were to store the latitude and longitude values of 12, -75 as WKT, it would be “POINT (12 -75)”. Simple, eh?

MySQL provides a variety of functions for computing the distance between points, selecting points inside a square, etc. The problem is that all of these calculations occur in Euclidean space. That is, on a flat plane.

As we all know, the earth is round. So, just getting the Pythagorean distance between two points on the globe is going to be really inaccurate. You might get away with it near the equator (where the earth is flatter), or over small distances.

The solution for accuracy is to write your own great-circle distance formula. You can do it inside a MySQL query, or in your business logic via PHP etc. Either way, it’s a huge performance hit.

So, MySQL is out.

PostGIS:

PostGIS is an enhancement to PostgreSQL that adds geospatial features. It works very much like MySQL where it stores location data as WKT or binary. It has the same types of functions as MySQL for determining distance, intersections, etc. The big difference is that PostGIS supports “geographic” coordinates. Which means it can perform distance and intersection calculations on points as they are projected on a globe, not in flat Euclidean space.

I’m not a PostgreSQL expert, but the performance seems good and it’s a very robust RDMBS. Plus, the spatial support has been there since 2001–this is the most mature solution. A lot of geospatial applications have been built on top of it. Much like MySQL, it’s free and open-source.

This is probably the best solution if you want to use a relational database.

MongoDB:

MongoDB is the hip NoSQL database that’s big with all the kids these days. Hey, if it’s good enough for Foursquare, it’s good enough for me!

Last year, geospatial indexing was added to MongoDB. MongoDB stores locations as a geohash. This is a pretty neat way of storing latitude and longitude as a 1-dimensional value. Although, it’s really storing a bounding box, not a single point. Also, geohashes have some weird accuracy issues. I do think MongoDB compensates for this.

MongoDB can only store points–so no polygons or linestring paths. Still, for my purposes this is fine. It has all kinds of easy to use functions like searching for points near a point or inside a bounding shape.

MongoDB only supported Euclidean space calculations for a while. However, the latest version has spherical coordinate checks. This is acceptable, but because the Earth is not a perfect sphere it can be inaccurate. It’s good enough to determine your distance from the local Pizza Hut. Maybe not good enough to plan a Lybian airstrike.

SimpleGeo Storage:

SimpleGeo started out as a location-based gaming company, but once they discovered how bad geospatial tools are, they pivoted to a location middleware play. Their latest service is SimpleGeo Storage, a cloud database optimized for location data.

SimpleGeo Storage is a cloud database service painstakingly crafted on Cassandra. Therefore, you have to access it via HTTP as a web service. This can be a pretty big performance hit compared to a local connection to your database server, so design accordingly.

The API is easy to use. You can associate data with latitude/longitude, geohash, or even an IP address (as it is possible to map IP addresses to locations). As a cloud service, you don’t have as many system/cloud administration headaches either.

Amazon should buy these guys and then offer SimpleGeo Storage instances like they do RDS.

Summary:

There are other solutions too–I noticed there’s a new flavor of CouchDB, GeoCouch, for instance. It seems like if you’re a RDBMS person or need the best accuracy, PostGIS is it. Otherwise, MongoDB is the leading NoSQL solution. SimpleGeo Storage is early, but very promising depending on your performance needs.

Post Navigation

Follow

Get every new post delivered to your Inbox.

Join 1,640 other followers

%d bloggers like this: