Surprising Advice For Startups

Clustrix just exhibited at two good shows: Structure and Velocity. I spent my time at Structure. One of the highlights of the show for Clustrix was the The Future of SQL In the Cloud panel that Paul was on. There was some good discussion about SQL vs. NoSQL and different products available for scaling your database. The title is a bit of a misnomer, however. Database challenges are orthogonal to the cloud. The database is a critical challenge no matter how the application is deployed.

But this isn’t what surprised me the most at Structure. That came in the How Does a Company Scale in Real Time? panel. This panel had representatives from PayPal, Engine Yard, Yahoo!, Facebook, and Zynga. These panelists are all responsible for ensuring their products continue to function smoothly. These companies are all recognizable and successful. I was really hoping to hear some good insight into operating large scale web properties and perhaps some good advice for new web startups. I think the money question came at around 16:30 in the video. Jonathan asks the panelists to rewind the clock and say what they would do differently and to give advice to startups for what they should focus on to avoid application bottlenecks. There was a lot of advice offered. There was talk of establishing a single-signon infrastructure. There was emphasis on avoiding SQL entirely, saying it is far and away the biggest scalability problem in web architectures today. There was a suggestion you should invest up front in separating out your architecture. You should think hard about the abstraction layers in key parts of your system and get the infrastructure right first. Another talks about getting the right instrumentation and metrics in your application. You should put in the right levels of abstraction, and the right levels of caching. You need to force yourself to run your application on two servers. Think about sharding and replicating at the beginning and force your scaling challenges to come up in advance before you have to scale.

None of this advice resonated with me. Startups have enough challenges finding the right business model and securing the initial set of customers. Why would you spend your very limited money, and more importantly, time on infrastructure and architecture of the back-end before you’ve proved your business? Matthew Mengerink, VP of Customer Quality, Engineering Services, and Site Operations at PayPal finally stepped in and made some sense. He says he would do nothing different. To him, a startup working on architecture is a waste of a dollar. He advises spending your time and money on making the business model work. Thank you, Matthew!

This discussion reminded me of a post titled Start In the Middle I read a while ago. In there, it offers a bit of advice that should be obvious that is so often not: solve the interesting bit of the problem first. Prove there’s value in the core idea, and then flesh out the infrastructure around it. Do what makes your business unique first and put the majority of time into that. Delay building the rest of the surrounding architecture until its really needed or when possible, just buy those bits. The rest of that BS is not what your customers see and not what makes you money.

So what’s my advice? Make the code and architecture as simple as you possibly can but no simpler. Don’t abstract too early and don’t make premature optimizations. Rewriting code and adding abstractions later is not a sign of coding failure, rather it’s a sign the product is successful. Choose the data model that fits your problem. That is frequently SQL. Full transactional and relational SQL is exceptionally expressive and it fits many problems so well. Why wouldn’t you use it? Don’t re-invent things that are not part of your core business. When the product becomes successful and the load starts to ramp, collect hard data to find the bottlenecks and fix them when they become a problem. When your data shows that your database is that bottleneck, perhaps Clustrix can help.

Posted in Technology | Tagged , , , | 2 Comments

Not All Clusters Are the Same

There are a wide variety of techniques out there for clustering storage appliances. The question is: what problem are you really trying to solve? If you look at Isilon’s clustered storage appliances (where I was chief architect), you’ll see that the clustering is done at the block level. The block addresses are generalized into a generic (node, drive, block_num) tuple and the on-disk data structures simply use that generalized address everywhere a block address would normally be used (plus a bunch of details I’m glossing over). The communication on the back end of an Isilon cluster is block reads and writes, transaction messages, and lock messages (plus some other miscellaneous bits). Each read or write operation is controlled by the initiator, and the smallest granularity of locking is at the block level. Cache lives both at the disk and at the initiator. If you were to put it into an architecture category, you’d call it an Infiniband SAN (Storage Area Network). This is perfect for a file system. This architecture lends itself to zero-copy, extremely high-performance file access for streaming files, very low CPU utilization on the nodes holding the disks (which allows the addition of the accelerator nodes for high speed FibreChannel and 10GbE), infinite scalability, and extremely low latency for operations on cached data.

