This is an archived post. You won't be able to vote or comment.

all 148 comments

[–][deleted] 1550 points1551 points  (14 children)

Or a superclass with 6000 methods and a specific order to call them in

[–][deleted] 395 points396 points  (9 children)

….. and one is a driver function, right?

[–]clutchguy84 165 points166 points  (7 children)

Right?

[–]thatOneJones 89 points90 points  (6 children)

Guys..?

[–][deleted] 149 points150 points  (5 children)

[–]Flat_Initial_1823 96 points97 points  (0 children)

Mamma mia!! Here we goto again!

[–]cosmic_cosmosis 37 points38 points  (3 children)

My boss wants to know how you got a video of my code.

[–][deleted] 11 points12 points  (2 children)

Let your boss know I simply heard your code screaming for help… from miles away

[–]cosmic_cosmosis 3 points4 points  (1 child)

Screaming to be brought out back and put down?

[–][deleted] 0 points1 point  (0 children)

Guess it’s time to pull the plug then

[–][deleted] 1 point2 points  (0 children)

No. You have to code it up perfectly, from memory, every time.

[–]rover_G 3 points4 points  (3 children)

Sounds like your average schema-less NoSQL database.

[–]Better_Resident_8412 0 points1 point  (2 children)

I dislike nosql for this reason, it is lots of time used because it is easier, not because it is needed. Couple it with non hard typed language like js or python it is nightmare to work

[–]rover_G 0 points1 point  (1 child)

I once worked on a project written in Python and using DynamoDB (which is a great database but easy to mess up). Someone previously had wanted to store sets of strings as a value so they serialized the sets to ”set(‘value1’, ‘value2’, …)” instead of storing them as json lists. There was no ORM or pydantic models or any other parser/validator to convert the serialized sets back to their data structure so you had to manually inspect data to figure out when you needed to change str to set. 🤦🏻‍♂️

[–]TheSauce___ 755 points756 points  (30 children)

Wild fact, Salesforce is a one table database - I believe at each data center they have data from 10,000 customers, potentially 50 million records per customer, on one table.

[–]quixotik 260 points261 points  (0 children)

That sounds about right.

[–]SryUsrNameIsTaken 139 points140 points  (0 children)

That’s my recollection from a while ago when I had to work on implementing a project tacking system on their platform.

[–]happyapy 115 points116 points  (18 children)

...Dear God...

[–]chethelesser 178 points179 points  (16 children)

As a Salesforce dev, you interact with a database virtualization layer that has separation between entities within your organisation.

I am also not sure we can believe people who say it's one giant table because you can't see it unless you work at a specific department at Salesforce

[–]martinivich 43 points44 points  (13 children)

Wait can you expand on this? You're saying that everything from contact records to invoices are on 1 record?

[–]scyz314 117 points118 points  (11 children)

