Code Story · Transcripts

S8 Bonus: The Bare-Metal Database Revolution: Engineering C++ Thread-Per-Core Systems and Overthrowing the JVM with Dor Laor, Co-Creator of KVM & CEO of ScyllaDB

August 30, 2023 · 22:22
Listen to the episode Download .txtDownload .vtt
Noah Labhart

We

Dor Laor

stumbled across several databases, and specifically also Cassandra, when we wanted to demonstrate how those general applications and databases included run faster on the OS that we created. We discovered that Cassandra isn't running faster on our system, unlike many other applications. The reason was that it was written in Java and while the Cassandra design and architecture are highly scalable, the per unit economic of the implementation weren't as good. So we realized there is an opportunity here and we had to pivot away. I'm Dor Laor, I'm the co-founder and CEO of ScyllaDB.

Noah Labhart

This is Code Story, a podcast bringing you interviews with tech visionaries. Six months moonlighting. There's

Dor Laor

nothing like the

Noah Labhart

backhands. Who share what it takes to change an industry. I don't exactly know what to do next. It took

Dor Laor

many goes to get right.

Noah Labhart

Who built the teams that have

Sound bite

their back. The company is its people. The teams help each other achieve. Most proud of our team.

Noah Labhart

Keeping scalability top of mind.

Sound bite

All that infrastructure was a pain. Yes, we've been fighting it as a group. Total waste of time.

Noah Labhart

The stories you don't read in the headlines.

Sound bite

It's not an easy thing to achieve, my dear. Took it off the shelf and dusted it off and tried to begin.

Noah Labhart

Deride the ups and downs of the startup life.

Sound bite

You need to really want it. It's not just about technology.

Noah Labhart

All this and more on Code Story. I'm your host, Noah Labhart. And today, how Dor Laor is building the world's fastest distributed database, enabling you to break the barriers of scale. Dor Laor lives north of Tel Aviv, Israel, but travels four times out of the year to the States. He loves tech, which drives 200% of his day. But outside of tech, he's married with two teenage kids and enjoys extreme sports. At the time, he does snowboarding and mountain biking, mentioning that the best place to mountain bike was a ski resort in France. He would also love to do surfing, but hasn't found the time to hit the waves around Israel. Dor and his co-founder met long ago at another startup. Post-acquisition, they listed ideas of what they wanted to start building next. They decided to build an operating system like Linux, and noticed that databases still didn't run faster within this system. They decided to tackle distributed NoSQL databases instead. This is the creation story of ScyllaDB.

Dor Laor

ScyllaDB is a database company. It's a NoSQL database. We have open source offering, which pretty much that's the basis for our product. An enterprise offering and as a service, we excel in scalability and high throughput environments. environments. My co-founder and I, we met back in 2005 at another startup. That startup happened to pivot three times. And eventually, Avi, my co-founder, brought a brilliant idea to that previous startup. And he invented the KVM hypervisor, which I managed. And we had lots of mileage together. And the company was acquired by Red Hat. We wanted to start our own thing. and we listed lots of ideas on a paper. One of them was actually a database, but it was the end of 2012. And we thought, nah, most databases were already built. There's nothing unique to come up with. So we decided to do something else. A new operating system from scratch that was supposed to compete with Linux for virtualization workloads. Usually when we say a project, it's everything from scratch. So we started the company with writing a new operating system, like a crazy endeavor. And this project was technically successful. It still exists today, but we didn't get the traction we wanted. We stumbled across several databases and specifically also Cassandra when we wanted to demonstrate how those general applications and databases included run faster on the OS that we created compared to Linux. that Cassandra isn't running faster on our system, unlike many other applications. And when we realized why, the reason was that it was written in Java. And while the Cassandra design and architecture are highly scalable distributed database, the per unit economic of the implementation weren't as good. And Java is a great language for management application, but not for infrastructure. structure. So we realized there is an opportunity here and we had to pivot away. So this plus additional research led us to pivot into the database space and we decided let's write a new database. Usually when you do that the second question is why write a new database? So we decided to combine the two and write a new database with an existing familiar interface like a So this is what we've done with the pivot. And this is how we came up to the database world. And it's today, after years of years of working on databases, I know how much I do not know. So it was a crazy thing that only a young startup desperate to find an angle can do. it.

Noah Labhart

Let's dive into the MVP then. So that first version of Scylla that you built, how long did it take to build and what sort of tools did you use to bring it to life?

Dor Laor

