Code Story · Transcripts

S7 E20: Engineering a $1B GraphQL Data Federation Engine: Real-Time DB Queries with Tanmai Gopal of Hasura

January 24, 2023 · 27:55
Listen to the episode Download .txtDownload .vtt
Tanmai Gopal

Our product changes behavior. Right? Everybody likes the idea of changing behavior, but nobody actually wants to do it. Obviously, right? It's hard. And so we knew that if we want to change behavior, not only kind of does the experience of that automation and the time that you save need to be amazing, but in production when you're running this, it needs to be 10x better than what an expert would have built by hand. And even till today, when Hasura gives you an API, versus an API that you built by hand, Hasura is anywhere between 5x to 100x faster than the API that you built. I'm Tanmai Gopal. I'm the CEO co-founder at Hasura.

Noah Labhart

This is Code Story, a podcast bringing you interviews with tech visionaries who share in the critical moments of what it takes to change an industry and build and lead. that has your back. I'm your host, Noah Labhart, and today I'll tell you how Tanmai Gopal set out to enable the builders of the world to build modern apps much, much easier. All this and more on Code Story. Tanmai Gopal studied computer science and specialized in computer vision and machine learning. He found himself frustrated with the pace at which his research work was his jump into the industry, which helped solidify the foundation for his current venture. Outside of tech, he reads a lot, hikes and travels. For the readers, he highly recommends N.K. Jemisin, Charlie Jane Anders, and Naomi Novik. Tanmai and his colleagues became outright frustrated with building APIs just to build products. He began wondering what it would take to not do that work anymore. And after After breaking down the process to its simplest form, data mapping and security authorization, he had a bead on how to do that. This is the creation story of Hasura.

Tanmai Gopal

Hasura, the company, and our eponymous product is called the Hasura GraphQL Engine. engine what the product does is it helps people automate a big part of their api development by focusing on their kind of domain data modeling and product building by being able to kind of connect to different types of data sources and provide an api automatically with just kind of declarative configuration and then that api is now consumable by other services or integrations or applications that you're building so this is you know this works for transactional applications or analytical applications internal applications external applications right it removes a lot of while building a traditional API service. Just to paint a rough picture of the company, we've been around for about four years now. The core of it is an open source project that we launched four years ago and we launched our commercial offerings just about a year and a half, two years ago, both as a cloud offering, a managed cloud offering and an on-prem offering. Bulk of us in the US, about 40%, 40% in India and 20% all over. So Australia, Africa, Europe, South America. It came out of anger and frustration, Basically, we were building products. We were building products, right? And we were like, this business of building APIs to build products is just terrible. Like, I've already done the data modeling that I need to do. I'm using a mature database that allows me to represent the models that my product needs or that my service needs. It's a modern database, right? It's not a key value store. It's not a, I'm not chucking stuff into a file. I've done that work. I want to go build the product. Now, why am I doing this repetitive work of building these APIs that allows products and services to talk to this database? Every time you build it, it just feels like, why am I doing the same thing? And so we spent a lot of time thinking about what it would take to just not do that work anymore. Like, what's happening in this layer that needs to go away? And so when we thought deeply about it, we realized that in any API service that somebody builds, there's essentially just two pieces of work that you're doing. the first piece of work is this kind of mapping and transformation kind of work. The second piece of work that is very domain specific is security and authorization, right? Because you cannot give the end user direct access to manipulate centralized data, right? That's it. Everything else is performance optimization, caching, distribution on the edge, high availability, or repetitive stuff. So what we did is we came up with a declarative kind of language and an approach to automate this piece by saying, all you do as a developer is you step back and think about these are the models that I have. These are the security rules for each of my models, right? And you write that in code or you configure UI or whatever it is, and you're done. And your API is ready. And your API is super flexible. It does everything. It does filtering and pagination and streaming and analytical workloads and joining things across multiple databases. bases. All of that is done only requires the bare minimum domain specific specification or configuration and everything else is automated. And it worked and we got very productive. And so we were like, Hey, maybe I think, I think this feels like a good product to give to other people as well.

Noah Labhart

Let's dive into the MVP. So that first product you built, right? Pre-commercial open source, uh, when, when you were pissed, right? Tell me about that first product you built, How long did it take to build and what sort of tools did you use to bring it to life?

