Better HN
topnewbestaskshowjobs
Log inSign up

coder543

6,699 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 7y ago · link · parent

One word: atomics.

A simple example would be concurrently writing into a shared queue. To make it really simple, let's assume that this queue's buffer can only be written once, and then the program has to exit.

If we have a buffer in this queue that can hold 20 messages, and an atomic integer that represents the current index, then we could have two (or however many) threads writing into it at the same time by just doing "index = myAtomic.fetch_add(1)", which will atomically add one to the index, then return the previous value. Atomics are supported at a hardware level, so they're generally pretty efficient, and there definitely is no lock like a Mutex involved here. In the end, both threads are able to write into shared memory without conflicting with each other. Using one or two more atomic integers, we could support having one or more readers reading off of the queue at the same time that we're writing to it, and we could get to the point where we're able to start reusing the buffer in a circular fashion.

comment 7y ago · link · parent

Do those channels support async? Since C# is built around async/await for scaling to large numbers of connections / tasks, they wouldn't be very useful if they didn't support async, but I'm not familiar enough with modern C# to figure out if they do or not.

comment 7y ago · link · parent

ok, that's pretty intense.

comment 7y ago · link · parent

The commenter above could have been saying the seats cost the same as Lamborghini seats, which is plausible, or that it costs the same to print a picture of a Lamborghini onto the packaging as it does to print a picture of an airplane seat, which is true. There are many plausible ways to interpret their statement as being correct, but I don't think they're saying any airline seats cost $200k.

comment 7y ago · link · parent

Stories on HN can't be downvoted, just FYI.

comment 7y ago · link · parent

I'm not sure how you got that $25 = 41 years of 120GB of storage on Backblaze.

Their current pricing appears to be $0.005/GB-month... which would be $295.20 for 41 years of 120GB of storage.

> i wouldn't trust a cheap SSD to still work in 41 years

I wouldn't trust almost any company to still exist in 41 years, including Backblaze. Preserving data over that length of time will probably require active management of the data in some form or another. DVD or Blu-ray discs might last that long... but it's hard to trust any storage medium to last for 41 years. Modern storage technology just hasn't existed that long.

comment 7y ago · link · parent

That might work for physical product, but when you claim your software download is sold out, people tend to give you funny looks.

You can definitely put up a product page where users can enter an email address and start building up a mailing list, but obviously mailing list recipients are not guaranteed to pay you money.

comment 7y ago · link · parent

Saying C/C++/Java/JavaScript makes me think you've created 4 different syntax frontends for LuaJIT, when there is really only one here.

It seems to me that you're really trying to express a concept that could be referred to as "C-like syntax" or "JavaScript-like syntax," with the latter probably being more accurate. It would certainly be less confusing than repeating "C/C++/Java/JavaScript syntax" over and over.

comment 7y ago · link · parent

The Ubuntu base image is Ubuntu 16.04, which is an interesting choice. 18.04 LTS has been out for awhile now, so I would have expected it to at least be an option.

comment 7y ago · link · parent

how would application signing not help?

if the OS won't let the user install the malware, that's the end of the line.

As I said in my original comment, I don't think Windows 10 is as fragile as earlier versions. A large part of this is the additional enforcement around application signing, even though it isn't as strong as what macOS does by default.

In earlier versions of Windows, it absolutely did "just happen" from a non-technical user's point of view. Linux, macOS, and (to a slightly lesser extent) Windows 10 do not allow it to "just happen".

comment 7y ago · link · parent

I really doubt that, but I can't easily argue with an anecdote, so sure. It happened, probably 15 years ago.

Windows was famous for tons of installers bundling toolbars, but that's never been an epidemic on Mac.

These days, Macs will not install unsigned software by default, and you can lock that down to App Store only with a single setting change, so they're certainly not getting bundled malicious toolbars from installing software... since distributing malware is a quick way to get your developer signature revoked, and you're certainly not going to be installing toolbars from the App Store sandbox.

That leaves manually installing malicious toolbars through the official extension store for whatever browser they use. All extension stores do their best to weed out malicious extensions these days, and it takes intentional effort to install extensions. It doesn't just happen while you're trying to do other things.

Obviously, toolbars don't even exist on iPads, and software installers bundling random malware is obviously not a huge concern on Chromebooks. A MacBook was not at the front of my list, so I don't know why you chose to singularly attack that option. Maybe you thought it was the easiest target?

