This one seems up to date
255 karma · joined April 16, 2014
This one seems up to date
Including unit tests? A code base with unit test is likely to contain less bugs and more lines of code. And what about code golf?. This just does not seem right and I believe the original saying is related to languages with/without rich stdlibs and/or the NIH syndrome.
SELECT *
FROM sales
WHERE (sale_date, sale_id) < (?, ?)
ORDER BY sale_date DESC, sale_id DESC
FETCH FIRST 10 ROWS ONLY
This is a postgresql example. See use-the-index-luke[0] for a generic approach.[0] http://use-the-index-luke.com/sql/partial-results/fetch-next...
> The problem with offloading to a thread is that you can't structurally share data with another thread.
That's really a JS issue, not a general async programming issue, though.
Yes.
> But doesn't running on a single thread put an upper limit on the amount of work a server can handle?
Is not about how much work it can handle, it's about how much it can offload. Async servers can handle a much greater volume of I/O bounded tasks. So it can handle more connections. When the task is CPU bounded you can either create a thread (which does not really scale well) or offload it to some other servers that can scale horizontally (i.e doing micro services)
> And, if the solution is to spin up more servers with access to the same database, doesn't that mean that we are now having multiple threads accessing the database concurrently? Much like, say, Python Django?
Yes, to take advantage of all CPU cores you have to create more server instances. But why would they talk to the same database instance? It could be a replica or a shard. You can even have a pool of shards connections per server instance.
I've always seen the admin as a sort of phpmyadmin. For doing very basic crud.
For python urllib IOError and OSError should suffice. At least in py3.
It's more like this:
1) client: gimme 10, gimme 9...
2) server: here, have 10
3) server: here, have 9
...
Edit: There is not always a 1:1 relationship between packets and requests/responses, but it's easier to explain that way. You end up sending less packets when pipelining, plus you don't need to wait for a response to send the next request which also saves time (i.e: client has sent every request and server don't have to wait for the client to receive the response to send another request).Have you read aiohttp's code? there have been some discussions about improving its performance, there is basically no immediate bottleneck, the whole thing just performs poorly. I hate to say it but sometimes it's just better to start from scratch.
IMHO, python docs are ok. If you struggle with them as a beginner I don't see what would change as an advanced programmer.