Tanmai Gopal

It went through several iterations before it got to the shape of what the world sees as Hasura GraphQL Engine today, right? The very first version of that was something that I built that automated the API development process with Mongo as a database. And me and one of our principal architects, the two of us kind of collaborated on building this out. We decided to use Haskell as a programming language, which was a very interesting choice. We used Haskell as a tool because what we were essentially building was a compiler that was simultaneously a web server, right? Because you're kind of taking this language that describes your domain and just in time compiles that to the upstream queries and things that need to happen to these data sources. But at the same time, it's also a web server that needs to be low latency and highly concurrent and stuff like that. And Haskell was a great choice for writing that kind of a system. It's a typed functional programming language. a small number of people can get really productive writing really good code and the code is very robust and so it's allowed us to kind of work really really quickly despite being so critical in the stack because of that choice of stack that we had and that the language and programming language that we made in those early days and then we started using postgres we changed the way our product would work as well from being something that was like static to dynamic like Like it's a runtime API service. So you don't have to rebuild Hasura. Every time you provide that configuration, you don't have to recompile. You just provide the configuration on the fly. So it's like Hasura is running. You make an API call to say, oh, I have three new models with five new authorization rules, go. And so within a few seconds, Hasura just processes that and your API is ready, right? So there's no like build, compile, deploy step that needs to happen. So we made the whole thing dynamic and we had our own API, our own JSON API. It was not a GraphQL API. That was kind of the super, super MVP when we started solving for our angle. So we got to the point where we were like, this addresses our pain points, right? But we still had to do more work to get ready to launch it.

Noah Labhart

So from that point, how did you progress the product, right? And, you know, the next phase is releasing the open source and then building the commercial product. But I'm curious about that product progression and maturation. And also to kind of add a little bit of context to that, how did you build your roadmap? okay this is the next most important thing to build or to do with Hasura.

Tanmai Gopal

When we kind of had the core of this tech and the base idea figured out is when we raised VC we went through a few months of getting ready to launch the first version and during that time we essentially just spent time talking to lots of different people and just showing them the technology doing like tiny hackathons and seeing how developers who we don't know if we give them documentation and we give them the product what their feedback was and we use that to basically is that to shave off things that were useful to us, but would not be useful to other people. And the big change that we made also was the API that we had was our own kind of sort of restish JSON API. We changed that to GraphQL because a lot of people, GraphQL was just starting to kind of, was just launched or just starting to pick up a little bit of steam. And so we changed the front end of our API to not be our custom thing, but to be GraphQL. And then we kind of got to that stage is when we launched it, we basically just made it open source. And that was really important because it's a critical part of your stack. And so you want to have a good user community around it so that people can understand what this is doing in this kind of very core part of your application stack. Right. That built a lot of trust, but also allowed us to kind of keep getting a lot of feedback from the community very quickly. And so the first year after launch, the roadmap is kind of infinite. Right. Because imagine all of the crazy stuff that people do with their APIs. Right. that you want to automate. And so what we would do is after we did kind of this bare minimum thing that we knew would take care of 80% of our anger and frustration with building this layer, the rest of the 20% we left open and we just kept reacting to what our user community was saying. And that got us to a stage of maturity where we started seeing enterprises and large companies starting to just use it, connect it to their existing data and start deploying it in production, right? Some of the key decisions that we made at that point, which are really important even today, example a lot of people think about Hasura and they think of it as kind of like this replace is kind of like a firebase thing or a back-end as a service thing and whatnot one of the things that we were very conscious about is that we want to make sure that we help people build APIs and enable access to existing data and not just be a tool for greenfield applications right or for building new applications because there's just so much value that's kind of sitting there in this existing data that if it's mobilized people can start building amazing applications and experiences with it. We took like very opinionated calls on saying that we are not going to host the database. It's a data API for your data, for existing data, right? And that allowed us to get like a breadth of users who are trying it out with their existing data and learning from them and improving the product to get to the checkpoint where we started seeing large companies connecting it to their existing data and building applications and APIs very quickly, going into production very quickly. one of our first chats with largest networking routing technology giant in the world they deployed this introduction where you know they were like i i would have taken a year to do this and i did this in a month those kind of opinions of like being clear about this is the place where we want to add value and what we want to focus on replacing and we don't want to do other things and it might result in us not being able to capture some users but that's okay because the the long-term roadmap is to replace all of the API development that people do, but not replace the work that the database ecosystem is doing and how they're going to evolve, right? Because databases are changing rapidly. There's a new database every month, it feels like, right? Wasn't so two, three years ago, but we felt like that's what would happen. And that's what is happening today, right? You have like a literally a new OLAP or a new OLTP or a new HTAP or whatever, like a hybrid system that's being created every month or so. We wanted to enable that entire ecosystem. So we took a few decisions like that, to kind of mature this and get traction in mission critical environments as quickly as possible.

