Better HN
topnewbestaskshowjobs
Log inSign up

elendilm

149 karma · joined Sep 5, 2017 (9y ago) · 272 submissions

Muneer, Founder & Director, Ndcurve Technologies Pvt Ltd

Website: https://slyp.app

Email: elendilm@slyp.app

Back in 2011, wrote a self-hosted kernel + bootloader from scratch and ported GCC, Newlib, NASM, and Binutils at age ~20 as a learning exercise: https://f.osdev.org/viewtopic.php?t=24498 I went by HardCoder on osdev.org back then before moving to my real name, Muneer.

Starting in early 2014, I moved on to building an entire custom offline-first + online-sync distributed ERP application from scratch until the end of the decade, tackling distributed systems and conflict resolution before production CRDT implementations existed. This later led to building Slyp, SlypBusiness, a custom database, Feature Architecture, and an ecosystem of core technologies:

• Slyp: Regional shopping app (Status: Ready to launch).

• SlypBusiness: App enabling brands to promote outlets with commission tied to actual sales, not views or reach (Status: Ready to launch).

• Dip: Parallel database substrate with raw binary and JSON as co-equal first-class citizens, featuring per-request KV engine selection. Forms the backbone of Slyp & SlypBusiness.

• Monolog: Lightweight Kafka-like log broker built on Dip and runs on servers and mobile alike.

• Singularity: Key-value engine.

• ARCC: Architecture compiler. Correctness guarantees at compile time, such as strict CQRS enforcement disallowing query to command violations, query to mutable Dip access violations (Dip.insert/update/remove), and other 10+ architectural constraints.

• Craft: Mobile app for app development using flowcharts, snippets, and a WYSIWYG designer (Status: MVP).

• Portal: Mobile app for remote container management and HITL AI workflows (Status: MVP).

Submissions

comment 1d ago · link · parent

No. Tumor is abnormal growth forming a mass, while cancer is unconstrained replication. Two very different things in evolutionary biology.

comment 2d ago · link · parent

The article conflates tumor with cancer.

Does the pill address both pancreatic cancer and tumor or just one of them?

comment 5d ago · link · parent

Wonderful article.

I was thinking for the last couple of days to have 10M+ app connections on one laptop as an extreme cost optimization excercise. Great timing.

comment 1w ago · link · parent

It is very hard to imagine what life would be without the awesomeness that KDE is.

comment 1w ago · link · parent

"Many of us", not "most of us".

Building wooden dwellings is comparatively easy and straightforward.

It is the lack of a tangible result that gives the insecurity that programmers feel when compared to constructed buildings.

The epic is not visible to the uninitiated when it comes to programming whereas with construction it is visible to the naked eye for everyone.

It is easy to see and marvel at a cathedral whereas most don't have the skill required to marvel at the architecture or the codebase of an elegantly designed distributed system.

To be blunt, building a wooden shack is physically easy. Building even a basic program requires a level of abstract mental discipline that most people simply do not possess.

So the "most people" you mentioned who are throwing up a shack to live in, I admire them for that.

comment 1w ago · link · parent

I disagree vehemently that programmers build lousy programs. Many of us do quite the contrary.

But this is hilarious, and hence I am upvoting.

comment 2w ago · link · parent

I just tested a simple Qt app on my Linux KDE Neon and it consumes just ~32.3 MB RSS. Simple Qml app memory consumption is ~120.4 MB RSS.

$ ps -o pid,rss,command -p $(pgrep -f SimpleQtApp)

PID RSS COMMAND

1471929 33052 ./SimpleQtApp

$ ps -o pid,rss,command -p $(pgrep -f SimpleQmlApp)

PID RSS COMMAND

1478335 123260 ./SimpleQmlApp

// Following is the simple Qt app code.

#include <QApplication>

#include <QWidget>

#include <QLabel>

#include <QPushButton>

#include <QVBoxLayout>

int main(int argc, char argv[]) {

    QApplication app(argc, argv);
    QWidget window;
    window.setWindowTitle("Qt Simple App (CMake)");
    window.resize(300, 150);

    QLabel *label = new QLabel("Hello, World!", &window);
    label->setAlignment(Qt::AlignCenter);

    QPushButton *button = new QPushButton("Click Me", &window);

    QVBoxLayout *layout = new QVBoxLayout(&window);
    layout->addWidget(label);
    layout->addWidget(button);

    QObject::connect(button, &QPushButton::clicked, [label]() {
        label->setText("You clicked the button!");
    });

    window.show();
    return app.exec();
}

