<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>Cocoafish is backend mobile application development made quick and easy. We’re a platform service that lets developers build top network features into mobile apps without writing any server code. Quick to build. Quick to deploy. All hosted and managed at a fraction of the typical cost.Interested app developers can sign up for Private Beta access.


  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-24737484-1']);
  _gaq.push(['_setDomainName', 'cocoafish.com']);
  _gaq.push(['_setAllowHash', 'false']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</description><title>Cocoafish</title><generator>Tumblr (3.0; @cocoafish)</generator><link>http://blog.cocoafish.com/</link><item><title>How We Designed Our Public API</title><description>&lt;p&gt;Public APIs are crucial for enabling deep integration of your service into other applications and platforms. And once you become embedded into a critical mass of platforms, you&amp;#8217;re set. The scary part is designing them to strike a balance between ease of use, flexibility, and options for future expansion.&lt;/p&gt;
&lt;p&gt;At both &lt;a href="http://www.iphonedevcamp.org/"&gt;iOSDevCamp 2011&lt;/a&gt; and &lt;a href="http://www.10gen.com/conferences/mongosf2011"&gt;MongoSF 2011&lt;/a&gt; I gave a presentation that included details about how we designed our REST API. I had looked at a ton of APIs that app developers were accustomed to using such as Foursquare, Facebook, and Twitter and took parts from each that I liked. Here are some of the thought processes we followed to design V1 of the Cocoafish API.&lt;/p&gt;
&lt;h3&gt;URI Paths&lt;/h3&gt;
&lt;p&gt;In the beginning we started with Ruby on Rails&amp;#8217; default CRUD methods for each object: create, read, update, and delete. For example by using the proper HTTP method, you can get four actions from the same URI.&lt;/p&gt;
&lt;pre&gt;Create a user:   POST /users.json
Show a user:      GET /users/&amp;lt;id&amp;gt;.json
Update a user:    PUT /users/&amp;lt;id&amp;gt;.json
Delete a user: DELETE /users/&amp;lt;id&amp;gt;.json
&lt;/pre&gt;
&lt;p&gt;If your API doesn&amp;#8217;t require additional actions, this is simple to use and works well. However, as soon as you add a couple of other actions:&lt;/p&gt;
&lt;pre&gt;Search users:    GET /users.json
Checkin a user: POST /users/&amp;lt;id&amp;gt;/checkin.json
&lt;/pre&gt;
&lt;p&gt;It gets more confusing. Now you have even more actions sharing the same URI scheme. And there&amp;#8217;s the oddball method (checkin) that has a verb in the path.&lt;/p&gt;
&lt;p&gt;As our API grew we made everything consistent by always including a action verb in the path. The HTTP methods (POST, GET, PUT, DELETE) still determine how the data is being handled, however the verb always makes it clear what is being done.&lt;/p&gt;
&lt;pre&gt;Create a user:   POST /users/create.json
Show a user:      GET /users/show.json
Update a user:    PUT /users/update.json
Delete a user: DELETE /users/delete.json
Search users:     GET /users/search.json
Checkin a user:  POST /checkins/create.json&lt;/pre&gt;
&lt;p&gt;Notice that checkin has been moved to its own top-level action. Avoiding nested URIs makes things less confusing and adds flexibility. Also, we ditched the REST convention of placing the identifier of the object being acted upon in the URI. When working on the &lt;a href="https://github.com/cocoafish/cocoafish-ios-sdk"&gt;Cocoafish iOS SDK&lt;/a&gt;, Wei realized that it&amp;#8217;s much simpler to create generic methods that call our server when the IDs are removed.&lt;/p&gt;
&lt;p&gt;Therefore, object IDs are always arguments, and the full URI to checkin a user to a place becomes:&lt;/p&gt;
&lt;pre&gt;POST http:// api.cocoafish.com/v1/checkins/create.json?user_id=1&amp;amp;place_id=100&lt;/pre&gt;
&lt;p&gt;The flexibility afforded by taking all arguments out of the URI can be seen when we want to checkin the user to an event instead:&lt;/p&gt;
&lt;pre&gt;POST http:// api.cocoafish.com/v1/checkins/create.json?user_id=1&amp;amp;event_id=100&lt;/pre&gt;
&lt;p&gt;By not creating complicated URI paths for every combination of object types and actions, we greatly simplify the API.&lt;/p&gt;
&lt;h3&gt;Versioning&lt;/h3&gt;
&lt;p&gt;Another important aspect to consider when designing an API is versioning. Someday you will need to make incompatible changes to your API. If you can&amp;#8217;t synchronously update your clients when the API changes (Words with Friends really annoys me by forcing app updates), then you&amp;#8217;ll need to version. Two common ways of doing this are to place it at the beginning of the URI or include it as a parameter:&lt;/p&gt;
&lt;pre&gt;http:// api.cocoafish.com/v1/places/search.json
http:// api.cocoafish.com/places/search.json?v=1&lt;/pre&gt;
&lt;p&gt;Either way works fine, but I prefer the former since it can&amp;#8217;t be forgotten nor mixed up with other parameters.&lt;/p&gt;
&lt;p&gt;- &lt;a href="http://twitter.com/#!/mikegoff"&gt;Mike&lt;/a&gt;&lt;/p&gt;</description><link>http://blog.cocoafish.com/post/8682097032</link><guid>http://blog.cocoafish.com/post/8682097032</guid><pubDate>Tue, 09 Aug 2011 00:18:00 -0700</pubDate><category>rest</category><category>api</category><category>sdk</category><category>ruby on rails</category><dc:creator>mikegoff</dc:creator></item><item><title>MongoDB is our Best Friend</title><description>&lt;p&gt;The rise of web services with millions of users like Facebook and Twitter has brought about the term &amp;#8220;Internet scale.&amp;#8221; At Cocoafish we&amp;#8217;ve built a server platform for mobile apps that can automatically handle Internet scale traffic for app developers so they don&amp;#8217;t have to put a second of thought or work into it.&lt;/p&gt;
&lt;p&gt;When designing our fundamental architecture we needed to find a database that could deal with millions of users across thousands of apps that will use Cocoafish. I knew that we would need replication, sharding, read slaves, etc. Using the default SQL solution (MySQL) was out of the question since the administrative model for these kind of scaling features is difficult. Plus I found anecdotal evidence that performance hits a wall once you get to some millions of rows in a table. On top of that we wanted to handle flexible app data without predefining schemas or running database migrations from our Ruby on Rails stack.&lt;/p&gt;
&lt;p&gt;I first looked at &lt;a href="http://cassandra.apache.org/"&gt;Apache Cassandra&lt;/a&gt; which introduced me to the concept of a high-performance, schema-less document store. It looked promising, but the state of RoR support for Cassandra in late 2010 wasn&amp;#8217;t encouraging. Then some friends at large company told me that they were doing the same type of investigation into SQL and NoSQL solutions for a major project. They had found that Cassandra just fell over with too much load. However, MongoDB looked very promising. I think in the end they chose Oracle running on expensive hardware, presumably because they could get a large, established company to be on the hook when things went wrong. But for a new startup, MongoDB looked just right.&lt;/p&gt;
&lt;p&gt;After getting over how ridiculous the name sounded, I checked out &lt;a href="http://mongodb.org"&gt;mongodb.org&lt;/a&gt;, browsed the docs, and tried the software. Wei and I also attended &lt;a href="http://www.10gen.com/conferences/mongosv2010"&gt;MongoSV 2010&lt;/a&gt;. We were impressed with how simple and straightforward it all was. Any software that&amp;#8217;s just contained in a single binary instead of a multitude of libraries and config files gets lots of extra points in my book. 10gen makes money from consulting, but they sort of defeat their own purpose by making the software and docs so simple to use.&lt;/p&gt;
&lt;p&gt;However, we have purchased two sessions of their $300/hr consulting services. At first it looks really pricey, but both sessions were totally worth it. Both times we talked to &lt;a href="http://kylebanker.com/blog/"&gt;Kyle Banker&lt;/a&gt; who wrote and maintains their &lt;a href="https://github.com/mongodb/mongo-ruby-driver"&gt;Ruby driver&lt;/a&gt;. He really helped us with in-depth design issues and kept us on the path to MongoDB awesomeness. I also gave a lightning talk at &lt;a href="http://www.10gen.com/conferences/mongosf2011"&gt;MongoSF 2011&lt;/a&gt; which was a great chance to share our experience with using MongoDB for a multi-tenant service through Ruby on Rails.&lt;/p&gt;
&lt;p&gt;At the risk of this sounding like a paid blog entry, our experience so far has been wonderful. We&amp;#8217;re constantly expanding our data models, and MongoDB makes it totally easy to do that. While we haven&amp;#8217;t yet pushed all the boundaries of their performance and features, we&amp;#8217;re confident that MongoDB will handle what we throw at it. With the recent addition of features like journaling and spherical geospatial search, this is a great time to try it out for services large and small.&lt;/p&gt;
&lt;p&gt;- &lt;a href="http://twitter.com/#!/mikegoff"&gt;Mike&lt;/a&gt;&lt;/p&gt;</description><link>http://blog.cocoafish.com/post/7992797174</link><guid>http://blog.cocoafish.com/post/7992797174</guid><pubDate>Sat, 23 Jul 2011 23:11:00 -0700</pubDate><category>mongodb</category><category>nosql</category><category>ruby on rails</category><dc:creator>mikegoff</dc:creator></item><item><title>Cocoafish @ iOSDevCamp 2011</title><description>&lt;p&gt;
&lt;object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" height="296" width="480"&gt;
&lt;param name="flashvars" value="vid=16073539&amp;amp;hid=187588&amp;amp;autoplay=false"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;param name="src" value="http://www.ustream.tv/flash/viewer.swf"&gt;&lt;embed flashvars="vid=16073539&amp;amp;hid=187588&amp;amp;autoplay=false" allowfullscreen="true" allowscriptaccess="always" src="http://www.ustream.tv/flash/viewer.swf" type="application/x-shockwave-flash" height="296" width="480"&gt;&lt;/embed&gt;&lt;/object&gt;
&lt;/p&gt;
&lt;p&gt;Cocoafish just sponsored &lt;a href="http://www.iphonedevcamp.org/"&gt;iOSDevCamp 2011&lt;/a&gt;. So Andy, Wei, and I were there this entire past weekend to help teams add network features to their apps without having to deploy any servers or write server code. Checkout this video of Dan Zeitman demoing &lt;a href="http://imemorial.org"&gt;iMemorial&lt;/a&gt;, an awesome app that was developed just over the weekend by a great group of people. Jump to 24:53 to hear where Dan gives props to Cocoafish.&lt;br/&gt;&lt;br/&gt;- &lt;a href="http://twitter.com/#!/mikegoff"&gt;Mike&lt;/a&gt;&lt;/p&gt;</description><link>http://blog.cocoafish.com/post/9002644794</link><guid>http://blog.cocoafish.com/post/9002644794</guid><pubDate>Mon, 18 Jul 2011 10:06:00 -0700</pubDate><dc:creator>mikegoff</dc:creator></item><item><title>It's all about our Users and their Apps</title><description>&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_lov7vtICsO1qjr2gg.jpg" height="467" width="700"/&gt;&lt;/p&gt;
&lt;p&gt;Cocoafish has a single purpose: to help app developers make their apps faster and with more features then they can already. Whether it&amp;#8217;s for an individual developer just starting out with iOS programming or an experienced team, we&amp;#8217;re taking care of the server-side programming and administrative work so that they can focus on their apps&amp;#8217; features and users.&lt;/p&gt;
&lt;p&gt;This isn&amp;#8217;t just a toy or add-on to some other product. We&amp;#8217;re going deep into features, performance, and security to become the one-stop, cross-platform shop for your app&amp;#8217;s networked features. Have some great ideas for product features? Email us at &lt;a href="mailto:info@cocoafish.com"&gt;info@cocoafish.com&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;- &lt;a href="http://twitter.com/#!/mikegoff"&gt;Mike&lt;/a&gt;, &lt;a href="http://twitter.com/#!/baobeimm"&gt;Wei&lt;/a&gt;, Andy, and Peter&lt;/p&gt;</description><link>http://blog.cocoafish.com/post/8024375618</link><guid>http://blog.cocoafish.com/post/8024375618</guid><pubDate>Fri, 01 Jul 2011 18:45:00 -0700</pubDate><dc:creator>mikegoff</dc:creator></item></channel></rss>