Noah Labhart

Okay, let's switch to team. So how did you go about building your team? And specifically, you know, what did you look for in those people to indicate that they were the winning horses to join you?

Tanmai Gopal

It's a little bit of a journey, especially for me as a first time founder. But I think what has helped is, for example, in the early days, it was very much about the kind of DNA that we want to create, right? Which is very product-centric, developer-led, community-led. And so the type of people who were deeply technical, very product-facing, very kind of mission-driven, right? Were really important and critical to the business. And still are because they're the core layer that drives the business, right? same time, what was really important was to complement at the kind of more executive level. Three of us as a founding team were very different in kind of our inclinations and skill sets, but very closely aligned in what we were doing. And that was really important in the early days and still is because I kind of brought a product engineering shape of the product and the company mindset. My co-founder, Aushy, brought the community and like the hustle that is required to take this out to the world. The more technical and amazing the DNA of that product tech gets for a company, the lesser you get of the, let's go out there and make mistakes and learn and just hustle. And then Anand, who heads our finance and operations, brought in a rigor, right? And holding us accountable to why we're doing something and what we're doing, right? Of like realizing that, hey, everything's great, but like these are the steps that we need to execute on, right? This is the health of the business and this is the governance that is required at each stage of the business or that we need to keep an eye open for right because we still we wouldn't know what the problems are all of us are first-time founders i think that grouping and that complementary kind of skill was really important in navigating the early stages of our journey and setting us up well for when we would reach certain checkpoints in the business to bring in other people to the business and to either as ICs or middle managers or executive leaders in the business who would then be able to take something we could. But it was kind of that group of people that was able to see those patterns and realize that we need those people, right? And then I think for us, it became very like based on kind of where we are and what we need to do, right? So for example, when we wanted to start building our sales engine, we knew that we wanted somebody who came from an open source infrastructure background and that person would come in and kind of lead our sales, right? So then it became easier to understand the shape of the people that we would need for those particular things.

Noah Labhart

Okay, let's flip to scalability. And this will be super interesting, given the product you've built. So was this built to scale efficiently from day one? Or have you been fighting this as you grow or, you know, go more commercial? Tell me a little bit about that.

Tanmai Gopal

I think we built it to scale from day one because we knew otherwise there's no, it's hard to build a business around this, right? I think it's, I think it was more of a gut instinct that we articulated only very recently the importance of that. Maybe it's luck or maybe it was just good instincts that helped us that we made sure that we're going to build something that is scaled from day one. Like, for example, some of the decisions that I talked to you about, right, where we decided not to work with, not host the database, but work with existing data. Those are kind of product scalability things. But also the technology of the product being scalable, right? Our product changes behavior, right? Everybody likes the idea of changing behavior, but nobody actually wants to do it. Obviously, right? It's hard. And so we knew that if we want to change behavior, not only kind of does the experience of that automation and the time that you save need to be amazing, but in production, when you're running this, it needs to be 10x better than what an expert would have built by hand. And even till today, when Hasura gives you an API versus an API that you built by hand, Hasura is anywhere between 5x to 100x faster than the API that you built. Because of that approach that we took, and we were very conscious of that secret sauce, meaning the open source sauce or whatever, right? In the technique that we use to compile and create and do things. And without that, we would have not gotten the early mission critical adoption, right? are like, I'm excited about this. I'm building a side project. And that's great. That's amazing. But that doesn't convert into running a workload for 20 million users on an application, right? Like that, that comes from that focus on somebody who's a serious engineer and architect signing off and saying, oh, this is fast. Like this is good, right? Like this knows what it's doing. Like this replaces like five years of my experience and understanding and familiarity reality with the space and puts that into code.

