Choosing the Right NoSQL Database Cut This SaaS Company’s Time to Market by 20%
Ease of development and a better billing model led smartObjx CEO Russ McClelland to choose RavenDB over CosmosDB as his company’s NoSQL database solution.
smartObjx is a SaaS company developing “cloud-based infrastructure services and software components that enable developers to build high-quality SaaS solutions faster.” The company was founded around 3 years ago, building their platform on RavenDB from the very beginning.
Before starting smartObjx, CEO Russ McClelland worked at a company that used CosmosDB as their main project database. They’d started encountering efficiency and cost issues, but opted to throw more money at the problems rather than change databases.
At the time, Russ was already aware of RavenDB as he followed the work of our CEO, Oren Eini. He saw how it avoided the problems of Cosmos with its ease of development and better billing model, and it naturally became the default choice for his personal projects.
Ease of Development
Starting a new company, Russ didn’t have the resources to simply pay developers to fix all the issues presented by Couchbase. He needed a system that was easy to code and just worked – which he found in RavenDB.
“What really drew me to it was the ease of programming.”Russ McClelland, smartObjx CEO
The simplicity came from the document data model and having a library that allowed them to connect easily rather than write a lot of code.
Ideally, Russ wanted to be able to treat the database as a way to take objects from memory and store them on disk. But this presented problems in Cosmos, particularly with circular references.
Imagine you have a customer with an associated repair order, and that repair order also includes an association with that customer.
This creates a circular reference which, if handled improperly, will create multiple copies of the same information. It increases the number of properties you’re indexing, which takes longer and makes your data bloated and hard to search.
Russ saw that the cost and work this created in CosmosDB was prohibitive, but RavenDB provided a solution by allowing customization of the JSON serializer. This allowed Russ and smartObjx to handle circular references however they wanted. In the case of the repair order above, they could simply make the reference link back to the original customer, rather than to a copy.
“It allowed us to create these really rich relationships between objects, and not have to use a rational database but still get some of the benefits of it.”Russ McClelland, smartObjx CEO
Cosmos bills for resources used, so costs can spike if your database doesn’t run efficiently. With the inefficiencies introduced by circular references, Cosmos was too expensive to be viable – especially for the complex interconnected hierarchies in smartObjx’s main software products.
smartObjx Main Products
smartObjx has two flagship products: smartRules and smartStructures.
smartRules is a business rules engine highly tailored to other SaaS companies. It bridges the gap between business and development teams by providing an IDE in which users can write rules from a business perspective rather than doing so technically in code.
These rules codify typical business logic, like determining tax rates. Having them configurable in a rules engine rather than hard-coded makes them much easier to update as conditions change.
General practice in rules engines is to create a set of rules which are suitable to the majority of customers. smartRules takes things a step further by allowing customers to override and change rules to suit their business needs. Implementing such rules could become quite complex in a relational database, but RavenDB makes it effortless.
The rules mentioned above are objects in their code. In RavenDB, you can simply save objects to the database with a single operation. There’s no complex mapping of fields as would be necessary in a relational database, so the code for this is extremely simple and quick to write.
Even a complex set of rules can be stored in a single object. One for calculating taxes in Texas is stored as easily as “session.Store(texasTaxes);”
Sometimes, smartObjx’s customers have their own customers or divisions that want to customize their rules sets further.
A question then arises: how do you keep track of these hierarchies? The answer is smartObjx’s other flagship project: smartStructures.
smartStructures is a tool for mapping a company’s structure, and it can create different hierarchical views of the company to suit different needs.
Not every application needs to have the same view of the enterprise. A financial view could break down the enterprise by location to make taxes easier to manage, whereas an operational view might divide it up under the C-level executives.
According to Russ, handling such hierarchical views “is something that relational databases don’t do well at scale. Query engines just can’t handle self-references to tables efficiently.” RavenDB’s document model and customizable JSON serializer make it easy.
smartStructures is designed to benefit small to medium SaaS companies, by helping them organize hierarchies of data to suit the organization of the companies they sell to. The software provides an intuitive drag and drop interface, removing the need for coding and significantly speeding up development time.
Used in combination with smartRules, companies can leverage their structure to decide when and how to apply rules.
Impact of RavenDB
RavenDB kept development costs low and allowed them to get to market faster. (They estimate time to market was ~20% quicker than it would have been with Cosmos.)
And smartObjx pays it forward. The services they’ve built have in turn saved their customers’ time and money. One 3rd party using Russ’s services saved an estimated 9-12 months of development time.
Backend services/APIs are written in C#, with C# domain objects that are shared with other layers below the UI. These services are deployed in Azure as Web Apps governed by an Azure API Management Gateway.
The company is relatively new so traffic and data volumes are low, but load tests indicate they can sustain thousands of requests per second with a < 100ms response time.
Their database is hosted on the Cloud and privately managed.
smartObjx has plans for other services they want to build, tailored to SaaS developers. In the short term, they’re looking to develop solutions related to configuration settings for customers, for example, defining what payment types to accept. RavenDB will provide the foundation for all of these new projects.
We’ll leave the final word to Russ to sum up:
“The power of Raven is being able to create an object model and very easily store it in a database that’s highly scalable, very cost-effective, and flexible enough to change when we change.”Russ McClelland, smartObjx CEO