HNHacker News
TopNewBestAskShowJobs

kxo

29 karma · joined September 6, 2014

submissionscomments
kxo··on Handling AWS' New Spot Instance Termination Notices
SSEs even better.
kxo··on Please Do Not Be a One Trick Pony
There are COBOL devs who actually realize what they are worth and billing (banks) 200-300k accordingly.
kxo··on The Real-time Web: How to Get Millisecond Updates with REST
I am building a generic, open-source system (really just a set of light standards) to bind a message queue to a set of request/reply and pub/sub microservices.

To start: I'd like to have seamless R/R via stateless HTTP as well as websockets. I'd like to also implement transparent push events via SSEs and the aforementioned socket transport.

Naturally, inter-service communication would use the already-present MQ.

The workflow in this true "microservices a la carte" solution would look like:

Initial, one-time setup:

1) Set up NSQ (or other supported MQ - I'll start with NSQ)

2) Set up standard, client-facing frontend servers (stateless HTTP, sockets, SSE) bound to queue.

3) Set up DNS names for frontend load-balancers (ELB, heroku load balancing, whatever) for each frontend.

---

Writing a service:

1) In your language/framework/stack of choice, create a new project, include standard-sauce, language-specific server library.

2) Write a function to do what you want. (retrieve a list of users, create a post, whatever)

3) Register/bind the aforementioned function to a specific, standard, interfaceable name (using the service library)

4) Configure service library to connect to initially-setup message broker.

The end-goal is to have a standard RPC interface, standard pub/sub interface, standard message fabric across front-end clients (browser, mobile, whatever) and back-end clients (inter-service communication).

---

Internally, a call message might look like:

{method: "get", action: "users", requestId: "21739dfe-fbeb-4da9-b698-c5720cbc488d", timestamp: "2014-12-25xxxxxx"}

This will seamlessly map to:

HTTP GET (Frontend): http://api.mydomain.com/users

Websocket message (stateful) (Frontend): {method: "get", action: "user"}

ServiceLibrary call (Ruby): "Project.call(:get, :users)"

ServiceLibrary call (Node): "project.callFunc('get', 'users', callback)"

.. and you get the idea. No prescription necessary.

---

If you like ActiveRecord, Ruby, the Rails stack: rip out ActionController, rip out Rack, use the stuff you want.

If you want to use some of the amazing JS frontend rendering toolchains: hook em up.

If you need to write a simple, highly-concurrent microservice, try Go.

Rather than prescribe an entire solution (a la Meteor, Derby, etc.), take the best tool for the job and throw it at the situation.

---

The scaling story is cool, too: if your ActiveRecord-driven microservice is unable to keep up I/O throughput, rewrite it or just spin more instances up. Totally shared-nothing in this case.

kxo··on Computer Language Benchmarks Game – Rust vs. Go
Unsafe is not something that needs to be avoided.

Small, widely-verified blocks of unsafe code should be the norm if unsafe code is necessary. This does not mean "if you're using unsafe you've failed!"

kxo··on Salted Password Hashing – Doing It Right
base64 encode the password, reverse the encoded result.
kxo··on Air Fares 101 – Why do fares change all the time?
> If you could really get in for $50 a day, you could easily eat and drink that much worth.

Or just get an American Express card (Platinum, ideally - no additional fees) and net access to the Centurion lounge and all Delta lounges (when flying Delta).

The Centurion lounge is second-to-none domestically, and the Delta lounges aren't half-bad when it comes to the free booze (some are self-serve - Jack Daniels, Grey Goose, etc.)

United's clubs are a joke comparatively.

kxo··on Object Oriented Programming is Inherently Harmful
React, sort of, if you ignore the underlying clusterfuck that is the DOM.

https://github.com/swannodette/om

kxo··on Yahoo Mail moving to React
My only problem is with 3.

If you're already at the point where you are utilizing compilation, why not implement a compiler-level async/await solution (probably based off of a loop + a state machine, a la regenerator).

kxo··on Yahoo Mail moving to React
> Realistically speaking if you're doing CPU intensive tasks then Node is definitely the wrong solution

Here's the answer:

Spawn $(nproc) more Node processes, use IPC if you need to.

Good luck seizing the theoretical performance gains one might see from threading (while not falling victim to diminishing returns related to context switching) in another comparable language.

kxo··on Yahoo Mail moving to React
Really? How do you suppose nginx does it?

Or any of the other top-end (in requests/sec) webservers?

Hint: they aren't utilizing green threading and/or a scheduler.

kxo··on Yahoo Mail moving to React
> choose a single-threaded solution

For stateless web requests (solving the C10x problem), this is not inherently bad for most applications.

> which blocks the whole app if a single function blocks

This is behavior you'll see in many other languages.

Management of execution time is very prevalent in lower-level languages. The only languages not susceptible to this problem are high-level, preemption-capable, and possess some form of green threading/scheduler e.g. Erlang/Elixir.