Noah Labhart

As you step out on the balcony and you look across all that you've built, what are you most proud of?

Tanmai Gopal

I think the team, right? Like I love the team that we built. Like I've been working with folks for over eight years across the different businesses. And there are folks in the team that I've been working with for a long time and seeing them grow and growing and working and tackling new problems every day and bringing bringing new folks onto the team and just watching everybody kind of work together and be kind of that mission driven in saying this is how we want to solve the problem. And I'm so happy and thankful that we have a very like very apolitical and very egoless at almost all layers of the team, right? And that's amazing to see because everybody just cares about like what we're doing and trying to make that better and navigating so many complexities, right? Everything about like pandemic and remote work and distributed teams for the first time and, you know, not having a product organization and only being engineering and then having that to building out a GTM team, which is just like, mind blowing thing for a engineering team, right? You're like, what is this GTM thing? Sure, money should just come and rain from the sky. Do you have to build a team that does that? That doesn't make any sense, right? Like all of that, all of that kind of coming together with a bunch of really good people that like gives me a tremendous amount of happiness at a day to day level. And then maybe if I step back a little more, I think I think just the sheer number of businesses and users and applications benefiting from what we've done is kind of amazing, too. It's like you step back and you're like, ooh, that's a lot of work that we automated. Like, that's a lot of, like, actual people in the world that we made happy. We made their lives better through our work. And feeling that connect is an amazing feeling, too, right? It's a little more meta. Like, you won't feel that at the day-to-day level. But at the day-to-day level, it's the team that's building all of this.

Noah Labhart

Okay, let's flip the script a little bit. Tell me about a mistake you made and how you and your team responded to it.

Tanmai Gopal

Countless mistakes. When we were just starting the company and the product, right, the product that we built was more of a platform that solved our problems and that did a lot of amazing things. But all of these were just amazing pieces of technology and in parts, the developers that we would talk to and our internal team and other developers who were using this tool would love. And when the kind of time came to launch this as a product, when we realized that these other pieces are getting in the way, within a week, we killed everything. And we just took the data API part and moved forward with that. we just killed like everything and we erased traces of that on the internet and I think that our ability to do that together from all the way from like kind of like a quote-unquote executive team small team at that time right to individual ICs who are working on it but to be able to move that quickly on something that is a tough thing to do right because it's a a pretty emotional like it's an emotional thing that's like we don't realize it often but we're pretty attached to the work that we've created and the artifacts that we've created but to be able to kind of forget the past and look towards the future all the time without necessarily blaming anybody else right it's like yeah you built this but it's useless right like why did you do this or like why did you build and and that's like a big thing but it shows up every single day even today where like our ability to fail quickly and forgive our own failures but move fast while still preserving the team dynamics and kind of moving forward. I think that represents for me the most important thing in our ability to kind of make mistakes and learn from them, right? And it kind of goes back almost to like the way the company was founded and even the way that we operate day to day, right? Which is the reason why we don't stress about like making experiments and I think in the industry it's also called win or learn, right? Like there's no fail, you win or learn, right? You do a thing that is designed to win, but if it fails, you make sure that you learn And I think that trying to drive that across the organization has been useful. And that kind of shows up in the day-to-day for every time we make a mistake and then we learn from it and we react to it. It's that piece.

Noah Labhart

So what does the future look like for the product and for your team?

Tanmai Gopal

Very, very straightforward. forward the first phase of the business is to essentially make sure that Hasura is the default api in front of every single data store on the planet we started off with postgres we just added bigquery and snowflake recently we're adding support for mysql mongo this year and just like grab like we're going to kafka redis etc so so just being the api in front of every single data service on the planet and really exposing their capabilities to to product builders and api is just horizontally scaling to as many sources of data that exist and continuously kind of keeping that. So when you use Hasura with Postgres, you get what Postgres is really good at. When you use Hasura with Kafka, you get what Kafka is really good at. It's not the least common denominator that you're getting kind of like, yeah, here are the two things that are common between Kafka and Postgres and MySQL. And so those are the two things that Hasura does. Here are the 10 things that we do for Postgres. Here's the 11 things for MySQL. Here's the three things for Kafka. Maybe there's an overlap, is also like really bringing out the best of that data source. And that's really like our product roadmap for the quarters and years to come. On the team side, a lot of that is focused today on building out the GTM parts of our team. We had a very nascent sales team last year and a marketing team last year. We're maturing those bits of the team this year.

