The way I understand Fluent Domain Specific Languages I am able to use method chaining to have a conversation with the code. For example, if the business requirement is to call the database in order to "Get all customers with InActive accounts" I could use:
Customers().WithInActiveAccount()
Customers has millions of rows. Pulling all customers into memory is not efficient when I only need a subset of customers (and maybe not even possible given memory constraints). I suspect ORM's solve this problem by treating code as data, lazy-loading and building a complete query based off the entire expression. So the final query may be
SELECT * CUSTOMERS WHERE InActive = true
IME, when dealing with highly normalized tables ORM's produce inefficient DB queries. Rolling yet another custom ORM to solve such an issue feels like a death march waiting to happen. And stored procedures written by a DB professional are going to be efficient.
In this simple case I can simply change customers to an object:
Customers.WithInactiveAccount()
What if I need to do something more complex?
Customers.WithInactiveAccount().BornAfter(October 1, 1990)
How do I efficiently build up queries as I build more advanced expressions that potentially draw in other entities? This is a question I'm sure every ORM asks themselves right in the early stages of development. Do I have to limit myself to "dumb queries" to maintain performance? If this a technique that exists?
These are the types of questions I find myself getting from developers like me that have experienced across the board performance problems with ORM's in the big data world.
So when dealing with these types of normalized Databases is a fluent DSL a practical option? (I'm assuming a fluent DSL for DB access requires an underlying ORM to function)