News for hackers. Stuff that matters.
Re:Pinterest's simple tech stack to scale to 11M monthly users by phartenfeller on Saturday December 23, 2023 @05:05AM (#38743030)
"The team removed table joins and complex queries from the database layer."

As a database person, I dislike reading this. I understand their need and priority to keep things running. But I would have loved it if they emphasized that doing something like this has so many disadvantages.

Normalization, referential integrity and a powerful query language bring so many benefits. I see young people oftentimes seeing relational vs. NoSQL as two totally valid opinions, like Coke vs. Pepsi. And not as one thing runs the world for decades and is perfect for >90% of use cases, and the other one is for niche cases and fast hyper-scalers.

Re:Pinterest's simple tech stack to scale to 11M monthly users by t8sr on Saturday December 23, 2023 @05:20AM (#38743083)
I don’t like it either, but apparently semi-structured data is the future. It’s proving easier to build systems that tolerate bad data and broken references than it is to get our data normalized and cleaned.

I’m the guy on most teams pontificating about SQL and data-oriented code, but even I’ll concede that large scale live systems probably shouldn’t serve from an SQL database.

Re:Pinterest's simple tech stack to scale to 11M monthly users by koliber on Saturday December 23, 2023 @10:28AM (#38744876)
Do they have only one huge table in the db that contains all of their entities? From the key structure that seems reasonable: shard id, type, object id.

If that is the case, is a relational db still the right place to keep such data? It seems that if the goal is to store this kind of data in one or a few huge sharded tables, a different tool could be optimizing to do the job better.

It seems that I’m missing something…

Re:Pinterest's simple tech stack to scale to 11M monthly users by rwultsch on Saturday December 23, 2023 @10:48AM (#38745066)
A pin was a 1.2 KB json blob. There were other tables but pins was the big one. Why MySQL? It did not destroy data like the alternatives.

how storage became efficient https://medium.com/pinterest-engineering/evolving-mysql-comp... https://medium.com/pinterest-engineering/evolving-mysql-comp...

Re:Pinterest's simple tech stack to scale to 11M monthly users by rwultsch on Saturday December 23, 2023 @05:42AM (#38743190)
Before I joined in late 2013, they had not known how to run schema change without downtime. Once we fixed the kernel the db’s were nearly completely untaxed in terms of performance. They did however need large instances due to disk usage.
Re:Pinterest's simple tech stack to scale to 11M monthly users by tmsh on Saturday December 23, 2023 @06:06AM (#38743301)
In 2024 all major cloud providers have NoSQL (AWS DynamoDB and its equivalents) that will easily scale to beyond this use case, managed purely by good single table design. That is the best practice for this and most basic use cases — not RDBMS in 2024.

Why? key/value data stores have consistent hashing which scales to planet scale built in. No need for sharding or caching or other bs that brings down slack and GitHub every other month.

Re:Pinterest's simple tech stack to scale to 11M monthly users by Denvercoder9 on Saturday December 23, 2023 @08:04AM (#38743963)
Most applications don't need planet scale, though.
Re:Pinterest's simple tech stack to scale to 11M monthly users by rsanek on Saturday December 23, 2023 @07:51AM (#38743882)
do you have a reference to how this might be accomplished? how do you avoid high read / write latencies if you put everything into a single table / key-value pair per user?
Re:Pinterest's simple tech stack to scale to 11M monthly users by Zanfa on Saturday December 23, 2023 @08:52AM (#38744231)
I think they're referring to single-table data design as described in https://www.youtube.com/watch?v=HaEPXoXVf2k It's quite clever and scales well, but completely unnecessary for the vast majority of CRUD apps.
Re:Pinterest's simple tech stack to scale to 11M monthly users by evntdrvn on Saturday December 23, 2023 @09:22AM (#38744392)
IMO it’s also difficult when you’re in the initial phases of a new company/product, because the system is evolving fast and that doesn’t play nice with single-table-design needing upfront design to work well.

I have had much better luck sticking to a plain old relational DB stack for those phases, because it’s fast to iterate, and then consider moving to single-table NOSQL when the system/DDD has “gelled” and traffic is starting to hockey-stick

Re:Pinterest's simple tech stack to scale to 11M monthly users by adrianN on Saturday December 23, 2023 @09:54AM (#38744629)
I know cases where caches on top of a kv store improved performance a lot. I don’t think it’s as simple as you claim.
Re:Pinterest's simple tech stack to scale to 11M monthly users by jimlikeslimes on Saturday December 23, 2023 @11:09AM (#38745247)
Like another comment pointed out they seem to store pins as a JSON blob in a single column anyway. They probably should've used Drupal.

Really, this is pinterest. They store 'boards' and 'pins', you may as well have a bit of fun with it. What use cases do they have for the features you list? They probably only used a database for write transactions?

I deeply value database technology and use it daily, but I don't think something simple like this needs to worry too hard about it.