However, it doesn’t support high read/write concurrency on a single file. Imagine if you ran an OLTP database with a high write load using an architecture like that. With the locking done at the block level, you can never expect to get high concurrency for items smaller than a block. Every node that wants to write to a block would have to get an exclusive lock on that block, which invalidates other nodes’ caches. If you had an active table with massive read/write load sitting on top of a cluster like this, performance would tank, dominated by lock contention. Then why do some databases take this approach to scale? How can you possibly make a shared-backend cluster resembling a SAN and expect it to scale with a database workload like some have done? How can you make an expandable storage engine plug-in and expect the entire database to scale? What works extremely well for a file system does not work at all for a database. We need a new approach.

Clustrix has a new approach. Rather than shipping the data blocks on the back end, we ship the queries. That may sound like an innocuous statement, but really it has a far-reaching impact on the architecture. To learn more, read the white paper A New Approach: Sierra Distributed Database Engine that I wrote on this subject. It shows how Clustrix has taken a novel approach to solve the clustered database problem, resulting in a database system that can handle high concurrency at any scale.

Posted in Technology | Tagged , , , | 1 Comment

The Tyranny of the OR vs. the Genius of the AND

Jim Collins and Jerry Porras first coined this phrase in Built to Last. In their book, they describe how choosing between seemingly contradictory concepts—focusing on this or that—leads to missed opportunities. Is the product low cost or high quality? Do I focus on short-term opportunities or long-term strategy? Should the company be bold or conservative? Built to Last is focused on business and what makes great companies continue to succeed year after year. Collins and Porras discovered that the best companies find a way to embrace the positive aspects of both sides of a dichotomy, and instead of choosing, they find a way to have both.

These same dichotomies exist in technology. Some common dichotomies include: low power vs. high performance, high stability vs. new features, and ease of use vs. flexibility. These are false choices. You can have high performance and low power—just look at the huge gains made through die shrinks. You can have new features without sacrificing stability with the right development process and proper QA. You can have an easy to use product that also enables maximum flexibility. All it takes is thoughtful design. We can embrace “the genius of the AND” here, too.

The tyranny of the OR still is strong in the database world. Do you want relational and ACID capabilities or do you want to be able to scale? An entire movement has been formed to answer this exact either-or question: the NoSQL movement. Digg has blogged about it (http://about.digg.com/blog/looking-future-cassandra and http://about.digg.com/blog/saying-yes-nosql-going-steady-cassandra), talking about how they did a large rewrite of their code to move to Cassandra, working around limitations in the process. If you look at the Digg blogs, they really did have a point. Once you scale beyond what a single box can do, you had two options: partition the database or move away from traditional relational databases. In both cases, you lose relational capabilities. You can either have scale or you can have the functionality you need.

They did have a point. Clustrix now offers a third option. The Clustrix database offers full relational and transactional capabilities and it can scale. The Clustrix product speaks the MySQL protocol on the wire (but uses no MySQL code) and allows seamless online scaling. It supports arbitrary relational calculus at any scale. It supports full ACID semantics—not eventual consistency—yet writes continue to scale. Clustrix has learned to embrace the genius of the AND.

Posted in Market, Technology | Tagged , , , | Leave a comment

How Clustrix was born

Back in 2005 I was at Isilon.  We had developed the first (and still the best) truly distributed scale-out NAS solution.  We were on the road to an IPO and our customers were excited about our products and what we had done with them. I was on the phone with Jake, who worked for one of our largest customers.  Jake said this to me: “This is great for what you guys have done of our basic file storage, but can you do anything about our databases?”.  BAM!  Just like that I got super excited about this idea and started looking around to see who else had these types of scalability and fault tolerance issues with their databases.  As you probably know, it turns out that it was an issue for just about everyone.

I got together with Sergei Tsarev (Clustrix co-founder) and we started working on the problem.  What is it about these databases that isn’t scaling?  Storage usage and query performance.  Ok, so why isn’t it scaling?  Because the query processor is only as big as the box can be, and scaling up with bigger and bigger boxes is a non-starter (forklift upgrades, leaving the commodity price curve, etc.).  We saw some systems out there doing things with virtualized clustered storage engines running behind traditional query planners, but those always failed to scale because you wind up pulling all of this data, as well as dealing with locking and concurrency, over the network.  We realized that the only way to bring true scalability is to fan out the work as you grow the cluster.

As Aaron (our CTO) says – ‘Bring the query to the data, not the data to the query’.  In his whitepaper, A New Approach: Sierra Distributed Database Engine, Aaron provides a nice description of how that concept became the seed for the revolutionary technology that is the heart of our Clustered Database Systems.

Posted in Company | Tagged , , , | 1 Comment