Sharded (Class Keyword)
Usage
To define a class as sharded, use the following syntax:
Class MyApp.MyClass Extends %Persistent [ Sharded = 1 ]
{ //class members }
Otherwise, omit this keyword.
Details
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.
Default
If you omit this keyword, the class is not sharded.
See Also
-
“Horizontally Scaling for Data Volume with Sharding” in the Scalability Guide
-
“Class Definitions” in this book
-
“Defining and Compiling Classes” in Defining and Using Classes
-
“Introduction to Compiler Keywords” in Defining and Using Classes