Cassandra is written in Java and we wanted to use C++, especially modern C++. Back in the days, it was C++, I think it was was 12 or so. And nowadays there is C++ 23, very different than the C++ I learned in university, much more advanced with Lambda functions and all. So highly recommended. Though now we have newer languages like Rust. So we use advanced C++ and we basically cloned all of the goodies of Cassandra while we had our own unique design with a shard per core approach. So that's the the idea. The shard per core is a notion where you run one thread on one processor. And if you have a server with 20 processors, then you run 20 threads and all do the same work with a shared nothing across the board. And the first step wasn't to create a full database because it's complicated. The first step was where we created a library. We called that library Seastar. was a name play on Cassandra because shorthand for Cassandra is the letter C and the letter star. So it was a library to do distributed simple apps. And the first one we wrote was an HTTP daemon that was very basic, but could handle millions of requests per second on a single machine. And the next step towards an MVP was to come up with the database itself with Scylla that can do a million operations per second, still be distributed, and we didn't have all of the more complicated indexing. As an anecdote, we had an investor who said, why are you insisting to write the database as distributed on many machines? That's harder. Just can you release a version that just runs on a single machine? But that was not every MVP. Sometimes it's too minimal. One of the basic things that you expect from a distributed database is to be distributed. So it was a kind offer, but not relevant.

Noah Labhart

So you've got your MVP. It's working. How did you progress the product from there and mature it? I think what I'm looking for there is how you went about building your roadmap and how you decided, okay, this is the next most important thing to build or to address with Scylla.

Dor Laor

So like all startups, it's difficult to build a roadmap. One of the easier jobs that we had was that because we're API compatible or we strive to be in the early years, we strive to be API compatible. We just needed to implement the API and in a much better way than the origin, because otherwise, why use us at all? So the roadmap in the early days was just to implement and to have a full complete API where we'll be able to migrate people to the new database without code changes on the client side. And the first MVP we used as a beta was more of an alpha, but we didn't even know that it's not that applicable as a beta back then. A year later, we started to have customers. So overall for a database product, the development was relatively fast. There was the beta, then we went to a stage where we were full API compatible with Cassandra. Afterwards, we started to add some of our unique features on top of it. So eventually we had time to develop our own features, and And we also added compatibility with AWS DynamoDB, which is from the same family of databases. So that was another big development.

Noah Labhart

So how did you go about building your team? And what do you look for in those people to indicate that they're the winning horses to join you?

Dor Laor

The team was very heavy on engineering and especially infrastructure. structure. And lots of the team members got to us through the KVM hypervisor project and from Linux. And I was searching through my network, through Red Hat, my previous employer, and other open source, like we had the name for innovative group is very capable. So that attracted more and more people and really good people that joined us attracted their own communities. So it was a good small snowball of excellency. So that was for the core technical team. Nowadays we're about 160 people overall worldwide and engineering is half of the team and what we're trying to do is to to trying to make sure that other teams are as good and as quality as the core engineering team we've got. You get, especially as a co-founder and CEO, you get to uncharted territories where sometimes you may not know the definition of good in areas like sales and marketing and partnerships and all that. that. But nowadays, we have a really strong, imbalanced leadership beyond the technological team.

Noah Labhart

This next question will be interesting, given what you're building and how you're going about building it. And I've heard the stories thus far, MVP and progression. But I want to talk about scalability. And I want to give space for an answer of how you approach that. Was it built scale efficiently from day one? Or is there anything you had to fight as you grew and gained traction?

Dor Laor

There's different types of scalability problems. Some of them in tech, some of them aren't in tech. But it was obvious for us that the core product is supposed to be highly scalable. Sometimes even try to build it even more scalable than what it really needs to do. So we did a billion operations per second benchmark. Not a million operations, but a billion, and no one needs a billion. So sometimes you overshoot, and we had our fair share of premature optimizations. One of them was TCP kernel bypass that we did to bypass and accelerate networking, and it wasn't really needed, required. We realized that, and we never used it in production. There are other areas outside of the core product where you need scalability and many times we didn't do the right decision with the shift towards the cloud and managed product. Database as a Service, I think that we started with too small team to accomplish the goal we wanted to have. And it took us a time until we added more enough resources to make it as good as it's supposed to be. And we're still growing it now. And there's more demand and infinite amount of things to do there.

Noah Labhart

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

Dor Laor

I think that I'm mostly proud of the team. We've been out there for a long period of time and we have core team members who've been with us for 10 years. So I'm really proud that we managed to exist for 10 years. Nowadays, we're just one notch to be a cash positive. So I'm pretty sure that we'll be able to live another 10 years. Very pleased with the trust in the team we managed to combine.

Noah Labhart

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

Dor Laor

