Better HN
topnewbestaskshowjobs
Log inSign up

coder543

6,698 karma · joined Jul 18, 2012 (14y ago) · 1,967 submissions

My email is at gmail using my username.

Backend-focused full-stack engineer with 8+ years of experience, mostly focused on Go, Rust, and TypeScript, but open to other options.

Resume: https://drive.google.com/file/d/1VNC272B3n7ZEfppMHkm2wGgaINwYl4Av/view

Submissions

comment 8y ago · link · parent

Or, you could run it on the same server that you're running your database on.

If you're not running the database server yourself, is it so unimaginable that the service provider might have already configured PgBouncer on top of the database as an optional way to interface with it?

Regardless, "serverless" has never meant that there are no servers involved, it just means that for the serverless pieces of your application, you don't have to concern yourself with where or how they're run, only with the application logic itself.

If you want to go 100% serverless, then you're obviously going to have to choose a DBaaS that works with your connection pooling strategy, especially if that strategy is "I don't have one." Supposedly, based on comments on this thread, DynamoDB works pretty well for that scenario. Obviously Postgres doesn't scale with an increasing number of connections very well, which is why PgBouncer exists, and it works well.

Finally, PgBouncer is relatively stateless. Its main pieces of state are a static config file and the pool of open connections it holds. This could be deployed in a serverless fashion, and any time it is destroyed or recreated, it would be trivially reinitialized just from the config. It doesn't have to have any attached, mutable storage.

comment 8y ago · link · parent

No, I’m saying Apple has been using industry standard controllers until literally the MacBook Air refresh that just launched.

https://www.anandtech.com/show/12670/the-samsung-970-evo-ssd...