Noah Labhart

Okay, let's switch to you, Tanmai. Who influences the way that you work? Name a person or many persons or something you look up to and why.

Tanmai Gopal

I think lots of people in bits and pieces, including some things that are controversial and some things that I think are things that you would expect. One of my earliest influences was, of course, my father. He's like a powerhouse intellect, right? It's just like, and coupled with this amazing discipline and rigor in the way that he just approaches things and systematically does things. And I'm like, I am never going to be as good as that. think that was a very strong early influence that's helped a lot both of my parents kind of contributing to that it's weird when I go back to things and I'm like a lot of the way that I operate is has been so influenced by them but then when I kind of look at work that I'm doing today and and think about more topical influences right and and I look at everybody from when I when I when I look at a character like Elon Musk which is so controversial but the ability for a person on like that to still make mistakes in public at that scale is amazing right in every shape or form right whether you agree or disagree right like you you can agree or disagree with the person but my goodness right to just be like to have opinions that make no sense to decisions that are so risky right is it's just fascinating to watch a human like that operate and be like i cannot be afraid of failure because like look at that right

Noah Labhart

okay so we talked about a mistake earlier but a little bit different spin if you could go back to the beginning what would you do different or where would you consider taking a different approach doesn't have to be a mistake could have worked out but maybe you tweak it a little bit

Tanmai Gopal

i think product engineering like product building is is art especially in the early days right but that stage of like creating nothing from something and And then maturing that something, a roadmap to mature that something, which is like a one to 10. I think in hindsight, that bias that we had to thinking of product as an art, GTM is never an art. GTM is science from day zero. There's creativity to it. I don't mean it in that sense, but it's measurable. It's very hypothesis driven, right? You're creative in what you do to meet a particular hypothesis or what you do to meet a particular objective. But it is literally an Excel sheet from day one, like day zero. Product is not like that. Product is, you can't put that early stage of a product necessarily in Excel sheet. It's not easy. You can put parts of an Excel sheet, sure. If I could go back and I could inculcate two simultaneous mindsets, it would be that understanding of saying, it's okay to be instinct driven and learn on the product side, but the GTM side needs to be science-y from day one. And I think that second bit flip is something that we did a little, is something that I feel like we learned a little late, right? If I could go back into that earlier, we would have been where we are today, like two years ago. Just given the energy of the ecosystem and the product and the space that we operate in and the underlying secular forces of the amount of data that's exploding every day. People want to build like a bazillion products and stuff like that.

Noah Labhart

Okay, Tanmai, my last question. So you're getting on a plane and you're sitting next to a young entrepreneur who's built the next big thing. They're jazzed about it. They can't wait to show it off to the world. Can we show it off to you right there on the plane? What advice do you give this person having gone down this road a bit?

Tanmai Gopal

I think being intellectually honest with why you're doing that and channeling that energy appropriately would kind of be the theme of like my approach in a conversation or maybe the specifics of my conversation. It's always about saying that, why are you doing what you're doing? Everybody can say change the world or make money or whatever, but like the shape of it, right? The shape of the way that you want to do something. Why are you doing it this way? And then helping channel that energy appropriately. Because once you get very clear about why you're doing something and you can align your energy to an outcome, you can also get really clear about realizing where you don't have that energy and you can't channel it towards other outcomes that are important for the business. You start seeing your blind spots better and you can complement that much better, right? To me, that's kind of like the seed and the machine that helps the product and the business keep growing, right? It's being able to understand like the why of why the person and the team does something and then channeling that appropriately.

Noah Labhart

That's great advice. Well, Tanmai, thank you for being on the show today. Thank you for telling the creation story of Hasura. Thank

Tanmai Gopal

you so much for having me, Noah. and

Noah Labhart

this concludes another chapter of Code Story Code Story is hosted and produced by Noah Labhart be sure to subscribe on Apple Podcasts, Spotify, or the podcasting app of your choice and when you get a chance, leave us a review both things help us out tremendously and thanks again for listening

Transcribed with Whisper and reviewed for names and terms; speaker labels are automatic and may contain small errors. Timestamps link to that moment of the transcript.