The whole original project was a mistake and it was relatively hard to recover from it. And I think that it took us too long to realize that the first path is a mistake. To compare with in the previous startup where Avi and I were the first employees and my existing chairman was back then. the CEO, they managed to do three pivots and not one. So we were slow to identify a mistake as a mistake. So that was mistake number one. We didn't do huge mistakes afterwards. We always do mistakes, but I think that we're trying to minimize the time. I think it's good to have a culture where where mistakes are fine as long as you do it in a careful way. And as long as you know, OK, let's take this project. It has risk, but we can capture the risk and the risk is capped. And if we have reasonable KPIs, we'll be able to revert and change course without it being too much demanding.

Noah Labhart

Okay, this will be fun to ask and hear from the founder's perspective. What's the future look like for the product and for your team?

Dor Laor

From the very beginning, we wanted to be the number one NoSQL company. Even sometimes go beyond NoSQL, not necessarily either to relational or to other frameworks and to do more. Every week we say no to more initiatives and sometimes, or even over years, we stayed on the same rails that we originally started to create the best NoSQL. So this is still our journey. In the past, we used to say that Scylla can provide you the power of Cassandra at the speed of Redis. Redis is super fast cache. So I think that we achieved that part. And now we're trying to go after DynamoDB, which leads the industry in terms of usability. It's the most mature SaaS database. And we're trying to make Scylla as usable as DynamoDB. We've almost accomplished the infrastructure needed to be very elastic, have the ability to send data across many machines as fast as possible. So if you have a workload which is very dynamic, let's say you have users that may arrive at any given point in time, social network type of vendor that needs a database, and every minute you can have a gigantic spike, but you do not want to pay for all of the infrastructure all of the time, then this elasticity assists you the most. And we now have it in the core product, and we're going to deliver it next year. So this is very promising for us. it will help many users in their workloads.

Noah Labhart

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

Dor Laor

Obviously, there's plenty of people within the company, either individual contributors or executives. And we had several really great executives who joined us recently who improve the way the organization and the way I see things. But someone that really helped me along all of those years, and if it's helpful for other entrepreneurs in their early journey, is I personally enjoyed from Benny Schneider. He was the CEO of the previous startup I worked for and invested in us initially as an investor. And he's also our active chairman. Now, he has this role as an active chairman, as an investor, but basically is a friend. Trust his judgment 100%. And it's really great for an entrepreneur and a founder to have someone to consult with who was in that scenario. And also, it's not just an advice where you get an advice from someone who you just met and you tell them your story for an hour and the output is an advice. It's someone who companies use for a long time and is familiar with the company. So he helped me a lot and helped the company a lot just by being next to me and making sure I won't do silly mistakes here and there or just sometimes to reflect all of the complexity and the decision-making issues I have to make. So I recommend everybody to have someone like that.

Noah Labhart

Okay, we talked about a mistake earlier, but this is a little different spin. If you could go back to the beginning, what would you do different? Where would you consider taking a different approach? It doesn't even have to be a mistake. It could have been something that worked and worked well, but maybe you'd tweak it a little bit.

Dor Laor

It's not easy because sometimes if you go back in time with the knowledge you have, then you may do things differently but it's a knowledge that you currently have one thing that it would have helped a lot is back when we started and in the early days SAS wasn't that much of a thing and we built the product as a standard open source plus an enter matching enterprise offering that can run everywhere but if some companies like snowflake early on figured out that And obviously, AWS. If we would manage to do that shift very early in the process, then we would have been in a much, much better place just by spending more years on a cloud-native solution with as-a-service approach. And if someone here and there, when I speak with people who work at newer companies, people contemplate between enterprise and as a service, and mostly the answer is supposed to be as a service. Just abandon the other option and focus on as a service because it's impossible to do everything good and better just have focus.

Noah Labhart

Dor, last question. So you're sitting 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't wait to show it off to you right there on the plane. What advice do you give that person having gone down this road a bit several times?

Dor Laor

Just to find someone that you can 100% trust and share everything without any reservation and without being afraid of bias and just have pure consultation with. It can be an official role or a friend or other founder from another company where you just sit and share the problems together. So that's number one. Number two is as an entrepreneur, you're going to meet amazing people. And it's always good to hear their advices and also to ask for advices. However, it doesn't necessarily mean that any advice that a fantastic person, very successful and accomplished, gives you may not be applicable to your business or to you personally as you have your own character. So it may be the wrong advice or the wrong timing. So the best is to, if you hear a good advice and you really contemplate to adopt it, try to receive another advice, a counter advice that have an opposite outcome, and then decide between the two.

Noah Labhart

That's great advice. Well, Dor, thank you for being on the show today. And thank you for telling the creation story of ScyllaDB. Thanks

Dor Laor

a lot. It was a pleasure to be here.

Noah Labhart

and this concludes another chapter of Code Story Code Story is hosted and produced by Noah Labhart be sure to subscribe on apple podcast 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.