If your RF > 1, insert operation goes through a distributed transaction cycle where by record is stored on majority of replicas (if RF=3, then 2; if RF=4, then 3, it RF=7, then 5). However in case of SELECT record is read from only one tablet (assuming you are retrieving 1 record).
But you compromise on the resiliency. With RF=3, you can sustain 1 node failure, i.e. YB can continue serve query without interruption. But with RF=1, any node failure will mean interruption.
What is your current cluster configuration? i.e. Single-AZ, Multi-AZ, Multi-Region
Depending on where the nodes of your cluster are located it may cause increased latencies for writes due to networking between nodes (as Yogi mentioned each write has to be acknowledged by 2/3 peers with RF=3). Another aspect to consider if you are in a multi-region setup is where your users are. For example, if you are querying from US-East but the tablet-leader is in US-West you will see increased latencies.
While on tservers, the master is chosen on a per-tablet basis. So it will depend on which tablet-leader the row that you’re trying to select/insert belongs in.
Yes, but you still need the minimum number of tservrs/masters.
The YCQL driver will contact directly to the server which has the tablet-leader for that row (assuming single row insert/select or a single partition), and the server will also replicate to another tserver before returning “success” to the driver.
As mentioned above,
application is running in central region.
and there are 4 nodes(of database cluster) in central region
Does the performance impact depend on the node(out of 4 nodes in central region) that application points to?
if yes, what would be the performance impact for INSERT query?
if no, does performance remain same, if application point to any of the 4 nodes in central region?
Yes, if the tablet-leader for the row you’re select/inserting is residing in the same node.
If the tablet-leader is not in the node you’re connecting to, it will involve 1 extra network hop. (the server you’re connecting will redirect the request to the tablet-leader, and the tablet-leader will replicate it to another server that has the tablet-peer, and return “ok” to the node you’re connecting, and that node returns “ok” to the client).
@dorian_yugabyte
If there are two tables involved using SELECT query, then how tablet leaders are picked? Because we want to split our single table to two tables that has referential integrity.
Think you send the query to node_x. node_x, assuming a complex query involving 2+ tablets, will identify the location of each tablet_leader on the cluster and query the data on them, like a coordinator.
So it will depend on which tablet_leader each row resides, and where each tablet_leader reside in the cluster.