1. Building Web Services
for Mobile Apps
Brent Simmons @brentsimmons
Nick Bradbury @nbradbury
Brian Reischl @brianreischl
Nick Harris @nick_harris
@SepiaLabs
@Glassboard
2. Introductions
Brent Simmons: NetNewsWire and Mars Edit
Nick Bradbury: HomeSite, TopStyle, FeedDemon.
Brian Reischl: 5+ years at NewsGator
Nick Harris: 5+ years at NewsGator
4. History
- Idea formally born in December 2010
- Development began in January 2011
- First beta in mid-May
- Second beta in July
- Initial Release August 2011
5. Platform Details
- Built on Microsoft Windows Azure
- Both WebRoles and Worker Roles
- Table, Queue and Blob Storage
- SQL Azure for diagnostic data
6. Initial API Design
- REST Implementation
- JSON body content when possible
- Multi-part Form otherwise
7. Why REST?
- Main idea of REST is uniquely addressable objects
- Easier for client developers to understand
- Supported with basic frameworks on any platform
- Encourages more universal architecture decisions
8. REST API Examples:
Boards
GET /api/boards
gets the boards for a user
POST /api/boards
creates a new board with the information supplied in the JSON body
GET /api/boards/{board_id}/statuses
gets the latest statuses for the board
GET /api/boards/{board_id}/statuses/{status_id}/comments
gets the latest comments for the status
9. Why REST cont...
- HTTP Status Codes
- Additional HTTP Headers
POST /api/boards/
RESPONSE:
Status Code: 409 Conflict
X-GlassboardPlatform-Exception-Code:
200002
**Error code 200002: A board with this name
already exists for this chairman
17. The Problem...
- Stringent REST implementations have limitations
- Mobile applications have their own limitations
Mobile apps need to be not only useable but useful
as soon as possible - that means new data...
18. The Newsfeed Solution
- Single call to get all new statuses and comments
- One out-bound request on startup
- Data body just a set of existing JSON objects