Skip to main content

Sharded (Class Keyword)

Specifies whether this class is sharded. Applies only to persistent classes in an environment containing a sharded cluster.


To define a class as sharded, use the following syntax:

Class MyApp.MyClass Extends %Persistent [ Sharded = 1 ]  
{ //class members }

Otherwise, omit this keyword.


Sharding is a mechanism for horizontally scaling data storage. If a class is sharded, instances of the class are distributed across any defined data nodes in the sharded cluster.

If you have a sharded environment and you define a class as not being sharded, the instances of that class are stored on the first data node only, though the data is visible to all of the nodes.

Effect on Subclasses

This keyword is inherited.


If you omit this keyword, the class is not sharded.

See Also

FeedbackOpens in a new tab