// Following is the QML app code

#include <QGuiApplication>

#include <QQmlApplicationEngine>

int main(int argc, char *argv[]) {

    QGuiApplication app(argc, argv);

    QQmlApplicationEngine engine;

    const QUrl url(QStringLiteral("qrc:/Main.qml"));

    QObject::connect(&engine, &QQmlApplicationEngine::objectCreationFailed, &app, []() { QCoreApplication::exit(-1); }, Qt::QueuedConnection);

    engine.load(url);

    return app.exec();
}

// Main.qml

import QtQuick

import QtQuick.Controls

Window {

    width: 320
    height: 200
    visible: true
    title: "Simple QML Application"

    Column {
        anchors.centerIn: parent
        spacing: 20

        Label {
            id: statusLabel
            text: "Hello, QML World!"
            font.pointSize: 16
            anchors.horizontalCenter: parent.horizontalCenter
        }

        Button {
            text: "Click Me"
            anchors.horizontalCenter: parent.horizontalCenter
            
            // Handle click event inline
            onClicked: {
                statusLabel.text = "You clicked the QML button!"
            }
        }
    }
}

comment 2w ago · link · parent

> Is it just me or does anyone else feel that 200 MB is a lot for a native chat app written in Rust ...

That was my first thought. But considering it as a significant improvement from > 1 GB, I guess it is what it is.

> I remember back in the day, apps like Miranda IM (and early versions of Trillian) used only digits of RAM ...

Sadly this was true for many apps.

comment 2w ago · link · parent

With Qt, on my KDE Linux, a simple app usually stays well below 60 to 100 MB.

comment 3w ago · link · parent

My comment was to your parent comment :).

I find it unlikely, especially due to the numerous pathetic suggestions LLMs keep offering me on the architectural discussions I engage in.

Verbal abuse is what makes it useful to me. A punching bag where it infuriates me making me lay down the how and why its suggestions are stupid. This results in progress.

I guess we would have to wait and see. Maybe LLMs do get better at architecture in the future. But seems unlikely to me without expert supervision.

comment 3w ago · link · parent

Wrong. The entire arc was on database and novel architectures. Let me point you to the things you missed both on the example and the context.

>> Writing such a complex software as database engine requires strategy, awareness and rigor.

> Correct. Current LLMs are pathetic at architectural correctness without expert supervision at every turn.

> Try having a discussion on designing an architecture for a new kv engine with cache-oblivious algorithms that beats lmdb on generic random point-key lookups on a disk-backed mmap file.

> What happens in the future is up for debate,

comment 3w ago · link · parent

Your reading skills are commendable, especially since you "found" an assertion of future impossibility. Me having explicitly mentioned the future as "up for debate" makes your reading comprehension even more impressive.

Unable to see the architectural problem mentioned is just icing on the cake.

How do you do this?

comment 3w ago · link · parent

Nobody cares about conviction. What can be demonstrated is what matters.

darkwi11ow, in the sibling comment, gave a substantive response on the underlying mechanics with a link. Godel's incompleteness theorems also yield similar insight. But I want to shine some light on a different phenomenon.

What happens in the future is up for debate, but the current architectural reasoning capabilities of LLMs are pathetic.

Try having a discussion on designing an architecture for a new kv engine with cache-oblivious algorithms that beats lmdb on generic random point-key lookups on a disk-backed mmap file.

Or try any novel architectural discussion and see for yourselves.

Modern LLMs cannot even confidently state many true sentences as "maximally" true as possible without hedging and tone policing as if we were doing politics ;).

Hence an expert is required at every turn.

comment 3w ago · link · parent

Thank you for the assessment and the link. I only read half of it as I was busy. Bookmarking it for later reading. Great read.

Yes. The combinatorial explosion is a great assessment of the "why".

But the problem is more nuanced than that because one has to assume that LLMs can reason accurately all the time which is demonstrably false.

The current LLMs cannot even state true sentences as true if they sound confident, without hedging.

Future LLMs may mitigate this, though it looks unlikely.