comment 7y ago · link · parent

Effectively all x86_64 hardware from the last 10+ years supports hardware virtualization, so I can't agree.

comment 7y ago · link · parent

I'm pretty sure that's not the only alternative... some others include a Chromebook, an iPad, a MacBook, or even installing a Linux distro and setting it up for them such that they don't need to use the CLI to accomplish the things they want to do.

But honestly, my opinion is that Windows 10 is not as fragile as earlier versions of Windows were.

comment 8y ago · link · parent

> K8s also allows upgrading apiserver connections to full, live, end-to-end HTTP/2 websockets.

There's no such thing as an HTTP/2 websocket.[0] Websockets are a purely HTTP/1.1 concept, and they're only HTTP/1.1 until the moment that the `Upgrade` happens, at which point the TCP socket gets hijacked.

I'm confused as to why HTTP/2 is mentioned. I guess they just mean a normal websocket?

[0]: https://medium.com/axiomzenteam/websockets-http-2-and-sse-5c...

comment 8y ago · link · parent

The article seems to be saying that MySQL's sleep function pauses the entire database for the duration, whereas PostgreSQL's will just sleep that connection for the specified duration and other connections can keep working.

comment 8y ago · link · parent

I don't think even the human brain can consistently figure out what's going to be available in Ruby.

Oftentimes, the only way to know is to set a breakpoint, run the code, and inspect it at runtime. This is why the tooling sucks even more for Ruby than most dynamic languages, and the code completion and static analysis will almost certainly always be worse than the equivalent tooling in a statically typed language where more things are knowable.

If you feel so strongly about tooling, I recommend learning Kotlin, Go, or C#, all of which offer incredibly strong tooling with essentially perfect code completion, jump to definition, and real time code analysis.

comment 8y ago · link · parent

Modulo arithmetic refers to the property of fixed-size integers where they will predictably wraparound in expected ways if you overflow or underflow them. This wraparound is "free", so it used to be commonly used for cyclic high performance code. An arbitrary bigint is computationally more expensive, and it will never experience this effect, so it's a double whammy of irrelevance for bigints. You can manually do a modulo operation on a bigint, but that just makes them even more computationally expensive than a fixed size int, requires more code, and would be considered an unnecessary inconvenience by most people who care about modulo arithmetic.

comment 8y ago · link · parent

> it just makes it harder to port all kinds of code that relies on modulo arithmetics.

If you're relying on modulo arithmetic, you should be using a fixed size integer anyways, not one that varies based on the architecture. Go has fixed size integer types available, and modulo arithmetic should be using those, not "int".

comment 8y ago · link · parent

If you're saying there are more Oracle DBAs because they are paid more, that's the opposite of the point I was making. Basic supply/demand economics would indicate that you'll have a surplus of something that is falling out of favor, and that surplus will be inexpensive. There would be many looking for jobs because it used to pay well when it was in demand and there was a shortage, not because they're making lots of money looking for jobs.

If you're having trouble finding decent Postgres DBAs to hire, it could be that other companies are snapping up all the good ones, and that you're not offering enough.

You're presenting anecdotes, I'm presenting anecdotes. Exciting stuff. Market shifts take quite a few years, so I'm sure there are still plenty of high paying Oracle DBA jobs, and I'm sure that there will probably always be some of those jobs to support legacy systems.

comment 8y ago · link · parent

Lambda seems pretty reasonably priced, but Step Function transitions seem absurdly expensive to me. Who is actually using Step Functions?

comment 8y ago · link · parent

I edited my comment a few times after I posted it. I hope that you are responding to the most recent version, but your response leaves some doubt in my mind that this is the case. I am certainly passionate about recognizing that there are no perfect tech solutions, including DigitalOcean and Lambda.

comment 8y ago · link · parent

The math does not check out.

Using your numbers and current Lambda prices:

5M GB-seconds * $0.00001667/GB-sec = $83.35

(5,000,000 * 0.00001667 = 83.35)

2400M function invocations * $0.2/million = $480

(2400 * 0.2 = 480)

total = $480 + $83.35 = $563.35/month, which is nowhere close to $17k/mo. I have no idea how you got that number.

I also find it highly unlikely that most businesses are servicing 2.4B requests per month on their API. In my opinion, you either have to be an absolutely enormous monster of a business or have a really unusual business model to be at that level of utilization and not be huge.

