Sharding of ets table

you are correct, this link can help me to create custom sharding for ets table.

thank you.

Maybe not, maybe there are other simpler (or more adaptable) solutions for sharding ETS table.
It’s worth a try: Getting Started — shards v1.1.0

You received to much XY responses. Sounds like you just desperate to get the answer to your question.

One solution (maybe not ideal) is to make a logical separation.

Example:

Define a field “data_table” in the “user” table.
Let’s imagine that the table you want to shard is “user_data”.

You have 4 tables (shards) of “user_data”: user_data1, user_data2, user_data3, user_data4.
For each user, you can assign a shard to user.data_table field (user.data_table = "user_data1").

This approach will improve some cases, surely make others worse. It all depends on your case.
In a multi-tenant logic, it can do it.

This is not the ideal answer to your question but just to advance in the reflection for sharding

1 Like