Hacker Newsnew | past | comments | ask | show | jobs | submit | more BiteCode_dev's commentslogin

Reading the RFC, this seems to make HTTP stateful:

"A subscription is different from a GET connection (e.g. a TCP connection, or HTTP/2 stream). If a client requests "Subscribe: keep-alive", then the subscription will be remembered even after the GET connection closes."

It also uses PUT to patch things, but then why not use PATCH ? You could say it's non standard, but at this point, everybody uses it. Plus their stuff apparently deviates from the HTTP standard as well by allowing headers after the first line of the payload and introducing the forGET command.

Or am I missing something ?

Interesting anyway, especially the way they create of graph of unique ID to solve the ordering problem. Feels like Git. The flow of patch reminds me of react-redux.

Plus it's great to have more geeky technical things on HN. I'm missing it, among all the news and start up things.

They also mention a really cool RFC on a JSON patch format: https://datatracker.ietf.org/doc/html/rfc6902

I'm reading RFC and getting excited about it. Damn, that must be what they call growing old.


I agree, this RFC seems to propose a great deal of different additions/changes to the HTTP protocol without a unifying reason why. But the committee/process is all in the open, through the IETF, so now is the time to voice your concerns!

> Reading the RFC, this seems to make HTTP stateful

The reasoning behind this seems to be that the alternatives right now are either polling or a homegrown websocket based protocol. The authors argue that rather than continuing to let different implementors make bespoke or otherwise non-standard polling/subscription based websocket implementations, to standardize on a RESTful way to subscribe to a stream of updates.

> It also uses PUT to patch things, but then why not use PATCH ? You could say it's non standard, but at this point, everybody uses it. Plus their stuff is apparently deviate from the original standard as well by allowing headers after the first line of the payload and introducing the forGET command.

I've personally seen both PUT and PATCH used for updates, so this didn't seem particularly odd to me, and seemed more like a nod to one particular method of updates.

But yes, the overall RFC is proposing to modify HTTP from a state transfer protocol to a state synchronization protocol, so that clients and servers have to hold onto state and send diffs between their internal states, and then implement some reconciliation algorithm (e.g. OTs or CRDTs) to merge state. This seems like it is in response to a myriad of bespoke long-polling or websocket based update mechanisms.

> They also mention a really cool RFC on a JSON patch format: https://datatracker.ietf.org/doc/html/rfc6902

Yup! Super cool right?

> I'm reading RFC and getting excited about it. Damn, that must be what they call growing old.

Well, you could do that, or you could read yet another article about startup financials, which is all that seems to trend on HN these days ;)


> this RFC seems to propose a great deal of different additions/changes to the HTTP protocol without a unifying reason why

To read more of the unifying why, I suggest checking out the original Braid draft from last July: https://datatracker.ietf.org/doc/html/draft-toomim-braid-00. We had a much longer introduction in that version, but shortened it in braid-http-01 so that we could cut to the meat.

If the why still isn't clear after reading braid-00, please let us know on the mailing list: https://groups.google.com/forum/#!forum/braid-http. And on the other hand, if something in braid-00 helped, we'd also love to hear what, so that we can add that back into the braid-http-01 draft.


I really found these lines in braid-00

> Braid is a proposal for a new version of HTTP that transforms it from a state transfer protocol into a state synchronization protocol. Braid puts the power of Operational Transform and CRDTs onto the web, improving network performance and robustness, and enabling peer-to-peer web applications.

> At the same time, Braid creates an open standard for the dynamic internal state of websites. Programmers can access state uniformly, whether local or on another website. This creates a separation of UI from State, and allows any user to edit or choose their own UI for any website's state.

to be very useful to set the overall motivation. If I could humbly request, I think having them in subsequent drafts would be very nice! Thanks for the reply and thanks for all the good work!


Will do! Thank you very much!


I really like the RFC.

Two questions:

- do you think it would make sense to allow the "Patches" header only in PATCH and not PUT?

- how do you feel about a generic "subscribe" mechanism that is not specific to sync but can just say "I'm interested in this topic, with this params" ? Then this could be specialized with the version+parents params to get sync. This way we get a generic HTTP standard for PUB/SUB, which is badly needed, and is a very basic primitive you can build many things on. It would be a shame to have to add one after the fact.