IMO, if you need to rely on a scheduler to help ensure that blocking doesn't occur in a disruptive fashion, you're in no position to deride those who "began as a webdevs and knows nothing better."

> asynchronous call-back hells

This is a matter of taste, opinion, and necessity.

I personally hold the opinion that "callback hell" is a symptom of poor design, and properly managed callbacks are not unpleasant to work with (I may be subject to Stockholm Syndrome).

Also, try implementing an equivalent non-blocking webserver around an event loop in a lower-level language and let me know what non-callback strategies you come up with for the coalescence of asynchronous events.

As an aside, there are hundreds of different ways to improve or eliminate the composition of callbacks in JS: emulated coroutines via generators, C#-style implementations of async/await, promises, the list goes on.

> non-functional but GC'ed language

Which functional programming languages in common use aren't garbage collected? (again: in common use)

Which other common, productive, high-level programming languages (often tasked for C10K web servers) aren't garbage collected?

What does "non-functional but GC'ed" actually mean? What does the language's programming paradigm have to do with its memory management model in this context?

> I am really too stupid to get it

- People are productive and enjoy JavaScript. - Browsers, by and large, only run JavaScript code. - JavaScript on the server-side is a very capable, battle-tested building block for performant web software. - Admittedly: JavaScript is not a great language when compared to other modern programming languages. - Aforementioned opinionated gotchas aren't enough to dissuade communities from using JS.

kxo··on Let's Encrypt: How It Works
> Automagic TLS done right is an improvement from no TLS, IMHO, even if it comes with its own new set of potential attack vectors.

Is it really? Does it not potentially provide a false sense of security?

kxo··on Let's Encrypt: How It Works
Are you unable to throw any number of the faster, event-driven webservers/reverse proxies in front of Python 2.7 to satisfy your SNI needs?
kxo··on Introducing Snapcash
How do you propose Snapchat, a company primarily producing a mobile application, prevent usage of its API?

You act like someone can't (with your username and password) (automatically or otherwise) scrupulously transact on your behalf with PayPal.

If you have the username/password - in a non-MFA system - you have access to everything.

kxo··on Go is moving to GitHub
> code as close to metal as C

> without ... memory management

kxo··on AWS CodeDeploy
How about an Amazon-managed Docker (not shit ElasticBeanstalk) infrastructure/config management system?

If they handled things like EBS integration, orchestration, ELB integration, and all of the usual stuff, I'd be sold in a second.

kxo··on Half a decade with Go
I'm not totally sure how a non-optionally garbage-collected language with a runtime could ever be called a "systems language."
kxo··on Announcing Soylent 1.2
March here - All quiet on the Western front.
kxo··on Rust and Go
Are you suggesting the Rust compiler didn't catch that?
kxo··on ToroDB – Document-oriented JSON database on top of PostgreSQL
I'd really like to write a similar, mongo-compatible layer for FoundationDB.

This is great work.

kxo··on The Go Beartrap Lying in the Shadows
> It takes the best of C++, Java and Python … and then it really tightens everything up.

"in 2004" belongs in that statement.

kxo··on Game day exercises at Stripe
Why not FoundationDB?
kxo··on Silicon Valley startup unveils Internet-connected smart guns for cops
Ah yes, just what I want to trust my life to: potentially failing technology.
kxo··on Show HN: Sudolikeaboss – Use 1password on the terminal as easily as the browser
Any possibility of a Terminal.app version with SIMBL?
kxo··on Ask HN: Going from Redis to MySQL. Good idea?
You could try FoundationDB, with or without the SQL layer.
kxo··on Rust vs. C++ Benchmark Game
That's exactly what they require. mio is one such example, I am working on another implementation.
kxo··on Swarm.js and React – Real-time, offline-ready web apps
I wonder if asm.js + the sqlite3 driver + localstorage would suffice.. it would certainly be interesting.
kxo··on Analyzing the FBI’s Explanation of How They Located Silk Road
To be fair: 1600 lines is relatively small.

You could probably proof it from anything but business-level error.

kxo··on [dead]
The same Bryan Cantrill that posted this:

https://www.joyent.com/blog/the-power-of-a-pronoun

kxo··on The FBI Says How It ‘Legally’ Pinpointed Silk Road’s Server
I personally like the idea of building a machine that terminates TOR (exclusively) into VMs, allowing no other outbound (non-whitelisted) traffic.

The biggest and most obvious threat to a lot of these hidden services are application-layer attacks.

You should not be using platforms that have the ability to do vast inspection of their runtime environment or make arbitrary outbound requests.

I'm not necessarily a fan of the "SOA-over-Tor" approach for something like a Bitcoin price: the explicitly-whitelisted bitcoin-price-checker-service communicating over a small-surface API (0MQ, Rabbit (albeit this is a bit of a larger attack surface, internally)) to another VM that has externally-terminated Tor-only outbound internet access is probably easier to work with.

I should spin up a CoreOS distribution with all guest VM outbound access turned off and try out host-level Tor termination.

← PreviousPage 2 of 3Next →