Beta Draft: 2017-03-17
Modern database applications often have to deal with a high number of reads and/or writes per second. This is why it is important to be able to scale the database to deal with increasing load. Even projects that are not initially designed with scaleout in mind may have to grow quickly if they become successful. Therefore it is very important that the database can be scaled at any point in time without having to rewrite the application code.
Using the XSession concept enables you to write code that can be scaled without changing any object. This could be used for transparent High availability (HA), vertical scaleout (database replication) and horizontal scaleout (sharding) for database applications. Although the current version of MySQL X supports XSessions that connect to a single node, future versions could extend this to cover multiple nodes. An application using XSession is prepared to be scaled: change some connect parameters and be done with code changes. An application using NodeSession establishes connections to individual nodes. To scale an application using NodeSession you would have to replace the use of NodeSession with XSession whenever possible. This is likely going to be more coding work than updating some connect parameters.Therefore it is strongly recommended to use XSessions wherever possible.