Whatever your business, you're unlikely to be spending $10/mo in resources to service nearly 30 billion requests per year. You're probably going to need more than $10/mo just to store the access logs for your API, let alone useful customer data!

In reality, a lot of entire businesses would be much lower in utilization than that. The downsides of a single DigitalOcean droplet are many: a single point of failure, and you'll never achieve high availability if you apply updates regularly and reboot, unless you have multiple $10/mo droplets and a load balancer. You'll also have high latency to customers outside of your region of the world, unless you run a HA-cluster of multiple droplets in each regional datacenter that you care about. Call it three droplets per region and we'll say you want to run them in five regions, so that's $150/mo just in droplets alone, plus a $10/mo load balancer per region, so $200/mo. Did I mention that you or your engineers are going to be responsible for doing the maintenance and replication across regions? Surely the number of engineering hours devoted to this upkeep will be worth more than $350/mo. Huh, I guess we just justified Lambda's costs.

And again, I never claimed this was some kind of snake oil magical solution.

I don't know why you think I'm opposed to the DigitalOcean solution and some sort of salesman for Lambda. I use DigitalOcean heavily for my personal stuff, and I almost never use Lambda, even though I like the idea. You've created a strawman, and you're trying to expertly knock it down... except for the whole math thing as noted above.

If we really dig into this, neither the DigitalOcean solution nor the Lambda solution discussed accounts for the cost of running your stateful infrastructure, whether it's a traditional RDBMS, some NoSQL system, Kafka, or just a giant object store like S3.

My singular point in this entire thread was that scale-to-zero is worthless if the solution that enables scale-to-zero costs more than not scaling to zero. If DigitalOcean is the solution that costs less than scaling to zero, then obviously that is more valuable than the solution that scales to zero.

comment 8y ago · link · parent

I mean, the first 1 million Lambda invocations and 400,000 GB-seconds of compute are free each month... you can do a lot of things within the free tier alone. That free allocation represents about $7 worth of Lambda resources. Assuming that it cost the same to write your application to run in Lambda as it would to write it as standalone, which it almost certainly doesn't due to (probably) immature frameworks, that would be really nice for certain businesses. I agree that it is a niche, and savings of a few dollars a month aren't generally valuable to viable businesses.

What I was getting at is that the "scale to zero" feature with Knative is rather worthless if you spend more money just running the Kubernetes master on EKS alone than you would spend running a $5 or $10 per month DigitalOcean instance.

Lambda scales all the way to zero, and it's free when it's at zero. You just pay for what you use. Actually, you pay for what you use minus $7, since every account always gets the free tier for Lambda.

comment 8y ago · link · parent

Universities are often... influenced by big companies, and do not necessarily use technologies that are representative of what you'll see in the real world. They could be, by random chance, but it’s not necessarily the case. Anecdotally, I usually hear from people that it wasn’t representative when they are comparing what they learned in college to what they use in the workforce.

It also really annoys me when universities teach their students expensive, proprietary software that they won't be able to use outside of class when there are competent and often superior free options. These students are paying good money to learn, and the universities are intentionally choosing to teach them something less than the most beneficial knowledge that those students could reasonably be learning about.

comment 8y ago · link · parent

Maybe there's a reason that there's a surplus of Oracle DBAs and a shortage of Postgres DBAs.

comment 8y ago · link · parent

I really don't think it's 20x the cost of Aurora in general, considering that Aurora costs are not that simple, but I don't have time to run the numbers, so let's go with that for a moment. Do you really think Amazon would introduce a product that's 20x as expensive if they didn't know there was a market for it?

comment 8y ago · link · parent

I personally recommend using a SQL database until you're absolutely positively sure you don't need one, for many reasons.

But, as far as the "you end up overprovisioning" because of hotspots thing, DynamoDB does offer autoscaling these days, which should alleviate a lot of provisioning-related headaches and save you money compared to the provisioning you would have done with DynamoDB, from what I understand.

comment 8y ago · link · parent

That's not completely accurate.

- If we're talking about a business that provides a service to local companies, there are quite a few hours during the week where everyone is either asleep or enjoying their weekend. Not every company has millions of users spread across every time zone; some companies provide a niche service to a small number of high paying users.

- Lots of developers have small hobby projects that are inactive for most of the day/week.

Scale to zero can be convenient, but it's not usually a make-or-break thing.

1
606162
66