Better HN
topnewbestaskshowjobs
Log inSign up

arynda

34 karma · joined Sep 12, 2022 (4y ago) · 22 submissions

Submissions

comment 3y ago · link · parent

If you want an actual startup-oriented bank that has their shit together (e.g. they employ sweep accounts and by default you have $5M of FDIC insurance), mercury.com has been excellent. Great tech, great UI/UX, great app, transfers are free (ach, check, domestic and intl wires), instant virtual cards, physical if you need it, finely-grained spending limits, etc. They're awesome.

comment 3y ago · link · parent

I miss Topcoder. Funny story I went back through all my old SRMs and found one where I was placed in the same room with none other than mzuckerberg. He even unsuccessfully challenged my code and I in turn challenged his with a test he hadn’t considered, and he lost all his points!

This was, of course, a couple of years before Facebook was even thought of.

comment 3y ago · link · parent

any chance you have a link to a good readme on setting up single-node docker swarm?

comment 3y ago · link · parent

> ClickHouse performs what is known as PREWHERE processing > p.s. Scans are ridiculously fast.

Good point, I should have mentioned this was basically a worst-case scenario for Clickhouse as the data layout is totally random (same approach as OP used in their benchmark) and isn't able to utilize any granule pruning, sorting, or skip indexing, but is still able to achieve such remarkable speeds.

comment 3y ago · link · parent

Not in particular sorry, most of the good content I've found is on Altinity [1] and Alibaba's technical blogs [2][3]. These tend to be mostly focused on how the data itself is stored and how to use Clickhouse, but don't really dive into the specifics of how query processing is performed.

[1] https://altinity.com/blog/

[2] https://www.alibabacloud.com/blog/clickhouse-kernel-analysis...

[3] https://www.alibabacloud.com/blog/clickhouse-analysis-of-the...

comment 3y ago · link · parent

Comparison on Clickhouse, also runs in about 30-40ms, however there's no indexing being used and this is a full-table scan.

    create table if not exists test_table
    (
        id UInt64,
        text1 String,
        text2 String,
        int1000 UInt64,
        int100 UInt64,
        int10 UInt64,
        int10_2 UInt64
    )
    engine = MergeTree()
    order by (id)
    ;
    
    insert into test_table
    with
      repeat('b', 1024) as one_kib,
      repeat('b', 255) as bytes_255
    
      select
        number as id,
        one_kib,
        bytes_255,
        rand() % 1000 as int1000,
        rand() % 100 as int100,
        rand() % 10 as int10,
        rand() % 10 as int10_2
      from numbers(10e6)
    ;
  
  
  > select count(*) from test_table where int1000 = 1 and int100 = 1;
  
  ┌─count()─┐
  │    9949 │
  └─────────┘
  
  1 row in set. Elapsed: 0.034 sec. Processed 10.00 million rows, 160.00 MB (290.93 million rows/s., 4.65 GB/s.)
The same table but with 1B rows instead, runs in ~1800ms

  > select count(*) from test_table where int1000 = 1 and int100 = 1;

  ┌─count()─┐
  │  999831 │
  └─────────┘

  1 row in set. Elapsed: 1.804 sec. Processed 1.00 billion rows, 16.00 GB (554.24 million rows/s., 8.87 GB/s.)
[1] Converted the table create and insert logic from here: https://github.com/sirupsen/napkin-math/blob/master/newslett...

comment 4y ago · link · parent

The same way a spoken language is a communication tool and doesn't restrict what is discussed.

comment 4y ago · link · parent

https://asciiflow.com/

comment 4y ago · link · parent

That's cool. I've been thinking through a similar design. Would this be an accurate description of your approach?

queues hold jobs, the scheduler/dispatcher handles load-balancing and rate-limiting, pushing jobs down to workers only when flow-control criteria is met?

  ┌────────┐                 ┌─────────┐
  │ queueA ├──┐           ┌──┤worker1  │
  └────────┘  │           │  └─────────┘
              │           │
  ┌────────┐  ├───────────┴┐ ┌─────────┐
  │ queueB ├──┤dispatcher  ├─┤worker2  │
  └────────┘  ├───────────┬┘ └─────────┘
              │           │
  ┌────────┐  │           │  ┌─────────┐
  │ queueC ├──┘           └──┤workerN  │
  └────────┘                 └─────────┘

comment 4y ago · link · parent

How did you end up solving the rate limiting? Were the workers themselves responsible for coordination via a semaphore (e.g. there's already 25 of us, don't consume from this queue) or did you solve it on the scheduling side and only push jobs into their queues once you knew there was capacity?