Thank you very much!

Does EventSource meet your need for a generic subscribe mechanism? https://developer.mozilla.org/en-US/docs/Web/API/EventSource

I'm also curious what use-cases you have for a generic pub/sub beyond synchronization. In my experience, 95% of pub/sub implementations are used as a substrate for synchronization.

As for using PATCH vs PUT, this is an open question. I'd love to see more discussion of it on the mailing list: [email protected]. There are a number of pros and cons on both sides.


EventSource is only from the server to the client. Pub/sub goes in any direction: client to client, client to server, etc.

Crossbar.io provides that with websocket.

Eventsource + the sync rfc would mean everybody would build a non standard bridge for this to link a publication, a sync from the server and an event source. And because we only need 2, and they are overlapping, several completly incompatible de facto solutions would emerge.

Pub/sub is useful for any kind of communication that doesn't involve a resource: notifications of events , communication between microservices, etc. Basically anything that doesn't have a need for an history.

Of course, you can always create abstract conceptual resources you sync with to obtain this effect. E.G: the "streaming service is down event" could be a sub to a "service/streaming/heartbeat" event that you sync, and ignore versions and give no parents. It's just a bit twisted.

It feels more natural to have a pub/sub primitive that goes back and forth in any direction, and build the specific case for sync with that. Even if sync is 90% of the time what you want.


> "I'm interested in this topic, with this params"

Couldn't you just do this with URIs? Like if you "GET /topic/foo" with a Subscribe header you get the foo topic, and "GET /topic/bar" gets the bar topic?


Yes, the question is whether to make it a standard.


> The reasoning behind this seems to be that the alternatives right now are either polling or a homegrown websocket based protocol.

Right. Same with routed RPC and routed PUB/SUB. I currently use the WAMP (protocol, not stack) for that, as it is a Webocket based IANA standard, but with http2/3, having the HTTP version of it would make sense to have this baked in as well.

In fact, their subscribe thingy should probably be more generic and accept a topic and optional params. Params could be then use to upgrade the use case, like version+parents for sync. Plus client may want to push events as well.

I don't know how one can contribute to the debate. Would you explain it to me?

> I've personally seen both PUT and PATCH used for updates, so this didn't seem particularly odd to me, and seemed more like a nod to one particular method of updates.

PUT in REST is for sending the full object, PATCH is for partial updates. So both are valid, but I would allow the "Patches" headers for the PATCH method only.


> I don't know how one can contribute to the debate. Would you explain it to me?

The official venue for IETF discussions is the mailing lists. Braid is being discussed in the HTTP Working Group, on this mailing list: [email protected]. I suggest drafting an email saying something like:

"Hi, I learned about the Braid spec on Hacker News. I am interested in it for reasons X, Y, and Z. Overall, my thoughts on the spec are W. However, the current draft allows sending patches in PUT, POST, and PATCH, and I would only allow the Patches header in the PATCH method. Does anyone have thoughts on this?"

Thank you! I'd love to have your thoughts contribute to the consensus process.


> this seems to make HTTP stateful

Yes -- depending on how you look at it. HTTP already has cookies to implement stateful sessions. Braid does add subscriptions; but HTTP 1.1 and 2 also has keep-alive at the TCP level: https://en.wikipedia.org/wiki/HTTP_persistent_connection

> It also uses PUT to patch things, but then why not use PATCH?

You can use PATCH, or even POST, too. We haven't settled on a single best method to use, and in fact you'll notice different methods being used in different specs, depending on the personal preferences of the author that wrote that spec. :) I recommend checking out the Range Patch spec for more: https://datatracker.ietf.org/doc/html/draft-toomim-httpbis-r.... You'll see a lot of PATCH in there. :)

Also, please feel free to start a discussion on the mailing list about this: [email protected] It's an issue that needs discussion and consensus more generally in HTTP.


> You could say it's non standard

Isn't PATCH standard?

What is non-standard about it?