comment 3w ago · link · parent

Yes they are complicated. But with enough rigor, structure and discipline, it is doable without breaking correctness guarantees.

Making it distributed opens a whole can of worms, which is where Jepsen shines.

comment 3w ago · link · parent

Correct. Current LLMs are pathetic at architectural correctness without expert supervision at every turn.

comment 3w ago · link · parent

Reducing attack surface is a lesson for everyone. Newcomers are impressed by massive piles of code.

Seasoned developers are unimpressed, or even disgusted, by the same massive piles of code.

comment 3w ago · link · parent

I first encountered this behaviour on Linux desktop with Qt QML apps as far back as 2015. For a long time, I thought it was Qt QML ListView's inefficiency and didn't think much of it.

But in recent years, the phenomenon was visible with Dip which was built on rust.

Dip does massive parallel fanout using green threads ('may' coroutines) with work being NUMA pinned (software hash) using a thread per core model.

A default request may span up to _chunk_count_ jobs (default 5k) configurable per request.

Every request (x 5k jobs) from the client on a stress test sees a jump of ~10-20 MB of memory. Sometimes the jumps use large swaths of memory - say 100s of MB and stabilizes for a while only to gradually climb up again later. Rinse and repeat - OOM kicks in and the process crashes.

Many times we thought we were leaking memory somewhere. But armed with the Qt experience a decade ago, we intuited maybe its the allocator - and switched to mimalloc on desktop executable.

Dip's memory, using mimalloc, stabilizes at ~60 MB post request completion no matter how many requests you throw at it.

Pity that on mobiles, more specifically Android, we have to live with the default allocator on even trivial Qt apps let alone embedded Dip. But people have lived with it for at least a decade, so it is what it is.

Thus on mobiles, we just have to be content like everybody else, unable to squeeze every last ounce of performance and efficiency out of the hardware on stress tests ensuring Dip remains "just better :(" :)

comment 3w ago · link · parent

True. The guide is an interesting read. When you are deep in the trenches, most of what the github link says is just common sense.

Eg: < Optimize for the slowest resources first (network, disk, memory, CPU) in that order, after compensating for the frequency of usage, because faster resources may be used many times more. For example, a memory cache miss may be as expensive as a disk fsync, if it happens many times more.>

This is just obvious common sense. Great read.

comment 4w ago · link · parent

mimalloc aggressively reclaims space and it benefits the use case in our Dip database built on rust.

This is for a long running process where consuming compute and memory should only occur on processing a request and must revert to a baseline memory consumption once the request is completed.

malloc with default allocator always gradually increases the memory consumption. This continues with enough request bursts on our testing until the process runs out of memory. mimalloc doesn't.

On mobile, we are stuck with the default allocator. On mobiles, the phenomenon of the default allocator consuming memory is reproducible even with normal Qt apps. It is what it is.

comment 4w ago · link · parent

Most still get benefits. I concede that many don't get "direct" remuneration. Some journals do pay. But many do get vouchers, discounts, free access, early access, etc. which amounts to a form of payment and thus compensated in kind. This effectively is "paid" as far as I am concerned.

The logic stands. A reviewer, even those who get zero compensation, can always review publicly published papers just like others.

comment 4w ago · link · parent

What has that got to do with anything? Look into his work rather than his online persona.

It's his/her prerogative to keep an online footprint or not.

comment 4w ago · link · parent

Peer review and scrutiny out in the public is more valuable than only done by a couple of paid guys from a journal.

It's fairly basic. For a work published on a public platform, the same guys paid by the journal can also review it if they so choose to in addition to those people in the public who were not paid by anyone.

comment 1mo ago · link · parent

This looks great.

We have smart batching in Dip where we deduplicate work received in what we call a "batched" request. We use BTreeMap to deduplicate work in the preprocessing "scatter" phase.

This deduplication in smart batching is the slowest phase on most bulk write workloads (200k+ inserts in a single request) and takes sometimes up to 3x the time taken for the combined fanout + db writes + db commits + gather.

Will try out with Bbtree and see how it goes.

comment 1mo ago · link · parent

You are asking all the right questions. The answer is obvious.

Many don't want to say it or admit it.

comment 1mo ago · link · parent

That literally was history in the making. Much respect.

comment 1mo ago · link · parent

