In the Principles of Reactive Programming course Roland Kuhn explains in the Scalability class that
Asynchronous message passing enables vertical scalability
Location transparency enables horizontal scalability
As I understand it location transparency only enables horizontal scalability for stateless actors, but for stateful actors we need Cluster sharding
Cluster sharding is typically used when you have many stateful actors that together consume more resources (e.g. memory) than fit on one machine
I imagine for example a DDD approach for an online retailer where I have a ShoppingCartAggregate. During a peak load I will need to create thousands of ShoppingCartAggregate actors and the application may become unresponsive.
In this situation, the way of achieve horizontal scalability is via Cluster Sharding and rebalancing the actors to another node?
UPDATE AFTER ROLAND ANSWER:
I understand that location transparency is a must for cluster sharding, however as far as i understand (not so far actually) location transparency is not enough for scale horizontally stateful actors.
With your permission I want to paste a slide (let me know if you want me to delete it):
I see this example more as a case of fault-tolerance than one of horizontal scalability because we replicate the actor A in another node B and it starts to handle messages when the node A goes down.
If the actor A living in the node A recives an unexecpected load the messages will start to enqueue and it will take more time to answer, I can't see nothing I can do to prevent this. However in a DDD aproach this is unlikely to happen due to the granularity of the actor: all the clients will not be sending messages to the same entity.
But if I have 10000 actors representing different entities living in the node A and all of them received an unexpected load we could use Cluster Sharding for rebalance the 10000 actors between the node A and B, achieving horizontal scalability.
I'm learning about distributed systems and akka, so I'm trying to join the dots and this is only a question, I'm not doing any kind of affirmation.
UPDATE:
Watching the video lecture again I can't understand how I missed what you say about replication of stateful actors:
Here, replication is not used for scalability so much, but it can also be used for fault tolerance.
Cluster sharding works by exploiting the location transparency afforded by the Akka’s implementation of the Actor Model. The point here is that horizontal scalability can only be achieved if the client (i.e. the code that talks to the ShoppingCartAggregate) does not need to know or care where each particular instance is located—the ShardRegion can route the request to the right destination in a transparent fashion. This becomes even more important when considering dynamic rebalancing at runtime, which means that actors get moved around the cluster without any of their clients being aware of the difference.
The short answer to this question is therefore that you are proposing a false dichotomy.