background preloader

Best Practices for Designing a Pragmatic RESTful API

Your data model has started to stabilize and you're in a position to create a public API for your web app. You realize it's hard to make significant changes to your API once it's released and want to get as much right as possible up front. Now, the internet has no shortage on opinions on API design. But, since there's no one widely adopted standard that works in all cases, you're left with a bunch of choices: What formats should you accept? How should you authenticate? In designing an API for Enchant (a Zendesk Alternative), I've tried to come up with pragmatic answers to these questions. ... or just skip to the bottom and signup for updates Latest from the Enchant blog How to make your app lovable A decent app helps you get the job done. ... and those apps, the ones that make things feel effortless, are the ones we love the most. But what makes an app feel effortless? Key requirements for the API Use RESTful URLs and actions But what can I make a resource? SSL everywhere - all the time Related:  ++ theory

RESTful Web Services: A Tutorial More than a decade after its introduction, REST has become one of the most important technologies for Web applications. Its importance is likely to continue growing quickly as all technologies move towards an API orientation. Every major development language now includes frameworks for building RESTful Web services. As such, it is important for Web developers and architects to have a clear understanding of REST and RESTful services. This tutorial explains REST architecturally, then dives into the details of using it for common API-based tasks. While REST stands for Representational State Transfer, which is an architectural style for networked hypermedia applications, it is primarily used to build Web services that are lightweight, maintainable, and scalable. Features of a RESTful Services Every system uses resources. Representations Messages URIs Uniform interface Stateless Links between resources Caching Representations Listing One: JSON representation of a resource. Messages HTTP Request or

HATEOAS The HATEOAS constraint decouples client and server in a way that allows the server functionality to evolve independently. Details[edit] A REST client enters a REST application through a simple fixed URL. All future actions the client may take are discovered within resource representations returned from the server. The media types used for these representations, and the link relations they may contain, are standardized. The client transitions through application states by selecting from the links within a representation or by manipulating the representation in other ways afforded by its media type. For example [2] here is a GET request to fetch an Account resource, requesting details in an XML representation: GET /account/12345 HTTP/1.1 Host: somebank.org Accept: application/xml ... Here is the response: HTTP/1.1 200 OK Content-Type: application/xml Content-Length: ... <? Some time later the account information is retrieved again, but now the account is overdrawn: Origins[edit] See also[edit]

Iteratees in Big Data at Klout « Klout Engineering At Klout we calculate social influence of users across several social networks and we must be able to collect and aggregate data from these networks scalably and within a meaningful amount of time. We then deliver these metrics to our users visually. Our users and clients expect data to be up to date and accurate and it has been a significant technical challenge to reliably meet these goals. In this blog post we describe the usage of Play! Iteratees in a Nutshell In a sentence, Iteratees are the functional way to model producers and consumers of streams of data. Enumerator (produce data) → Enumeratee (map data) → Iteratee (consume data) Other compositions are also possible with the Play! Legacy Data Collection Our legacy collection framework was written in Java and built on the java.util.concurrent library. 1. These three stages are necessarily sequential, but individually they are highly paralelizable, and more importantly may be executed asynchronously. New Collection Paging Enumerator

Latency Compensating Methods in Client/Server In-game Protocol Design and Optimization Overview Designing first-person action games for Internet play is a challenging process. Having robust on-line gameplay in your action title, however, is becoming essential to the success and longevity of the title. In addition, the PC space is well known for requiring developers to support a wide variety of customer setups. Often, customers are running on less than state-of-the-art hardware. While broadband has been held out as a panacea for all of the current woes of on-line gaming, broadband is not a simple solution allowing developers to ignore the implications of latency and other network factors in game designs. Your game must behave well in this world. Basic Architecture of a Client / Server Game Most action games played on the net today are modified client / server games. With this in mind, the typical client / server game engine architecture generally looks like this: The server has a somewhat similar loop: Contents of the User Input messages Client Side Prediction Lag Compensation

REST API | SupportFu Developers Introduction SupportFu is a fully hosted solution to manage email and twitter based customer support. We provide a REST API built on pragmatic RESTful design principles. Our API uses resource-oriented URLs that leverage built in features of HTTP, like authentication, verbs and response codes. All request and response bodies are JSON encoded, including error responses. We believe an API is a user interface for a developer - accordingly, we've made sure our API can be easily explored from the browser! Changes This is a versionless API. Sign up for the SupportFu Developer mailing list Recent Changes Sept 13, 2013: new required field direction added to Twitter & Email reply messages . Coming Soon... Token based authentication Authentication This API is authenticated using HTTP Basic Auth over HTTPS. A user's email address and password can be provided as auth credentials: $ curl -u email:password Requests JSON Bodies HTTP Verbs Limited HTTP Clients Responses Errors

- The RESTful cookbook What Every Programmer Needs To Know About Game Networking | Gaffer On Games Introduction Hi, I’m Glenn Fiedler and welcome to Networking for Game Programmers. Have you ever wondered how multiplayer games work? From the outside it seems magical: two or more players sharing a consistent experience across the network like they actually exist together in the same virtual world. But as programmers we know the truth of what is actually going on underneath is quite different from what you see. Peer-to-Peer Lockstep In the beginning games were networked peer-to-peer, with each each computer exchanging information with each other in a fully connected mesh topology. The basic idea is to abstract the game into a series of turns and a set of command messages when processed at the beginning of each turn direct the evolution of the game state. Of course this is an overly simplistic explanation and glosses over many subtle points, but it gets across the basic idea of how networking for RTS games work. But for other genres, the state of the art has moved on. Client/Server

RESTful Web services: The basics The basics REST defines a set of architectural principles by which you can design Web services that focus on a system's resources, including how resource states are addressed and transferred over HTTP by a wide range of clients written in different languages. If measured by the number of Web services that use it, REST has emerged in the last few years alone as a predominant Web service design model. REST didn't attract this much attention when it was first introduced in 2000 by Roy Fielding at the University of California, Irvine, in his academic dissertation, "Architectural Styles and the Design of Network-based Software Architectures," which analyzes a set of software architecture principles that use the Web as a platform for distributed computing (see Resources for a link to this dissertation). This article suggests that in its purest form today, when it's attracting this much attention, a concrete implementation of a REST Web service follows four basic design principles: Back to top

Play framework claimed performance not upto par Recently, an independent group of people ran a comprehensive test comparing various frameworks under real-world production scenarios and posted the results to Hackernews. It was thoroughly disappointing to see Play far behind even Node.js, which I've always thought of to be inferior (single threaded plus javascript sucks for large projects). I am not complaining though, because play gives me a lot of opportunity to write maintainable code and boost my productivity. But, for a framework that claims serious performance (Play's homepage claims so) this is terribly disappointing. Some blame it on the database blocking calls, but I am genuinely curious on running non-blocking calls to the common database (MySQL, PostgreSQL, etc.) If Play was tuned for performance (using Akka, etc), where exactly do you think in that benchmark would it stand up? I'm just a genuinely curious user, so please bear with me!

Related: