We don’t invest in themes; we invest in special founders with breakthrough ideas. Which means we don’t make investments based on a pre-existing thesis about a category. That said, here are a few of the things we’ve been observing or thinking about; we’re especially grateful to our founders/companies, and the entrepreneurs we meet with everyday, for their insights here…
Engineering management is hard. Mostly because programmers who turn managers start to treat people like code, and this not so good article on TechCrunch will tell you that is good, but it isn’t. Code is predictable. People are not.
Some key lessons so far
1.) You cannot lead a cavalry if you think you look funny on a horse: Self confidence is key
2.) Respect and leadership are privileges earned hard but lost quickly – Don’t lose it if you can help it, burn out the fire’s as quickly, if you cant.
3.) Ability to manage conflicts is key- data driven is the only way
4.) Every engineer on your team needs to constantly know what to do next
5.) You HAVE TO BE UPDATED On technology/code/processes and continue to be CODING – cant stress this enough, or you are the guy the developer’s say “Hey manager, we are about to finish this module and pull a late night, can you order some pizza’s for us” to.
6.) As tough as it might be, you cannot lower the hire bar – Absolutely zero tolerance, because bad hires come bite you back in the rear.
7.) You can employ carrot or stick method in certain situations – but caveat emptor
Thats what I have so far. Ill be updating this and have some sort of a value list as I experience more of engineering management.
I’ve enjoyed reading this piece and this piece on Engineering management, there are a lot of very valuable key lessons to take from them, so I suggest you read up on those if you are in this black art of engineering management
I’ve interviewed about 60-70 people so far,but during the all of the interviews(yes all of them) no one could really define RESTful API’s correctly. I realized that developers have a very convoluted understanding of what RESTful API’s are and in fact many of them use these API’s blindly. I know a lot has been written about it but most of it is either very large documentation or just shows best practices.
So I want to debunk some myths about what RESTful API’s are.
- REST is a protocol like HTTP ==> Incorrect, REST != HTTP
- Let me explain in bullets
- REST stands for Representational State Transfer. It is a framework – this can get confusing again, what the hell is a framework. So think of REST as a SET OF CONSTRAINTS(we’ll get to what those constraints are) to build highly scalable fault tolerant client server systems. The world wide web is actually a great example(and the biggest, but again slightly flawed) of REST.
- It IS NOT A PROTOCOL. A protocol in web parlance is a communication interface or rules that define how components communicate on the interweb (from types of data to the interface types)
- HTTP is a protocol. Hence REST ! = HTTP. But its the most used transport protocol with REST. You could as well use FTP or SMTP, but nobody likes those.
- Let me explain in bullets
- But most probably in your case and in most cases HTTP API == REST API, i.e. almost certainly your REST API’s aren’t pure REST, hence you really cant call them those
- Let me explain again in bullets
- Let me drill down the idea again – REST is a set of constraints. What are those constraints
- CLIENT – SERVER – Quite obvious
- Stateless – Every request you make must contain state information, this is the clients responsibility and the server is stateless
- Cache – Response messages from the service to its consumers are explicitly labeled as cacheable or non-cacheable.This way, the service, the consumer, or one of the intermediary middleware components can cache the response for reuse in later requests.
- Layered architecture – A REST-based solution can be comprised of multiple architectural layers, and no one layer can “see past” the next. Layers can be added, removed, modified, or reordered in response to how the solution needs to evolve.
- Uniform contract – Probably the most important of the lot and defines the REST aspect of REST API’s.
- Lets look at Uniform contract and what that means.The diagram essentially shows the important concepts.
- Lets now focus our attention on the word REST shall we. Representational State transfer. So clearly there It’s about transferring representations of the state. Of what though? Of Resources. Now what the hell are resources. A resource is a contextual mapping of entities that can fit into the URL model of the client – confused yet ? Example . Lets say I want to view a bank account from a database table on a remote server. My resource entity here is an account. Now if I want to get the detail of my account, how do I get it? I make a call over HTTP like this => serverurl/v1/account/acc_number which inturn is doing this
GET /account/acc_number HTTP/1.1 Accept: application/json
- The resource here is account, the Accept:application/json portion is basically the representation of data that is being transferred. And we are doing this using the HTTPVerb GET.
- So most important concepts here are Resources, Representations(Media Types) and HTTPMethods
- Now REST Calls for HATEOAS – a really weird acronym that stands for Hypertext As The Engine Of Application State. This basically means that a main constraint of any restful api is that the responses drive the API usage directions. i.e. because the server is stateless and the client has to know what the endpoints are to call , this data must be transferred back in the response as hypertext i.e. URL’s. Confused. Lets take the previous example.
GET /account/12345 HTTP/1.1 Accept: application/json
- Now with HATEOAS the expected response would be something like this(scroll sidewise to see the response)
HTTP/1.1 200 OK <?xml version="1.0"?> <account> <account_number>12345</account_number> <balance currency="usd">100.00</balance> < link rel="deposit" href="/account/12345/deposit" /> <link rel="withdraw" href="/account/12345/withdraw" /> <link rel="transfer" href="/account/12345/transfer" /> <link rel="close" href="/account/12345/close" /> </account>
- As you can see, the reponse, the “link”-tags allows us to find out the URLs that are needed for the specified actions for say Deposit or withdraw. THIS INFORMATION YOU WOULD HAVE NO CLUE ABOUT AT THE BEGINNING unlike most “REST API’s” today which document these. Getting the point?
- So for a RESTful API to be truly RESTful it has to have the uniform structure of Resources, Representation and Methods as well as conform to HATEOAS.
- IN GIST – HATEOAS basically implies that the only thing the client knows is the URI endpoint and everything from then on has to be driven by hypertext responses. This is violated the moment you document and expose individual. Another example is, lets say I am on STACKOVERFLOW. The only thing I know is the URL, I know who/what a user or a question is (resource), I know the media types(Representation) and the website itself provides you hyperlinks to navigate through the website. This pretty much represents HATEOAS and lends the architecture to decoupling of logic of client server, and this is what I mean by www i.e. the web is RESTful in itself. If STACKOVERFLOW was not built conforming to HATEOAS, and like most of the documented “REST API’s” these days, then instead of links, you would have to type in
stackoverflow.com/questions/<id>, replace id with the Question.id and paste that on your browser. MEH, see what I mean?
- Let me drill down the idea again – REST is a set of constraints. What are those constraints
- Let me explain again in bullets
- I am using JSON , that makes my API RESTful ==> Incorrect , if anything using JSON violates constraint 6 of REST, hence killing the fact that your API is RESTful
- If you look at the HATEOAS component defined before, its clear that JSON is not Hypermedia, and hence one of the constraints is lost and essentially your API is not pure REST anymore. There is work going on this area – particularlyJSON Linked Data – http://json-ld.org/ that makes the attempt to confirm to HATEOAS.
- So you could use XHTML to make your REST API Purely RESTful
- I should be using REST because SOAP sucks – or thats what they tell me. ==> Incorrect
- This might come as a shock to many who seem to have convinced themselves that REST is in someway the absolute holy grail of Webservices. Firstly REST and SOAP are two very different things. Here I go again – REST is a set of Constraints for good service architecture while SOAP is a protocol. Simple object Access Protocol. I think the whole REST is a protocol nonsense stems from the constant comparisons made between these two words. Its highly dependent on your business needs. SOAP is tightly coupling, both the client and server need to be clear on an interface of communication, but in large systems that have tightly coupled business logic and legacy applications, this is quite useful to have and certainly wouldn’t be needed to be replaced by REST.
REST – Representational State Transfer – Set of Constraints for building scalable fault tolerant client server systems, architectural framework
RESTful – Webservices that use the REST architecture
SOAP – Simple object access protocol
But here’s the thing, its hard to follow all the principles of RESTful services to the letter, and in many cases harmful. But hopefully this clears up some of the myths of what defines pure REST API’s. Its not ok when developers basically follow the myths I’ve presented, and are in the dark about what RESTful services really are. As long as what developers build are HTTP API’s that follow some best practices(another post on this to follow just for best practices for writing API’s- RESTful or otherwise) things should be fine in the webservices world.
Bonus Reading and Credits:
A word on Richardson Maturity Model – http://martinfowler.com/articles/richardsonMaturityModel.html
And the original Fielding dissertation on Rest – http://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm#sec_5_2_1_1
REST Cook Book: http://restcookbook.com/
Lecture 6 was by Alex Schultz – a very good talk on Growth.
- Self intro: Paid for college doing online marketing, directions marketing. I started with SEO in the 1990s. I created a paper airplane site, and had a monopoly in the small niche market of paper airplanes. When you want to start a startup also see how big the market could be. (In the long term, it wasn’t great.) But what that taught me was how to do SEO. And back in those days it was Alta Vista, and the way to do SEO was to have white text, on a white background, five pages below the fold, and you would rank top of Alta Vista if you just said planes 20 or 30 times in that text. And that was how you won SEO in the 1990s. It was a really, really easy skill to learn.
- Retention is the single most important thing for growth and retention comes from having a great idea and a great product to back up that idea, and great product market fit. The way we look at, whether a product has great retention or not, is whether or not the users who install it, actually stay on it long-term, when you normalize on a cohort basis, and I think that’s a really good methodology for looking at your product and say ‘okay the first 100, the first 1,000, the first 10,000 people I get on this, will they be retained in the long-run
- Every different company when it thinks about growth, needs a different North star; however, when you are operating for growth it is critical that you have that North star, and you define as a leader. That one metric that drives the company and a person who drives it.
- For Facebook the magic moment, is that moment when you see your friend’s face, and everything we do on growth, if you look at the Linkedin registration flow, you look at the Twitter registration flow, or you look at what WhatsApp does when you sign up, the number one thing all these services look to do, is show you the people you want to follow, connect to, send messages to, as quickly as possible, because in this vertical, this is what matters. When you think about Airbnb or eBay, it’s about finding that unique item, that PEZ dispenser or broken laser pointer, that you really really cared about and want to get ahold of. Like when you see that collectible that you are missing, that is the real magic moment on eBay. When you look on Airbnb and you find that first listing, that cool house you can stay in, and when you go through the door, that’s a magic moment
- Operating for growth, what you really need to think about, is what is the North star of your company: What is that one metric, where if everyone in your company is thinking about it and driving their product towards that metric and their actions towards moving that metric up, you know in the long-run your company will be successful.
Been busy with office work and finally getting a chance to continue blogging on what I learnt with the Sam Altman lectures.
Lecture 5 was by Peter Thiel. Thiel is notoriously famous for being a cut throat execution oriented investor and has invested in some of the most successful startups on the planet. His lecture was of course polarizing (wouldn’t have it any other way) titled Competition is for losers and mostly took out pieces from his very successful and highly recommended book Zero to One: Notes on Startups, or How to Build the Future.
1.) If you’re the founder, entrepreneur, starting a company you always want to aim for monopoly and you want to always avoid competition. And so hence competition is for losers!
2.) If you have a valuable company two things are true. Number one, that it creates “X” dollars of value for the world. Number two, that you capture “Y” percent of “X.” And the critical thing that I think people always miss in this sort of analysis is that “X” and “Y” are completely independent variables, and so “X” can be very big and “Y” can be very small. “X” can be an intermediate size and if “Y” is reasonably big, you can still have a very big business.
3.) If we look at perfect competition, there’s some pros and cons to the world of perfect competition, on one end of the spectrum you have industries that are perfectly competitive and at the other end of the spectrum you have things that I would say are monopolies, and they’re much more stable longer term businesses, you have more capital, and if you get a creative monopoly for inventing something new, I think it’s symptomatic of having created something really valuable.
4.) Companies lie for their own benefit regarding monopolies. Anyone who has a monopoly will pretend that they are in incredible competition; and on the other end of the spectrum if you are incredibly competitive, and if you’re in some sort of business where you will never make any money, you’ll be tempted to tell a lie that goes in the other direction, where you will say that you’re doing something unique that is somehow less competitive than it looks because you’ll want to differentiate. (Example, a restaurant not making money in Palo Alto will position itself as “Well we’re the only British food restaurant in Palo Alto” to seek attention of the monopoly they create. CounterExample of Google who have monopolized the search market but all press and PR is about Self driving cars and the competitive space they are in)
5.) Very counterintuitive ideas that comes out of the monopoly thread is that you want to go after small markets. If you’re a startup, you want to get to monopoly. You’re starting a new company, you want to get to monopoly. Monopolies have a large share of the market, how do you get to a large share of the market? You start with a really small market and you take over the whole market and then over time you find ways to expand that market in concentric circles.
So much of people’s identities got wrapped up in winning these competitions that they somehow lost sight of what was important, what was valuable. Competition does make you better at whatever it is that you’re competing at because when you’re competing you’re comparing yourself with the people around you. I’m figuring out how to beat the people next to me, how do I do somewhat better than whatever it is they’re doing and you will get better at that. I’m not questioning that, I’m not denying that, but there often comes this tremendous price that you stop asking some bigger questions about what’s truly important and truly valuable. Don’t always go through the tiny little door that everyone’s trying to rush through, maybe go around the corner and go through the vast gate that nobody is taking.
Now if you haven’t been catching up, its fine, my final post in this series is going to be an infographic on what’s been talked about so far and I absolutely recommend his book Zero to one – Buy it here, must read for anyone wanting to build startups