You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: www/content/essays/interviews/leonard_richardson.md
+32-32Lines changed: 32 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,42 +30,42 @@ Leonard agreed to talk to me about the RMM and his experiences building Web soft
30
30
**Question**: Can you give us some background about yourself and how you came into web programming? Did/do you consider
31
31
yourself a hypermedia enthusiast?
32
32
33
-
When I was in high school in the mid-1990s, I got very basic Internet access through BBSes. There were all these
33
+
> When I was in high school in the mid-1990s, I got very basic Internet access through BBSes. There were all these
34
34
amazing, arcane protocols you had to learn to get around: FTP, Gopher, Archie, NNTP, et cetera. And then just as I went
35
35
to college, the World Wide Web suddenly wiped out all of those domain-specific protocols. Within a couple of years we
36
36
were using the Web technologies–URI, HTTP and HTML–for everything.
37
37
38
-
My formative years as a developer happened against the background of the incredible power of those three core
38
+
> My formative years as a developer happened against the background of the incredible power of those three core
39
39
technologies. Everything was being built on top of the Web, and it basically worked and was a lot simpler than the old
40
40
way.
41
41
42
-
So yes, I am a hypermedia enthusiast, but it took me a really long time to understand the distinct advantages that come
42
+
> So yes, I am a hypermedia enthusiast, but it took me a really long time to understand the distinct advantages that come
43
43
from the "hypermedia" part of the Web. And that came with an understanding of when those advantages are irrelevant or
44
44
undesirable from a business standpoint.
45
45
46
46
**Question**: Can you give us a brief history of early Web APIs? What was the origin story of the RMM?
47
47
48
-
What we now call "web APIs" started as a reaction against SOAP, a technology from a time when corporate firewalls
48
+
> What we now call "web APIs" started as a reaction against SOAP, a technology from a time when corporate firewalls
49
49
allowed HTTP connections (necessary to get work done) but blocked most other traffic (games?). SOAP let you serialize a
50
50
procedure call into XML and invoke it over an HTTP connection, punching through the firewall. It was an extraordinarily
51
51
heavyweight solution, using the exact same tools–XML and HTTP–you'd need to make a good lightweight solution.
52
52
53
-
Now that I'm an old fogey, I can look back on SOAP and see the previous generation of old fogeys trying to make the
53
+
> Now that I'm an old fogey, I can look back on SOAP and see the previous generation of old fogeys trying to make the
54
54
1990s client-server paradigm work over the Internet. SOAP had a lot of mindshare for a while, but there were very few
55
55
publicly deployed SOAP services. When you deploy a service on the public Internet, people expect to connect to it from a
56
56
wide variety of programming languages and programming environments. SOAP wasn't cut out for that because it was so heavy
57
57
and demanded so much tooling to compensate for its heaviness.
58
58
59
-
Instead, developers picked and chose their designs from the core web technologies. Thanks to the dot-com boom, those
59
+
> Instead, developers picked and chose their designs from the core web technologies. Thanks to the dot-com boom, those
60
60
technologies were understood by practicing developers and well supported by every major programming language.
61
61
62
-
The RMM, as it's now called, was originally a heuristic I presented
62
+
> The RMM, as it's now called, was originally a heuristic I presented
63
63
in [a talk in 2008](https://www.crummy.com/writing/speaking/2008-QCon/act3.html). [The first part of the talk](https://www.crummy.com/writing/speaking/2008-QCon/act1.html)
64
64
goes over the early history I mentioned earlier,
65
65
and [the second part](https://www.crummy.com/writing/speaking/2008-QCon/act2.html) talks about my first experience
66
66
trying to sell hypermedia-based API design to an employer.
67
67
68
-
I’d analyzed about a hundred web API designs for my book on REST and seen very strong groupings around the core web
68
+
> I’d analyzed about a hundred web API designs for my book on REST and seen very strong groupings around the core web
69
69
technologies. You'd see a lot of APIs that "got" URLs but didn't "get" HTTP. But you'd never see one where it happened
70
70
the other way, an API that took advantage of the features of HTTP but didn't know what to do with URLs. If I had one
71
71
insight here, it's that the URL is the most fundamental web technology. HTTP is a set of rules for efficiently dealing
@@ -74,58 +74,58 @@ with URLs, and HTML (a.k.a. hypermedia) is a set of instructions for driving an
74
74
**Question**: In “How Did REST come to mean the opposite of REST?” I assert that the term REST has nearly inverted in
75
75
its meaning. In particular, I claim that most APIs stopped at “Level 2” of the RMM. Do you agree with these claims?
76
76
77
-
Everyone understands URIs these days, and understanding HTTP is essential for performance reasons if nothing else. That
77
+
> Everyone understands URIs these days, and understanding HTTP is essential for performance reasons if nothing else. That
78
78
gets you to level 2, and yes, there we have stayed. That's what I was getting at
79
79
in [this interview from 2007](https://www.infoq.com/articles/richardson-ruby-restful-ws/), a year before I gave my
80
80
famous talk:
81
81
82
-
The big question in my mind is whether architectures consciously designed with REST in mind will “win” over
82
+
> The big question in my mind is whether architectures consciously designed with REST in mind will “win” over
83
83
architectures that are simple but only intermittently RESTful.
84
84
85
-
You don't get a certificate signed by Roy Fielding for achieving level 3\. The reward for learning and applying the
85
+
> You don't get a certificate signed by Roy Fielding for achieving level 3\. The reward for learning and applying the
86
86
lesson of hypermedia is *interoperability*. Your users get the ability to use your system in ways you didn't anticipate,
87
87
and they get to combine your system with their other systems.
88
88
89
-
Interoperability is essential in a situation like the Web, where there are millions of server and client deployments,
89
+
> Interoperability is essential in a situation like the Web, where there are millions of server and client deployments,
90
90
and a dozen major server implementations. (There are now only two major client implementations, but that's its own sad
91
91
story.)
92
92
93
-
For a long time I thought people just didn't get this and if I hammered on the technical advantages of hypermedia they'd
93
+
> For a long time I thought people just didn't get this and if I hammered on the technical advantages of hypermedia they'd
94
94
come around. But we've been stuck at level 2 for more than half the lifetime of the Web. It's become clear to me that
95
95
most situations aren't like the Web, and the advantages of hypermedia aren't relevant to most business models.
96
96
97
97
**Question**: Level 3 style hypermedia controls never really took off in Web APIs. Why do you think that is?
98
98
99
-
I don't do this for everything, but I am going to blame this one on capitalism.
99
+
> I don't do this for everything, but I am going to blame this one on capitalism.
100
100
101
-
Almost all actually deployed web APIs are under the complete control of one company. They have one server implementation
101
+
> Almost all actually deployed web APIs are under the complete control of one company. They have one server implementation
102
102
written by that company and one server deployment managed by that company. If the API has any official client
103
103
implementations, those are also controlled by the company that owns the API. The fact that we say "the \[company\] API"
104
104
is the opposite of interoperability.
105
105
106
-
Users like interoperability, but vendors prefer lock-in. We see that in their behavior. Netflix was happy to provide a
106
+
> Users like interoperability, but vendors prefer lock-in. We see that in their behavior. Netflix was happy to provide a
107
107
hypermedia API for their program data... until their streaming business became big enough. Once they were the dominant
108
108
player and could dictate the terms of integration, Netflix shut down their API. Twitter used to cut off your API access
109
109
if your client got too popular; then they banned third-party clients altogether.
110
110
111
-
There are lots of APIs that consider interoperability a strong point, and many of them are oriented around hypermedia,
111
+
> There are lots of APIs that consider interoperability a strong point, and many of them are oriented around hypermedia,
112
112
but almost all of them live outside the space of commercial competition. In 2008 when I gave the "maturity heuristic"
113
113
talk I was working on software development tools at Canonical, which is a for-profit company but heavily involved in
114
114
open source development. We wanted lots of tools and programming environments to be able to talk to our API, but the API
115
115
was a relatively small part of our process and we didn't have enough developers to manage a bunch of official clients. A
116
116
hypermedia-based approach gave us a certain flexibility to change our API without breaking all the clients.
117
117
118
-
After that I spent eight years working on ebook delivery in the US public library space, which is extremely fragmented
118
+
> After that I spent eight years working on ebook delivery in the US public library space, which is extremely fragmented
119
119
in terms of IT management. In a nonprofit environment with lots of independent server deployments, hypermedia (in the
120
120
form of the [OPDS](https://opds.io/) protocol) was a really easy
121
121
pitch. [I gave a talk about that.](https://www.crummy.com/writing/speaking/2015-RESTFest/)
122
122
123
-
To get the benefits of hypermedia you have to collaborate with other people in the same field, consider the entire
123
+
> To get the benefits of hypermedia you have to collaborate with other people in the same field, consider the entire
124
124
problem space, and come up with a design that works for everyone. Who's going to go through all that work when the
125
125
reward is “no vendor lock-in”? People who are not competing with their peers: scientists, librarians, and open source
126
126
developers.
127
127
128
-
It might or might not surprise you to learn that the library world is dominated by an antique protocol
128
+
> It might or might not surprise you to learn that the library world is dominated by an antique protocol
129
129
called [SIP](https://developers.exlibrisgroup.com/wp-content/uploads/2020/01/3M-Standard-Interchange-Protocol-Version-2.00.pdf). (
130
130
Not the VoIP protocol, a different SIP.) SIP is what the self-checkout machine uses to record the fact that you borrowed
131
131
the book. SIP first showed up in 1993, its design is distinctively non-RESTful, and in many ways it’s simply *bad*.
@@ -136,63 +136,63 @@ vendors. [I gave a talk about that, too.](https://www.crummy.com/writing/speakin
136
136
137
137
**Question**: Do you think the move from XML to JSON as a format had any influence on how Web APIs evolved?
138
138
139
-
Absolutely. Moving from XML to JSON replaced a document-centric design (more suitable for communications with a human at
139
+
> Absolutely. Moving from XML to JSON replaced a document-centric design (more suitable for communications with a human at
140
140
one end) with a data-centric design (more suitable for machine-to-machine communication). The cost was forgetting about
141
141
hypermedia altogether.
142
142
143
-
One thing about Martin's diagram that I think obscures more than it reveals is: he calls level 0 the "Swamp of POX".
143
+
> One thing about Martin's diagram that I think obscures more than it reveals is: he calls level 0 the "Swamp of POX".
144
144
This makes it seem like the problem is (Plain Old) XML. Martin is actually talking about SOAP there. The big problem
145
145
with SOAP services isn't XML (although they do have way too much XML), it's that they don't use URLs. A SOAP client puts
146
146
all of the request information into an XML package and tunnels it through a single service endpoint. This makes SOAP
147
147
opaque to the tools designed to manage and monitor and inspect HTTP traffic. This is by design, because the point of
148
148
SOAP is to let you make RPC calls when your IT department has everything but port 80 locked down.
149
149
150
-
Anyway, XML is great\! It's too verbose to make an efficient data representation format, but XML has namespaces, and
150
+
> Anyway, XML is great\! It's too verbose to make an efficient data representation format, but XML has namespaces, and
151
151
through namespaces it has hypermedia controls (via XLink, XForms, XHTML, Atom, etc.). JSON has no hypermedia controls,
152
152
and because it also has no namespaces, you can't add them after the fact.
153
153
154
-
People started adopting JSON because they were tired of XML processing and excited about AJAX (in-browser HTTP clients
154
+
> People started adopting JSON because they were tired of XML processing and excited about AJAX (in-browser HTTP clients
155
155
driven by Javascript, for those who weren't there). But that initial decision started constraining decisions down the
156
156
road.
157
157
158
-
By 2011, all new web APIs were using a representation format with no hypermedia controls. You couldn't do a
158
+
> By 2011, all new web APIs were using a representation format with no hypermedia controls. You couldn't do a
159
159
hypermedia-based design if you wanted to. Our technical language had lost the words. First you'd have to define a
160
160
JSON-based media type that had hypermedia (like Siren), or namespaces (like JSON-LD).
161
161
162
162
**Question**: What are your thoughts on GraphQL and other non-RESTful API technologies?
163
163
164
-
With regard to non-RESTful API technologies in general, I would suggest that folks take a break
164
+
> With regard to non-RESTful API technologies in general, I would suggest that folks take a break
165
165
from [chapter 5](https://ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm) of Roy Fielding's dissertation,
166
166
and look at chapters [2](https://ics.uci.edu/~fielding/pubs/dissertation/net_app_arch.htm%20)
167
167
and [4](https://ics.uci.edu/~fielding/pubs/dissertation/web_arch_domain.htm).
168
168
169
-
Chapter 5 is where Fielding talks about the design of the Web, but Chapter 2 breaks down all of the possible good things
169
+
> Chapter 5 is where Fielding talks about the design of the Web, but Chapter 2 breaks down all of the possible good things
170
170
you might want from a networked application architecture, only some of which apply to the Web. Chapter 4 explains the
171
171
tradeoffs that were made when designing the Web, giving us some good things at the expense of others.
172
172
173
-
Chapter 4 lists five main advantages of the Web: low entry-barrier, extensibility, distributed hypermedia, anarchic
173
+
> Chapter 4 lists five main advantages of the Web: low entry-barrier, extensibility, distributed hypermedia, anarchic
174
174
scalability, and independent deployment. REST is a really effective way of getting those advantages, but the advantages
175
175
themselves are what you really want. If you can get them without the Web technologies, then all you've lost is the
176
176
accumulated expertise that comes with those technologies (although that ain't nothing at this point). And if you *don't*
177
177
want some of these advantages (probably distributed hypermedia) you can go back to chapter 2, start the process over,
178
178
and end up with a differently optimized architecture.
179
179
180
-
I don't have any direct experience with GraphQL, though I'm about to get some at my current job, so take this with a
180
+
> I don't have any direct experience with GraphQL, though I'm about to get some at my current job, so take this with a
181
181
grain of salt:
182
182
183
-
On a technical level, GraphQL is solving a problem that's very common in API design: performing a database query across
183
+
> On a technical level, GraphQL is solving a problem that's very common in API design: performing a database query across
184
184
a network connection without sending a bunch of unneeded data over the wire. Looking at the docs I see it also has "
185
185
Mutations" which seem very SOAP-ish. I guess I'd say GraphQL looks like a modern version of SOAP, optimized for the
186
186
common case of querying a database.
187
187
188
-
Since GraphQL is independently deployable, supports multiple server implementations and defines no domain-specific
188
+
> Since GraphQL is independently deployable, supports multiple server implementations and defines no domain-specific
189
189
semantics, an interoperable domain-specific API could be built on top of it. Rather than exporting your data model to
190
190
GraphQL and clashing with a dozen similar data models from the same industry, you could get together with your peers and
191
191
agree upon a common set of semantics and mutations for your problem space. Then you'd have interoperability. It's not
192
192
much different from what we did with OPDS in the library world, defining what concepts like "bookshelf" and "borrow"
193
193
mean.
194
194
195
-
Would it be RESTful? Nope\! But again I'll come back to SIP, the integration protocol that public libraries use to keep
195
+
> Would it be RESTful? Nope\! But again I'll come back to SIP, the integration protocol that public libraries use to keep
196
196
track of loans. SIP is a level zero protocol\! It doesn't use any of the Web technologies at all\! But it provides
197
197
architectural properties that libraries value and vendor-centric solutions can't offer–mainly interoperability–so it
198
198
sticks around despite the presence of "RESTful" solutions.
0 commit comments