> More CPUs pegged at 100% is always a good sign of smooth flows, but optimizing further requires data layout changes from that point.

True. This is true by experience. I want to add that, additionally this is not just true based on experience, rather it is fairly a straightforward logic.

If the cpu is already saturated at 100% doing work in the most "efficient" way possible for a given data structure (some sort of a shannon limit for the given data structure), then there is zero further improvement possible.

Any additional improvement must therefore happen either on the thing that the CPUs operate on (data structure improvements) or on the hardware themselves.

comment 1mo ago · link · parent

I love how you first confused application managed indexes with B+trees in code. Then you moved to how you could not see how "this could be faster", asserting there is an additional indirection layer. When pointed out that the indirection also exists in database managed indexes, you wanted examples of usage at scale with a blog post. You also mentioned you have operated 1M QPS, yet you couldn't fathom while being oblivious to lock contention. You were persistent in demanding one public link.

When the Uber blog link was provided with exact scenario in the excerpt, you pivoted to how their new version has schema enforcement. You claimed you were able to prove all inefficiencies you encountered were due to bad data modeling or bad decisions which went against RDBMS.

When pointed out that the newer blog post doesn't mention removing the secondary indexes which was the whole issue, you digressed to the grand finale of absurdly claiming Sqlite will saturate phone's I/O before one saturates Sqlite, which is so false that it is not even funny. And finally demanding our Dip's benchmarks (which will come in due time, if? we ever release it to the public).

All of this when more than enough hand-holding was made to help you understand. Even when the underlying physics was easy to understand. Enough pivoting.

Let our conversation stand and be of help to anyone curious enough to learn the tradeoffs discussed. Best wishes.

comment 1mo ago · link · parent

> Everywhere I have worked that has DBs they claim are too large, I have been able to prove (typically by cloning one and remodeling it) that the reason they're suffering from performance issues is because they've made a series of decisions which were fighting against their RDBMS

Some are just physics. Say if you want SSD write saturation and multiple parallell write transactions, the traditional RDBMS model itself may not suffice. Its not just data size but concurrent write transactions, lock contention, etc. Additionally, think resource constrained devices like mobile phones. Or an aggressive cost reduction mentality where each cpu cycle shouldn't be unnecessarily wasted without feeling guilty. If you come from a systems engineering background like that, you wouldn't be much impressed with many traditional databases at all. I am generally not much interested in SQL databases anyway.

> They needed to create secondary indices as tables because they were storing everything in JSON blobs, which is difficult to directly index

Our database Dip stores raw binary as well as json as first class citizens. Can't speak for Docstore, but as far as I see, it is just an evolved form of its earlier self with different tradeoff according to their workload. Note the lack of mention of the removal of secondary indexes as separate data.

> I would counter that if you keep needing schema changes, you haven't done a good job modeling.

Disagree. Schema stabilizes - yes. But doesn't mean they don't go through cycles of change occasionally.

comment 1mo ago · link · parent

> Distributed querying may still just be a workaround rather than something anyone actualy wants to do as a first option.

That is not the case. Even on a single machine with multiple shards (think hundreds or even thousands of kv engine say LMDB envs), a distributed query parallelizes efficiently. Additionally it can also saturate the SSD/NVMe with multiple write transactions concurrently.

It definitely is the first option and not a workaround. Even replication benefits from this write saturation and reduced latency and parallelism. Naturally, multiple writes involving the same logical unit of work can go through a durable execution framework (think ordered-log/kafka) as one insert and the client dismissed only for the consumer later attempting multiple idempotent writes (logical work with retry on failure) - achieving maximum SSD saturation. The client is later informed of the status.

> Most of the big offline use cases I’ve seen are aerospace/drones or logistics or robotics ...

Our previous ERP (built almost over a decade) for a large enterprise client, required disbursing customers as the absolute paramount priority regardless of internet availability - which is where offline first became the only choice. They wanted data to seamlessly move across thousands of offline systems - which is where we wrestled with replication/conflict resolution, etc. Our new Slyp and SlypBusiness is a reincarnation/re-imagining of this old ERP with added goodies but as mobile first applications.

There is only up to a point where we tolerate other databases, and beyond which the conventional wisdom starts to be a net negative and we realized we are better off building one for ourselves.

12345
10