738 karma · joined Oct 15, 2013 (13y ago) · 478 submissions
comment 10y ago · link · parent
* Browsers can't speak TCP natively (oddly enough)
* HTTP works through proxies
* Most web frameworks do HTTP more easily, same for web servers
Of course, the real solution here is probably to use websockets or HTTP/2, since then you get all the advantages of HTTP without the downsides of TCP.
comment 10y ago · link · parent
With that mental model, you can predict from reading some code what the possible error cases or race conditions could be, or what the state of the datastore entity would be after running some code against it. Perhaps that's not precisely "Software Complexity", but "Library Complexity" instead.
I was going to use Redis as an example, but the internal workings are probably too easy to understand.
comment 11y ago · link · parent
My experience at least with using REST for APIs seems to agree with yours. REST APIs, like traditional OO programming, seem to only help in a small number of situations. I've seen some really complicated things in the name of "RESTful"ness, like crazy Accept headers for different versions of the API. And like you pointed out, each developer seems to have their own idea of what REST means.
Approaching the API design from the other direction seems better. What is HTTP offering you that is better than just using a socket? It's got a request/response thing with message framing, some handy out-of-band stuff with the headers, there's HTTPS support, it works directly with browsers, and sometimes you can even get it to work through a proxy. HTTP requests are also supported pretty easily (more easily than socket stuff maybe) in most languages.
Then, using features from HTTP where they make sense can be nice (maybe some of the status codes or ETags are useful?), but throwing the whole nebulous REST framework in there without considering how well it matches the problem or how it adds to the complexity of the solution is not a good idea.
comment 11y ago · link · parent
Depending on your traffic patterns, considering the broadcast activity is potentially important, and then you might worry more about CPU than RAM.
I use redis myself, but gnatsd or redis cluster may help with scaling the pubsub part of the system.
comment 11y ago · link · parent
For comparison, I checked my not-very-optimized go server, and it looks like (based on VSZ value) to use 25KB per connection in go, with 43KB per connection used by nginx (to provide SSL termination).
comment 11y ago · link · parent
I think you can treat the name of the city as the name of the timezone. Seems like you'd have the same problem either way. If you used "Mountain Time" and then your city switches to "New Mountain Time" you still have the incorrect timezone.
Instead of cities it could use polygons on the surface of the earth, but that's starting to get complicated at that point.
comment 11y ago · link · parent
comment 11y ago · link · parent