Recently, the Internet of Things (IoT) has played key roles in every aspect of daily routine tasks. IoT applications suffer from higher latency and limited network bandwidth in the internet core. However, due to bandwidth and resource constraints, the resultant massive data traffic triggers storage overhead, high latency, and network bottleneck problems. Therefore, cloud computing and fog computing are introduced as popular IoT assistance. In fact, using a fog layer with such a highly dynamic environment raises a placement problem that needs to identify the optimal fog node that can be assigned to place the sensed data there. However, using a single copy of the datum in a single node can increase the concurrent access and maximize the network latency. Therefore, replication is considered a known technique to improve availability by publishing many replicas to many sites. However, using replication causes a degree of temporal data inconsistency and requires the application to be tolerant. This work proposes a novel intelligent solution for dynamic consistent replication and optimal placement of IoT using fog computing. The results show the ability of the current work to reduce the system latency and cost of replica access and increase the data availability.