PATCH became a standard in 2010 (https://tools.ietf.org/html/rfc5789), I just never patched my brain with this new revision and had stale data.


9 year max-age; impressive.


People don't use it and a lot of web frameworks don't have first class support for it. The main benefit is making the request more semantic. Idempotency etc. isn't always that useful on the protocol level so GET & POST is more than sufficient for most purposes.


I would check why my code do 500 requests in the first place. That's unsane unless you do some kind of video game.


This is all I am doing to serve images:

https://gist.github.com/4lejandrito/6d4f903e0a692b87344e8600...

The resize function only resizes the first time and uses a cached version of the image after that.

I checked the server and the CPU is not too high so I think it must be HTTP as parent pointed out.


Yes, I checked and all I see is 22 requests. I don't know where OP got the 504 numbers. It also loads instantly for me.

Ignore my comments, then.


I misunderstood your original comment. The reason why there were 500 requests is because I was showing a background full of creepyfaces. It made the site look much nicer but it turns out it didn't scale very well.


:) Well, good thing you updated the site then.


500 requests are perfectly reasonable here. It loads mutliple pics per example avatar. And there are many examples. The only problem here is HTTP/1.1.


From what I see in my viewport, no it's not reasonable.

Using 500 requests for this because http2 exists is like stating it's ok electron apps eat 1 Go of ram because we have big configs today.

That's also why, in 2019, with quad cores, SSD and more memory than ever, things doesn't feel faster than 10 years ago.


Turns out the other heads were removed so it's not doing 500 requests anymore. So where does that leave us? Should we keep arguing over the original situation?


Do you think Windows or MacOS make compromise on the way they code their kernel to accomodate nVidia ?

No, it's just a matter of economics.


Yes, Windows has a stable driver API you can build upon.

Linux does not, because they want all drivers to be inlined (included in the kernel) and open source. nVidia does not want to release their trade secrets, so they don't want to open source their drivers.

(No idea about macOS)


Of course, AMD managed, so there’s no technical reason that nVidia cannot.


Except that AMD doesn't have feature parity with Windows driver on open source version and has all the Nvidia driver headaches on closed source version.

I'm not sure what AMD really managed here.


AMD's open source driver is fully usable for normal usage (including gaming), and in general more performant than the closed source version.

https://www.phoronix.com/scan.php?page=article&item=rx590-li...


Still behind the proprietary Windows driver or Nvidia's proprietary Linux driver.


They are not behind their windows driver on OpenGL. And neither for Vulkan, I think. AMDVLK scores a few wins here and there, but RADV is generally more stable, performant, and compatible. Plus being open-source, it is easily extended, like valve is doing with their AC0 experiment [1].

Last I heard, people were installing Linux to use the AMD OpenGL drivers to play emulators (it might have been Cemu, actually ran trough wine).

[1]: XDC2019 slide deck https://xdc2019.x.org/event/5/contributions/334/attachments/...


Can you share some source of your statement?


It doesn’t have “all” the headaches on the closed source version, afaik - it still implements the standard APIs and thus works with systems that were designed to work with every other driver from AMD to Mali, unlike the nVidia proprietary driver.


Because it is NOT the same driver. AMD, just like nVidia, want to keep their own secret sauce secret, because that's where the money is.


Is so much of their profit bound up in their software?

I thought these were hardware companies.


I didn't say there's a technical reason, I said they want to keep their source code secret, which to me is a reasonable argument.


Well then sway maintainer's reason to explicitly deny support for proprietate nvidia driver is a reasonable argument too.


Definitely, it's his software and he can do whatever he wants, and I'm not criticising him, I'm criticising Linux for not offering a stable driver API. As far as I know they don't even want to allow shims like the one Android Treble introduced. It is not a technical decision, it's a political one.


There is a technical rationale that should be read to understand kernel dev's PoV : https://github.com/torvalds/linux/blob/master/Documentation/...


Refusing to open source their drivers is not a technical decision, it’s a political one.


Linux has a fairly stable driver API, it just doesn't have an ABI.


The GPU API doesn't seem particularly stable to me.


MacOS user: what's a driver ?

