I wanted to ask how does big app like (Uber/slack) or any other for that matter or platforms like github who use Ruby/Python/C#/Java handle CRUD operations at scale with ORM or Stored procedures.<p>Where do you draw the line when to use SP's or ORM?
Considering not everyone understands database in depth and can write performant queries or SP's.<p>I know its very simple view and probably tons patterns (like CQRS) and infrastructure/serverless/geo-replicated architecture might be use behind the scene.<p>Have you ever worked on such systems where both ORM and SP's are used and how do they keep logic not fragmented at multiple places at scale?<p>TLDR; How highly scalable apps manage DB interactions in code vs handwritten SQL?
When we were building a big app 10 years back, we used ORM for user facing modules and stored procedure for batch processing such as CSV import/export. We would clear the ORM cache for every SP run which are usually scheduled at mid-night to avoid stale data.<p>These days, it is graph DB (such as firebase) for user facing module. It syncs data into a warehouse (such as BigQuery) that we use for batch processing.