You can buy this SSD today. There are others like it, and some, like Intel's Optane SSDs actually substantially outperform anything Apple has put in their computers in terms of IOPS, even though the Optane line hasn't focused on raw sequential throughput yet. Off the shelf SSDs get the much vaunted performance of "Apple's" SSDs (they're just normal SSDs...) being discussed in this thread.

In fact, the SSDs in those windows computers are as fast as the one I've linked to. The benchmark you were linking to was benchmarking NTFS vs APFS under a small file I/O workload, which NTFS sucks at. It was not benchmarking the SSDs in any effective manner. I am certain that I pointed this out in my comment above! If those laptops were copying a few large files, the performance would have been identical. If those laptops were running Linux, the performance would have been identical.

Look here! https://www.anandtech.com/show/12167/the-microsoft-surface-b...

Scroll to the bottom and tell me what you see! Yes, that SSD is performing as well as your vaunted MacBook!

Apple's iPad Pros are technological marvels. Their laptops' storage systems are not, and you're just deceiving yourself if you think otherwise.

comment 8y ago · link · parent

> I think the only way to judge a language is to use it full time for at least one year, but even then you will probably just have scratched the surface.

In theory, that sounds nice. Have you spent a year on Rust, Go, Elm, and Crystal? If not, then what if one of them is the perfect language for that problem you're trying to solve? How can you make the right judgment call when starting a project if you haven't spent a year using each of these and more?

In reality, that's a completely absurd approach for the first-level approximation people need/want when they discover a new language... surely you realize this. People need to be able to see the big picture before they'll know whether they want to dive into the details.

There are literally thousands of programming languages. Many are created each year. How can anyone afford to spend a year, full-time, on each language to discover the truth of each language? They can't.

So I agree with dotdi:

> Unfortunately, the documentation, FAQ and User Guide all failed in succinctly giving me the information I need: what can it do well, what does a known snippet look like implemented in <Lang>, how does it compare to other languages, etc.

comment 8y ago · link · parent

Considering that TimescaleDB has only been available for a relatively short period of time, I would love to see a source for that statement. It sounds like a really fun article to read.

Since TimescaleDB is creating a new partition for each chunk of time, it should be able to maintain its ingestion rate consistently for as long as you have storage to store that data. Perhaps it won't keep up with distributed, eventually consistent databases, but such databases generally have very limited analytical power, and if you're using them for anything but time series data, that whole "eventual consistency" thing requires a lot of careful thought.

comment 8y ago · link · parent

That's a comparison between macOS and Windows, not the SSDs themselves. I would not have believed how terrible Windows is at small file I/O unless I had seen it myself dozens of times over the years. If they had put Linux on one of those laptops for comparison, I would consider a chart like that fair.

If you actually read technical deep dives like AnandTech posts on SSDs and MacBooks alike, you would see that they really do perform identically to what Apple ships... because Apple is shipping industry-standard SSDs. Apple chooses expensive SSD chips, sure, but it's the same NAND everyone else has. Only the most recent generation of MacBooks (since the T2) has actually integrated their own SSD controller, inside the T2, but it's still the same physical industry-standard NAND chips underneath.

comment 8y ago · link · parent

> Others can just do it by scanning a wider time frame or the entire table.

"Scanning the entire table" for every request to have the last value recorded is rarely a practical option.

> KDB+ supports this with "asof" joins.

> [...]

> Again I question how common this query is and whether it's really worth limiting yourself to a special TSDB because of it.

KDB literally markets itself as a time series database. What's the point you're making again?

I think TimescaleDB lacks an "asof" function for now, but it makes up for it by having the full power of PostgreSQL for other stuff. Regardless, Time Series databases like KDB and TimescaleDB are useful.

EDIT:

it looks like TimescaleDB recommends using

  ORDER BY time DESC LIMIT 1
to get the most recent value for any particular set of sources that you're SELECTing over, which would use indices and be reasonably fast.

comment 8y ago · link · parent

> Timescale, for all their wonderful marketing, is just an automatic sharding extension for Postgres database. You can accomplish the same yourself using native partitioning, or pg_partman, or Citus or any number of other tools.

Put another way...

"Postgres, for all their wonderful marketing, is just an automatic data organization system for <underlying filesystem>. You can accomplish the same yourself using open, read, write, or any number of other syscalls."

You're doing the whole "large simplification" thing again. Yes, you can do everything yourself. No, you don't want to do that. Postgres by itself is not great for time-series data. Time series databases are useful, as your reply even showed, except for the part where you seem to assume any software that doesn't do something entirely novel is simply a quick abstraction that you could just whip up yourself.

Column stores have advantages over row stores, but they also have disadvantages. Your statement that it "comes nowhere [close to] the capabilities of cutting-edge column stores [...]" could just as easily be reversed as well.

comment 8y ago · link · parent

> No special "TSDB" needed.

I think that is a large simplification. I recommend this (relatively) short article: https://blog.timescale.com/timescaledb-vs-6a696248104e

The first graph is particularly salient.

comment 8y ago · link · parent

I haven't had a chance to read the article yet, but Anand Shimpi is hardly "Apple marketing." He was almost certainly hired because of his technical expertise, not for any marketing ability.

If I were to speculate, due to his decades of industry experience evaluating hardware platforms, his role in Apple is to provide strategic direction and guidance on how to build the best hardware platforms. I can't think of any other role they would have wanted him for... which could be a failure of imagination on my part.

So... no, it's not "Apple marketing". Anand Shimpi is involved!

comment 8y ago · link · parent

However, Hetzner has apparently been around for 21 years, as I've learned. They actually started doing this before Amazon. It's possible that they're just massively underappreciated, or people had reasons to pick something else over that extended period of time.

A lot of discussion here has pointed out that most people would rather have easy access to managed services from AWS (or GCP, Azure, etc.), rather than hiring engineers to manage and operate their own in-house copies of those services, and I tend to agree.

comment 8y ago · link · parent

It would be funny if I agreed with you about who is thinking these thoughts, but I'm pretty sure this line of thought is exclusive to employees at medium / large corporations, not startups.

At a startup, these decisions are often made either collectively or from the top. In either case, no one is getting fired for picking something other than AWS, and startups are more willing to take technology risks.

comment 8y ago · link · parent

What's the catch? If Hetzner were that good at that cheap with no catches, why haven't they steamrolled AWS, Packet, DO, and everyone else?

comment 8y ago · link · parent

a 100% markup = 2x cost, not 10x cost, right?

But it's not necessarily about the hardware of a single server. I know nothing about Hetzner. I know that AWS puts a ton of thought and money into their networking and power infrastructure, but how trustworthy is {random competitor}'s infrastructure? Is there a catch with Hetzer, or how are they this cheap?

I have a lot of experience with DigitalOcean's services. If they offered bare metal, that would be cool, as whitepoplar said. Packet is a bare-metal AWS competitor that I know a lot more about and trust quite a bit. None of this means you're going to trust my experiences.

comment 8y ago · link · parent

Anything you can run on Linux, you can run on a Chromebook, without even having to do anything hacky these days, as I understand it.

So, nothing to do with JavaScript specifically.

comment 8y ago · link · parent

> I don't want a DIY arduino-hacked ...

This is a professional service being done by the same professionals who you're paying to actually replace the suspension, brakes, brake lines, or other life-critical components. If you can't trust them to make a good judgement on how or whether to reset tamper detection, then how can you trust them to replace your brakes or suspension in the first place? Surely the idea is that some company would develop and test a process for resetting the tamper detection now that it is apparently legal, and then this tool would be provided to mechanic shops.

> and you take full legal responsibility for any accidents this might cause in the future.

Do mechanics take full legal responsibility for any accidents caused by replacing your brakes or other things? I'm sure in cases of egregiously negligent behavior, they could probably be sued, but most of the time it would be very difficult to prove that they were the cause. I don't think this would be any different.

> Nobody should tamper with critical control systems.

If you believe this, it sounds like you buy brand-new-only cars the moment your existing car turns on any kind of fault light. But, assuming you're okay with them swapping in a $2500 replacement instead, do you believe in this idea so strongly that you would pay 10% to 20% of the vehicle's MSRP any time a fault triggers? Keeping in mind that a vehicle's MSRP has very little to do with its used market value. $2500 could easily be 30%+ of a vehicle's actual value at the time that this occurs.

I get where you're coming from, but I think the strength of your language is out of proportion with the suggested repairs.

comment 8y ago · link · parent

Your formatting didn't work, but no, it doesn't "look painful."

What you wrote does not guarantee vectorization, it just relies on autovectorization.

Rust already does autovectorization magically behind the scenes thanks to LLVM (which Julia also uses), but explicit SIMD makes it a guarantee.

comment 8y ago · link · parent

Considering it was announced at least as far back as August[0], I highly doubt it.

[0]: https://blog.digitalocean.com/2018-mid-year-product-update/ (look at the bottom of the article)

comment 8y ago · link · parent

> These days OS threads are a totally viable option for building highly concurrent network services on Linux. Spawning hundreds of thousands of threads works fine and is fast enough for most applications.

I don't agree. If you're at the point where you need to handle such large numbers of concurrent threads, my own experience and online benchmarks clearly show it is not fast enough. Why are none of the top performers on the TechEmpower benchmark using a thread per connection? The simplest answer is that that can't or they would, since it would be a waste of time to reimplement so much in userland.

More anecdotally, I have been unable to get my Fedora laptop to spawn more than a few tens of thousands of threads before the kernel tells everyone that "resource is temporarily unavailable" to any process that attempts to spawn a new thread or process until the offending process is stopped. I've googled the issue extensively, tweaked countless knobs, and come up empty handed. I'm certain the Linux kernel can spawn more threads than that, but my point still stands that it is nontrivial.

In theory, that's a great perspective you presented. However, the async interfaces into the kernel exist for very real reasons.

I would also challenge you (if you're bored) to write a C, C++, or Rust program that spawns 1 or 2 million threads that do nothing but sleep for a very long time, and write a similar program in Go. See how the two compare in how long it takes to launch all of the tasks, and see how much memory they use. Ideally, you would also use, say, Rust futures + tokio and spawn a million sleeping futures to compare there too, but futures and tokio aren't the most intuitive or well documented things yet, in my opinion.

I've done similar tests in the past, and OS threads are not a lightweight resource.

comment 8y ago · link · parent

I don't understand the point you're trying to make. In networked stuff, the (a)synchronicity absolutely does make something fast or slow.

Suppose you have a synchronous web server with 4 threads, synchronous naturally means that each thread can only handle one request at a time. Each request can take dozens or hundreds of milliseconds to complete, just by being bottlenecked on latency. If it takes 100ms to complete each request, that server can only handle 40 requests per second.

If that server were asynchronous, each thread could handle thousands of simultaneous connections, making the performance literally thousands of times better at a minimum.

If you suggest spinning up an unlimited number of OS threads, that's quickly going to run into problems because most OSes can only handle a couple of thousand threads before you start running into OS limits that you have to adjust, knobs for which aren't always easy to find, and even then, each thread takes a significant amount of time to start and stop, as well as much larger amounts of RAM.

An alternative solution is green threading, which Go calls Goroutines, for example. In such a system, the asynchronous operations are handled by the underlying runtime and your code can treat them as synchronous and just spawn new "threads".

If you disagree, I would love to hear a more detailed response, because I can't see how your claim could be true.

comment 8y ago · link · parent

> It's not that he's unwilling to make it run on stable, it's that he has to sacrifice ergonomics to make it run on stable.

Two sides of the same coin. I clearly disagree about the amount of ergonomics that would have to be "sacrificed" in order to make the library usable in a production environment (on stable). So, it's simply an unwillingness to bring the library to stable, from my point of view.

Take Tower Web for example: https://medium.com/@carllerche/tower-web-0-3-async-await-and...

This has very similar ergonomics to Rocket in that it allows decorating handlers with their route, but it runs on Stable Rust. If you want to use `async fn`, that requires nightly for now since that's literally the nightly syntax for an async function, but the route decorators work on stable. As I previously mentioned, Tower Web is not mature, so I would not recommend it at this stage, but it shows what is possible.

I don't personally think that decorating handlers with routes is significantly more ergonomic than defining a table of contents somewhere else, like Actix does it. Defining routes is usually a very small part of your code that you do once and move on. Beyond that, what ergonomics are we talking about?

Actix can easily and automatically deserialize JSON into structs, for example: https://actix.rs/docs/extractors/#json

comment 8y ago · link · parent

That was definitely true before Rust 1.15, but it becomes even less beneficial with each new stable release.

I work for one such prominent early adopter of Rust, and we were very happy to move to stable sometime back. Stable versions are widely used, so issues are much more likely to be noticed, and fixes are backported to the current stable release.

If you pick a random nightly version, you have much less support to begin with simply because fewer people use it, and you're on nightly because you're dependent on features that haven't been as thoroughly tested as those features that exist on stable, and which could disappear entirely in the next nightly. Each time you upgrade to a different nightly increases the risk of introducing some hard-to-find bug into production.

Some companies do use nightly Rust in production. You're completely correct. It's just not something that I would personally be willing to do unless I had absolutely no reasonable alternative.

comment 8y ago · link · parent

Rocket requires the nightly Rust compiler, which isn't something I find acceptable for production applications, and it's synchronous, so it's really slow. I have been rather disappointed by what I perceive as the author's unwillingness to work towards stable Rust. They have a GitHub issue where they track all of their dependencies on nightly, and kind of just say they aren't going to do anything about it -- it's up to the Rust core team to just make all the things stable that Rocket is using, or else it will stay on nightly forever.

Rocket's biggest feature is their flashy website, in my opinion. Their website is really nice looking and the self-assured marketing is convincing to readers.

Actix-Web seems like a more mature framework (I don't expect my application to randomly break), it's asynchronous (so it's really fast) and it works on stable Rust. Warp and Tower Web look like promising async frameworks, but they're not very mature yet. Rouille is a pretty stable option for a simple, synchronous web framework.

comment 8y ago · link · parent

At a previous company I worked for, we used self-hosted GitLab, and the performance seemed really great. I haven't ever really used their hosted offering, so I can't tell whether I just had a low bar of satisfaction or if hosted GitLab allocates significantly fewer resources to each tenant than what our single-tenant system had. I would guess it's the latter.

I've also heard increasingly good things about Gitea, which is written in Go instead of Ruby, so I would expect it to have better performance on a given amount of hardware.

comment 8y ago · link · parent

I guess you have to make your whole frontend open source if you use their editor under that license? I'm not sure how GPL interacts with scripting languages. Do you have to run GPL scripts on a GPL'd interpreter for it to be permissible?

Regardless, the pricing for their commercial offering seems really intense. $29/mo for 25 MAU? I feel like they're missing a few zeroes there. Maybe they meant 2,500 MAU? 25,000 MAU? The demo I played with makes it clear that the editor component is rather nice, but I would rather look at alternatives at that price. I would imagine the collaborative nature is what influences the price, but somehow Google Docs and MS Office do fine with collaboration as a core product feature without charging >$1/MAU just for that feature.

comment 8y ago · link · parent

> I don't see where the 50/50 split is.

There are 3 articles under "In support" and 3 articles under "Against". A pretty literal 50/50 split.

comment 8y ago · link · parent

That's kinda my point. If stdout or stderr fails, what are you going to do about it? The normally correct solution is to panic/terminate the program. Having a simple "print" function that does that is an obvious nicety.

If you want something different, use a library or some other parts of the stdlib. Making that super common use case painful is not obviously a good decision.

comment 8y ago · link · parent

If something bad happened, that seems much more important to ensure it printed than printing output saying that everything is working just fine.

This trade-off is not self-evidently correct... it's easily boiled down to personal preference. Consistency would be nicer. Zig is not "optimal" just because someone says it.

comment 8y ago · link · parent

The discussions I saw on Reddit were strongly in favor of `check`, and the link you provided seems to show a 50/50 split, so your summary surprises me. People suggesting changes doesn't indicate that people oppose the idea, in my opinion... it means they're interested in making sure the execution is good.

comment 8y ago · link · parent

I'm not sure about you, but I think I can pretty easily deal with non-luxury accommodations for 30 minutes.

comment 8y ago · link · parent

> So, we decided it was time to revamp a feature that probably won’t land us on the top of TechCrunch, but it will save our customers time, money and frustration. We’ll reveal this feature next Monday, on October 15th.

I'm honestly not a big fan of how this article isn't even going to discuss the product idea that's teased in the title.

It's a teaser for a teaser.

The odds of me running into the follow-up article are pretty slim, so this just seems like a lost opportunity to actually communicate what's coming.

1
6263646566