Seriously though, one of the pleasurable things about using macOS is that you don't have to worry about hardware compatibility. Because there is none, outside the small list of parts officially supported by Apple itself. There are some NVidia cards on that list, yes.


Step one: do not create a DRM standard.

Step two: if it happens, make sure it can't be a proprietary binary blob.

Step three: damn, too late.


While it is a constraint for sure, it is not so different from accommodating other people schedule anyway. As a professional, I am not available 90% of my time to interact with others: I have things to do, and if you want to get a piece of me you have to deal with my schedule. Same with my client. So what do we do ? We plan, we make compromise.

Time zones managing is the same, it just add a bit more friction to the process.

When I see people having problem with time zones, it's usually more a symptom of an deeper issue elsewhere: bad organization, unhealthy communication habits, unnecessary coupling between parties, micro-management, people not doing their job and so on.


I also like draw.io.

Yes, it's not text based, but it has such a cool hack: it saves the xml reprensentation of the diagram inside the png. So you can publish it anywhere as a regular png, and still edit it !


It's a great tool, I've used it too. I don't see them as competing as motivation may be different, both can export SVG and could be a complement.


Indeed, they are not competitors. Just for git integration alone, having a text based diagram is great.


Yes, althought in the case of wordpress, it's also because it's really badly architectured: no internal cache, so many requests for just one page, comment are loaded even when you don't read them, etc.

It's not optized at all.


The first time I peeked at wp code I was flabbergasted at how cavalier they were with piles of inefficient queries.

At the time I was tasked with evaluating it as a "cheaper" replacement for an expensive, managed CMS. My conclusion was it would end up being more expensive to accommodate all of this inefficiency with caching galore not to mention support and dealing with a loss of dynamic web sites.

I looked again last year, assuming it had greatly improved, had replaced all that with GRPC or graphql and nope, still horrendously designed.

I wonder if it's intentional or just a case of support for backwards compatibly.


Optimising WordPress is a known and solved problem. I don't mean to undermine your comment but it is trivial for a web infrastructure ops guy to deliver on. There is a lot of fud out there on the topic so it's easy not to see the diamonds in the rough.


That's not the point. The point is it's not built it, because the architecture decisions were unsound.

Now, don't get me wrong, I use and like Wordpress. There is not more versatile yet approachable blog/CMS/whatever out there, the ecosystem is huge and it's my go to tool when I want a quick and dirty solution.

But it doesn't change the fact it has been badly designed from the start.

Popularity in software doesn't reward good design. It rewards solving problems.


Totally. Made some good money, doing this for small to medium businesses. Easy work, and lots of quick wins.


The problem here is not prototyping, it's the service accepting executable code from the user.


Agree. Same in ruby

    Object.define_method('env') { { RUBYOPT: "-e puts 123" } }
Though ruby rejects it

    $ RUBYOPT="-e 'puts 123'" env ruby
    Traceback (most recent call last):
    ruby: invalid switch in RUBYOPT: -e (RuntimeError)
https://github.com/ruby/ruby/blob/b753929806d0e42cdfde3f1a8d...

And to use -r file needs to be .rb


Sleep, friends, meditation (this requires serious practice, not dabling) , nutriment supplementation (a LOT of it), cut down on sugar, weight lifting, intermitent fasting, psychotropic microdosing.

That's a ton, so I wouldn't start with more than one, preferably the easiest, then increment. They support each otber because constant anxiety for me is just the symptom that everything is going to crap.

Meditation has the strongest reward, but also the highest cost. Psycheselic have the best cost/reward ratio but may hide other problems: once you feel great, you may stop working on it.

Food, friends and sleep are hard, because they affect your life so much and requires motivation.

Supplements require no motivation, little effort to take and have a huge impact... But require a lot of reading, trials and errors et money.

Neverthless, I wish I knew all that 15 years ago. It would have saved me so much trouble, and actually work on the root problem, as anxiety is just one of the many small tip of a huge and deep iceberg.


Rebooting does that by default on android: it always requires your pin. No need to remember to press the x button n times. Just shut it down.

A good habit anyway: you don't want them to be able to poke the ram.


Rebooting resets the passcode requirement on iOS as well.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: