MondayDB: A new in-house data engine from monday.com
medium.com
medium.com
If you ever find yourself in a position where you need a database table per instance of an abstraction, you've almost certainly failed to model the domain appropriately.
If you find yourself in a position where you think you need to write your own database engine because nothing on the market can even approach your problem, you probably need to go take a nap.
The only instancing that makes sense to me is at the database level (aka one per customer/board/etc), and if you're going to be doing a lot of database files... Did SQLite even remotely cross the mental threshold here? I can see several ways to make it solve this problem if you are going to insist on one table/file per real world thing.
One SQLite database per board with everything defined in SQL command text using application defined functions to bind to platform features. Customization can be performed deeply and at the grain of each board. You could allow enterprise customers to bring custom schemas or even code modules to inject and call. Would also make import/export absolutely trivial for any customer.
Or we can spend all our special innovation tokens on developing a goddamn database engine from zero...
Redis and Cassandra already handle distribution out of the box.
It seems like there product is basically a web GUI for creating db tables with workflow automation so it doesn't seem like too far of a stretch to have 1 table per customer table. I guess the alternative is designing some system for shoving arbitrary schemes into another schema.
I guess https://en.m.wikipedia.org/wiki/Entity%E2%80%93attribute%E2%... is an option
They didn’t build a DB, they taped some products together with middleware. That isn’t to say what they did is bad, just that it’s not “let’s write a DB from scratch” as the headline implies.
One thing that stopped me from trying it in the past for a project was this:
> Is rqlite a good match for a network of nodes that come and go – perhaps thousands of them?
> Unlikely.
While I wasn’t going to get to thousands, it was going to be hosted on K8s, and it seemed like I’d have to write lifecyclehooks to ensure nodes gracefully left consensus, and others felt that was an unnecessary complexity for the problem. Can you speak more to this point, since in the FAQ you also say it can run on K8s? If a node dies due to, say, hardware failure, when it rejoins is it seen as a slightly out-of-date existing node since it’s part of statefulset? If so, assuming quorum is maintained, this is probably a lot easier than I was making it out to be.
However, running it on Kubernetes should work quite well. Check out the documentation at https://rqlite.io/docs/guides/kubernetes/
>If a node dies due to, say, hardware failure, when it rejoins is it seen as a slightly out-of-date existing node since it’s part of statefulset? If so, assuming quorum is maintained, this is probably a lot easier than I was making it out to be.
Assuming I follow you, yes, this should work fine -- and exactly as you expect. I suggest you try it out, and if you don't understand what you're seeing file a ticket on GitHub, or join the rqlite Slack[1].
AirTable developed their own DB, but their case may be justified. I listened to an interview with a founder once - very thoughtful and reasonable. They fully understood what they were getting into.
But by default, NEVER:
* Write your own DB
* Write your own search engine to match ElasticSearch or other serious technologies
It will take over your life, and then ruin it.
Just about any SQL server with well defined schema and indexes would blow this out of the water by several orders of magnitude.
Schemaless in this old devs opinion is basically always a bad idea. Your data has a schema, whether or not you wish to define it. In not bothering to do so though you’re not doing yourself many favors.
Until a while ago, when a user landed on their
board, we threw all the board data right into
the client (usually a web browser running on a
desktop computer).
the client is limited in its resources. Depending
on the client device and board structure, it
started to struggle and finally, crashed after a
few thousand items (“table rows” in monday.com
terminology). If we really pushed it, we could
handle up to 20k items. Beyond that, it was game
over.
This does not make sense. Why would a browser not be able to handle more than 20k table rows?I have not tested it, but I would think juggling arrays with a few million entries should not make a browser sweat.
[0] https://shlomiassaf.github.io/ngrid/demos/virtual-scroll-per...
Imagine maintaining that (2 separate distributed async-by-default, no transactions/indexes, limited-types, etc etc clusters).
At this day and age where everyone is going for sync-by-default because it's extremely easier on the developer side to use the db.
I've seen a similar architecture using Kafka to buffer writes but then you lose kv lookup at the buffer.
All that said, I'd like to hear about this being open sourced and being self hosted and being Jepsen tested or at least a clear distinction that this DB is, and will only ever be, an in-house DB so the former requests will never happen.
I am wondering why opposite wouldn't make sense, you could greatly reduce over network traffic for heavy queries.
As you mention there’s an overhead or a tax to this sure but the overall speed up’s are there.
If you’re talking about one big node with gobs of fast storage and CPUs for compute then that’s more your traditional scale up instead of scale out approach and for many years that was the conventional wisdom in databases: when things got slow just move your DB to a bigger and bigger machine. But that has its limits. So scaling horizontally was the answer and with it came all of its complexity sure but it allowed for much better scaling.
Trivial case is predicate push down, when predicate is applied on storage backend and not compute node.
I think ClickHouse is an example of such architecture, and they don't have dedicated compute nodes.
Imagine a workload that is write heavy and handles very few reads say 20:1 writes to reads. Then having many storage nodes could speed up the reads and if you have say a fix set of nodes allocating 20x more storage nodes than compute nodes might make sense.
The whole thing is a science and I do like the flexibility.
Postgres / MySQL with a table per board (or one giant partitioned table with a JSONb column) would have been totally fine, as would have one SQLite database per customer that you can load the initial page of and then ship the whole thing to the client for richer interactivity.
"Distraction-free reading." riiiiight
I suspect the original poster wanted to tell me something. Too bad I shall never find out.
As far as I can see they didn't implement their own DB - they just built a service composed of existing DB's - like Cassandra and Redis.
Considering they use many distributed systems under the hood, it's not intended for users to interact with the database running it locally but eventually they want to be a "data cloud" company maybe. The use-cases seem to be matching HTAP databases and I wonder why they didn't try any HTAP database in the market.
Curious: What could have been the deciding factor to choose Cassandra over ClickHouse?
Saying "Improved loading times by fixing our fucked up indexes and query patterns on current database" sounds weak. Sounds *shudder* incremental.
But implementing an in-house database engine for a literal CRUD app? That's takes being a visionary. There's so much bikeshedding for you to stamp down on and show leadership (never mind it's your fault there's any bikeshedding to start)
And I mean the article says it all at the end:
> Looking ahead, we’re weighing up our next moves. We might refactor some of our logic to be executed with highly-performant tech such as DuckDB. We might take advantage of columnar formats such as Arrow and Parquet. We may even refactor our logic using Rust language as a side-car or dedicated microservice. I’m very excited about the future, and will keep you updated!
They're already salivating impact they just unlocked by smashing their fist through the beating heart of what the last guys did and taking a triumphant bite. It's not just this first iteration of the platform: they've given themselves the momentum to start tearing down everything that ever touched a database at that company! This is how you break the IC glass ceiling!!!!
_
And I absolutely love this line: Eventually, we found that none of these options completely met our requirements.
Related tangent: there's an in-house serialization format at the AV company I work at that's been a massive pain in my ass since I got there. I'm one of those evil tech leads that wants to do things that actually measurably deliver value so instead of building a SaaS product inside my tech company I like to do things like build tools with data we have... but it turns out rolling your own not-Protobuf also means having to write your own client libraries! Which means I consistently run into stupid bugs and edge cases that the genius who invented this format doesn't have to deal with because they long impacted their way into a barely-technical role, and now random people get the joy of relearning this guy's invented solution to fix it while they try to get useful things done.
One day I get so annoyed this mess that I go and look up why the fuck someone made their own Protobuf. I dig through old Slack messages until I get to a presentation deck, and that golden nugget almost word for word was sitting there on a slide: none of the existing options completely met our requirements. and on the slide you've got 10 perfectly good solutions like Protobuf, Capt'n Proto, MsgPack...
So what they mean of course is, quite literally, no one checked every single box. There were options that checked 9/10 boxes, but the moment that 10th box wasn't checked... they had their excuse. It's like a toddler hitting you with the "you said sit in my room but you didn't say which room!!!!!"
And of course never mind that "settling" for 9/10 boxes would have enabled an infinitely better solution for the 9 that are checked: because when asked why on earth this project is needed, I'll get to show a nice table with a big red X on every single solution.
_
Now excuse me while I go throw up at the idea of birthing a company with blood sweat and tears only to have it infected with this kind of sickness.
I swear, tech is the only industry where if you walked into a room and asked what one improvement to their work they'd like, it'd be something at odds with your customers:
I can walk into McDonalds and the suggestions will be things like "move appliance X closer to Y so I can do Z that makes my job easier".
If they were tech workers I'd get "replace the coffee machine with a $50,000 italian espresso maker so I can practice for my next job at the Dorsia."
The envisioned duckdb/parquet/arrow/rust journey is so 2023 HN it could be satire.