They can (and that's probably the right choice for a lot of use cases, especially for small data structures and infrequently updated ones), but serializing and storing them in a database requires you to (in your application code) implement synchronization logic and pay the performance cost for said logic; for instance, if you want to `append` to a shared list, you need to deserialize the list, append to the end of it in your application code, and write it back to the DB. You'd need use some form of locking to prevent appends from overwriting each other, incurring a pretty hefty perf penalty for hot lists. Also, reading an entire list/tree/set/whatever back just to add/delete one element is very wasteful (bandwidth/[de]serialization cost-wise)
> for instance, if you want to `append` to a shared list, you need to deserialize the list, append to the end of it in your application code, and write it back to the DB.
this seems like a classic case of impedance mismatch, trying to implement a Redis-ism using an RDBMS.
for a shared list in a relational database, you could implement it like you've said, using an array type or a jsonb column or whatever, and simulate how it works in Redis.
but to implement a "shared list" in a way that meshes well with the relational model...you could just have a table, and insert a row into the table. there's no need for a read-modify-write cycle like you've described.
or, if you really need it to be a column in an existing table for whatever reason, it's still possible to push the modification to the database without the heavy overhead. for example [0]:
> The concatenation operator allows a single element to be pushed onto the beginning or end of a one-dimensional array. It also accepts two N-dimensional arrays, or an N-dimensional and an N+1-dimensional array.
Sure, but that’s not what the person responding to my original comment was suggesting :). They suggested that you serialize entire data structures (bloom filters, lists, sets, etc…) into a relational DB to get redis-like functionality out of it; I chose a list as an example to illustrate why that’s not a great option in many cases.
You’re right that managing lists in RDMSes is easy-ish, if you don’t have too many of them, and they’re not too large. But, like I mentioned in my original comment, redis really shines as a complex data structure server. I wouldn’t want to implement my own cuckoo filter in Postgres!
Doesn't a Postgres table fulfill this? You don't shove the whole list into a single column, you make a separate row per entry. This also works as a map or set.
It's a shame that all those Warm Springs signs went up a month or so ago and will have to be replaced shortly. I think when the new train cars come the lines will be referred to by color rather than destination, which will fix that problem.
The maximum one-way fare on BART is ~$15 and that's if you're going between OAK and SFO (which I imagine is very uncommon). Non-airport rides max out at under $8
If this is interesting to you, you should definitely check out the Bay Model (https://en.wikipedia.org/wiki/U.S._Army_Corps_of_Engineers_B...). Its a scale model of the SF Bay and the Delta in Sausalito that was built by the Army Corps of Engineers. Its admission free!
I studied a huge amount of Hydrology at University but haven't touched it in the ~4 years since. This has made me want to go back to doing things that aren't just sat in front of a computer...
Yes - Mythbusters used it for the Alcatraz escape episode to see where the likely landing point of the improvised raft was, as it's an accurate model of the tides and flows of the area :)
This seems unnecessarily conspiratorial considering we know for a fact that the US's infrastructure is literally crumbling beneath our cars and trucks.
Not to say that there aren't issues, but "crumbling US infrastructure" has been an on-again off-again news story for literally decades during which time we've had periods like the stimulus package for "shovel-ready" projects. I suspect infrastructure spending, especially in a country as large as the US, is essentially an unlimited sinkhole.
But then fix the sinkhole. Regionalize it, manage it better, change the incentives. I don't know what the answers are, but there's a whole host of countries that have great quality roads, bridges, and public transport.
And no, the 'size' of the US isn't a very good excuse. If a backwater road in Minnesota is run down, ok, but we're talking about major infrastructure in urban areas.
reply