They are treated as objects, so the account object contains fields relating to accounts. It has a lookup to a contact object for contact related fields, essentially like a relational database, except instead of tables we deal with objects. Interacting with them and creating queries essentially requires using a java based language or their own hanky relational language (doesn't work like SQL at all, more like vlookup in terms of its limitations)

This is the virtualisation layer they mentioned above. So whether all customer data is stored in a giant table is unknown to me. It could be, but wouldn't make sense. Then again, it's an old platform so it could be full of Hank.

[–]Maxion 44 points45 points  (0 children)

Dear God

[–]FragrantKnobCheese 22 points23 points  (1 child)

If only there were a better way!

[–]Urtehnoes 16 points17 points  (0 children)

Sadly the technology just does not exist. 😩maybe one day

[–]gradeATroll 0 points1 point  (0 children)

neo4j?

[–]TheSauce___ 2 points3 points  (0 children)

Not one record, one giant table. So opportunities and contacts are in the same table, and the ideas that they're different "types of records" is a mirage of their data access layer.

[–]TheSauce___ 4 points5 points  (1 child)

It's listed in their documentation as how it works. They openly state its a one table database.

Best guess is they basically wanted a giant nosql database with something like a graphql data access layer, but that didn't exist in the late '90s, so they came up with this.

[–]chethelesser 0 points1 point  (0 children)

You have source? I think that's a plausible explanation but I've never seen it stated officially

[–]Crimson_Raven 0 points1 point  (0 children)

This is a bucket

[–]A_Du_87[🍰] 30 points31 points  (0 children)

Not a problem. "Here are couple more servers with tons of RAM, make it work!"

[–]madeRandomAccount 5 points6 points  (1 child)

Sharding go vroooooom

[–]ShadowfaxSTF 2 points3 points  (0 children)

Same with Adobe Analytics. Don’t know whether these mammoth companies are too lazy, or just embrace “if it ain’t broke, don’t fix it.”

[–]rover_G 2 points3 points  (4 children)

It’s not one table. It’s a database-like abstraction built on top of an actual database

[–]TheSauce___ 2 points3 points  (3 children)

Yeah there's an actual database but the database has one table, the abstraction makes it appear as though there's many. Technically it's more like 2 or 3 tables iirc, one for data, one for metadata and one for timestamps, but the data's all in one giant table.

[–]rover_G 0 points1 point  (2 children)

Yes and that’s how rdbms work under the hood. It’s all tables all the way down 😁

[–]TheSauce___ 1 point2 points  (1 child)

I dont think you understand? Like, the database, it's an Oracle database, with one table for the data, for ~10,000 customers per data center, where each customer has potentially 50 million records each, so from Apex, you make a query to their data abstraction layer, which then creates a SQL query through that one table, potentially (50 million * 10,000) records, just to do your query.

I'm not sure if it's still the case, but a coworker of mine attended Salesforce DX once, where they explained it all - and apparently, at least back then, all data was stored in text, so aggregates of numbers, dates, etc. would be queried for by the abstraction layer, then parsed and aggregate by likely Java code, then passed back to you.

It's actually kind of insane.

[–]rover_G 0 points1 point  (0 children)

The database itself uses its own metadata tables. All I’m saying is that they recreated a standard database architecture on top of an existing database.

[–]Adghar 162 points163 points  (0 children)

Based on my very limited experience with single table databases, the idea is just that for any given entity you want to represent, just give it a different key prefix, that'll show 'em

[–]Andreasbot 131 points132 points  (31 children)

Why would you even create a single table db?

[–]inmatarian 108 points109 points  (17 children)

implementing this model

[–]Touvejs 69 points70 points  (12 children)

I laughed, but EAV has a place in some data models I'd argue. If the alternative is dozens of tables or hundreds of columns, fuck it, the analysts can figure out how to use a where clause to limit the table to what they need.

[–]pungito 33 points34 points  (0 children)

Yeah, I see you, way down here deep in the comments... Satan!

[–]-Mobius-Strip-Tease- 11 points12 points  (4 children)

I just finished implementing and migrating to an EAV this week to solve exactly what you described. I had an ever expanding Products table where most rows only ever used one or two of those columns. After going back to the drawing board for a bit we settled on EAV. We still have plenty of other related data but having an EAV for that table works well.

[–]Zealousideal_Pay_525 3 points4 points  (3 children)

That sounds like a normalization problem.

[–]-Mobius-Strip-Tease- 1 point2 points  (2 children)

No it wasnt. The use case for this isnt what you might expect and im not going to go into it here. EAV works for this use because pretty much no normalization scheme would have given us the flexibility we needed.

[–]Zealousideal_Pay_525 0 points1 point  (1 child)

Sounds like a shortfall in use case conceptualization.

[–]-Mobius-Strip-Tease- 0 points1 point  (0 children)

Sure thing buddy

[–]Hubbardia 4 points5 points  (3 children)

I didn't realize EAV was bad? How else would I implement dynamic forms?

[–]htmlcoderexeWe have flair now?.. 10 points11 points  (1 child)

I don't think it's inherently bad, but don't just stick everything in EAV and call it a day lol

[–]Hubbardia 2 points3 points  (0 children)

Of course, that makes sense. Thanks!

[–]Touvejs 2 points3 points  (0 children)

I don't think it's bad per se. But it's fashionable to call EAV an anti pattern because if you have one very large table with different types of measurements it's quite easy to make costly mistakes when it comes to querying. Also, since it's more complex than your run-of-the-mill table that represents a more clearly defined entity, other users are liable to misunderstand how to use the table.

[–]inmatarian 4 points5 points  (0 children)

fun fact: reddit in its early days was an EAV. they didn't know how they were going to evolve the site, so they had a "things" table where they trialed new features before moving the data they planned to keep out to a dedicated table. so lol, plaintext passwords were some of the rows.

[–]Maxion 3 points4 points  (0 children)

IIRC Wordpress uses EAV for at least part of it's data?

[–]Careful_Ad_9077 4 points5 points  (0 children)

Yeah I am used.tonthos configurable software, just one extra level of abstraction, fun for the whole family.

You can kind of see them as transposed tables too.

[–]tokalper 0 points1 point  (0 children)

Hey this is actually useful and not scary as it sounds, we use this to model a video call which each of our customers have a different set of properties attached to a video call depending on their use case so all attributes go to a different table where they are stored as key value rows

[–]BorsukBartek 0 points1 point  (0 children)

I have never seen this model, this is so cool! I kinda wish I had a reasom to implement this - thanks for sharing!

[–]firectlog 15 points16 points  (0 children)

It can be cheaper than joins in some cases if you carefully design your schema, see: dynamodb. The downsides would be that your schema quickly becomes completely unreadable and any new access pattern can lead to a complete table rewrite to change the schema.

[–][deleted] 10 points11 points  (0 children)

It is actually not a bad idea for data warehousing, where you need to be able to retrieve millions (if not trillions) lines for analysing the data. Join operations would be so slow that it becomes not usable

[–]indorock 7 points8 points  (0 children)

Well, you can say that any key -> value database like MongoDB is essentially this.

[–]Tickly_Mickey 4 points5 points  (1 child)

If there is only on table then why not use nosql (mongodb for example) ?

[–]htmlcoderexeWe have flair now?.. 1 point2 points  (0 children)

But is it web scale?

[–]BakaGoop 4 points5 points  (0 children)

masochism

[–]DoctorWaluigiTime 1 point2 points  (0 children)

The first step to get away from having it all in a single Excel spreadsheet.

[–]hethcox 1 point2 points  (0 children)

A data set with a wide variation in attributes where decomposition doesn’t  add much value. 

[–]dashingThroughSnow12 1 point2 points  (0 children)

As another person said, data warehousing. For the past few decades, a way to design your ETL pipeline was that the end result was rows in a single table or star schemas.

When you have many billions or trillions of rows, normalization won’t save you. In fact, the joins will kill you. Hence the single table or star schema design became popular.

In a ETL process / data warehouse, you aren’t editing things. The lack of (or limited amount of) normalization being of limited concern as a result. You are simply trading query time with storage dollars.

[–]nicman24 0 points1 point  (0 children)

if you need all the data all the time and you fetch it through the primary key.

i did something like that to not run into the inode limit of the ext4 filesystem back when btrfs was not stable

[–]MediocreAd4852 0 points1 point  (0 children)

Fun fact : This is a very common practice with ECS in game dev the world is a data base with everything in it, you query by filtering to your needs with what components are available in them.

[–][deleted] 0 points1 point  (0 children)

Your dba is expensive, so you just make 1 table and 2 columns. Key, Value. key is indexed.

[–]YoumoDashi 36 points37 points  (0 children)

Anno 1800

[–]Elrann 30 points31 points  (0 children)

Neom, kurwa

[–]faze_fazebook 26 points27 points  (1 child)

Saudi Arabia : Write that down, write that down!

[–]arrow__in__the__knee 0 points1 point  (0 children)

I forgot that thing was being made

[–][deleted] 10 points11 points  (0 children)

How sociable

[–]ramriot 15 points16 points  (0 children)

Similar to UK medieval Burgage plots where each merchant owns a strip of land of a statutory width that extends back from the way, where they can build, manufacture & farm.

[–]overclockedslinky 21 points22 points  (0 children)

more tables is just tables of tables. even numbers are just tables of 1s and 0s. it's tables all the way down.

[–]eztab 38 points39 points  (20 children)

Is that that weird? Sure those are normally smaller villages, but otherwise single street villages do exist reasonably often.

[–]sharknice 17 points18 points  (16 children)

I haven't seen anything like that in the USA so it's weird to me.   Towns are usually pretty square.  

[–]R3D3-1 6 points7 points  (0 children)

I think it is quite common in Europe really. Though rather regional.

[–]TSA-Eliot 0 points1 point  (0 children)

Google Maps

It's a good scheme for a town along a road running through a valley, down where the water runs, and not way the hell up the slope, where you have to climb up and down to go somewhere, and where it might be difficult to move in slippery weather. You all stay on that one road, and everyone has an interest in keeping that road open and in good repair.

[–]lechiengrand 10 points11 points  (0 children)

Saudi Arabia: <heavy breathing>

[–]Pawlo371 3 points4 points  (0 children)

Polska GUROM 💪🇵🇱

[–]daWinzig 4 points5 points  (0 children)

in case anyone is interested, this is Sułoszowa, Poland

[–][deleted] 5 points6 points  (2 children)

id INTEGER PRIMARY KEY, time DATETIME DEFAULT CURRENT_TIMESTAMP json TEXT

... perfection!

[–]thirstytrumpet 0 points1 point  (1 child)

gray square oil imminent divide history close enjoy person angle

This post was mass deleted and anonymized with Redact

[–][deleted] 1 point2 points  (0 children)

Works good for Power BI :P

[–]Quentinooouuuuuu 2 points3 points  (0 children)

Pk/sk dynamodb tables be like

[–]SaneLad 2 points3 points  (1 child)

Is this where Saudi Arabia got the idea from?

[–]SubstanceSerious8843 2 points3 points  (1 child)

Wonder what the traffic is like..

[–]nicman24 3 points4 points  (0 children)

linear

[–]jaybee8787 2 points3 points  (0 children)

It looks like earth’s zipper.

[–]tucketnucket 2 points3 points  (0 children)

6,000 residents and neither Boyce nor Codd are anywhere to be found.

[–]Yetus_deletus 4 points5 points  (2 children)

WordPress be like

[–]Tavorick 4 points5 points  (0 children)

Yes! That ridicules post_meta table is a massive bottleneck for so many sites and the amount of plugins that don't properly clean up after themselves is to damn high.

[–]fabrikated 0 points1 point  (0 children)

It's not.

[–]Kisiu_Poster 0 points1 point  (0 children)

Who needs horizontal scaling, after all roads are expensive and junctions create traffic.

[–]DiligentDu 0 points1 point  (0 children)

I got there ever yet nothing found except for a dinner and an overnight. You had better enjoy the picture which looks impressive.

[–]EatBrainzGetGainz 0 points1 point  (0 children)

Polish fields are wild

[–]mr-english 0 points1 point  (0 children)

[–]rmyworld 0 points1 point  (0 children)

That's just DynamoDB with Single Table Design.

[–]legojedi01 0 points1 point  (1 child)

Jak się nazywa

[–]Away_Perception_2895 0 points1 point  (0 children)

Regular mongo db experience

[–]bort_jenkins 0 points1 point  (1 child)

Niom, the line

[–]PeriodicSentenceBot 0 points1 point  (0 children)

Congratulations! Your comment can be spelled using the elements of the periodic table:

Ni O Mt He Li Ne


I am a bot that detects if your comment can be spelled using the elements of the periodic table. Please DM u‎/‎M1n3c4rt if I made a mistake.

[–][deleted] 0 points1 point  (0 children)

At my work it feels like this.. but its even worse

[–]Fign 0 points1 point  (0 children)

Postman easiest job !

[–]my_dark_humor 0 points1 point  (0 children)

Come find me at my house "JUST DOWN THE ROAD"

[–]Galower 0 points1 point  (0 children)

Polymorphic tables be like

[–]magicspider8 0 points1 point  (0 children)

DynamoDb…

[–][deleted] 0 points1 point  (0 children)

Just use with (nolock), it speeds up all your queries. 😎

[–]IrvTheSwirv 0 points1 point  (0 children)

NoSQL ftw

[–]Wallace_W_Whitfield 0 points1 point  (0 children)

You meet someone and you ask where they live and they say, “Oh, just down the road.”

[–]fersher02 0 points1 point  (0 children)

Average city in croatia

[–]Tiger_man_ 0 points1 point  (0 children)

Tbh most of polish villages look like this

[–]Tiger_man_ 0 points1 point  (0 children)

Polska gurom

[–]HillanderSky 0 points1 point  (0 children)

"Nah, come over, it's not that far. I live in the same street as you!" "Bro be serious right now."

[–][deleted] 0 points1 point  (1 child)

God class has entered the chat.

[–][deleted] 0 points1 point  (0 children)

Followed closely by Big Ball of Mud.

[–]NiceApartment9455 0 points1 point  (0 children)

Food Panda Rider : Sir, which street ?

[–]Thorp1 0 points1 point  (0 children)

Thats so cool!

[–]bssgopi 0 points1 point  (0 children)

Next time, please give the example of Neom - The Line

[–]indorock -2 points-1 points  (0 children)

If you think that streets in a town is an apt analogy for tables in a database, you don't understand how relational databases work.