I am currently working on the development of a social network with Cassandra. My problem is that I hesitate between two solutions to optimize the consumption of my server.In the first case, when a user publishes a post, it contains all the information like the nickname or the profile picture. But when the user change his nickname for example, I have to change the value for all the posts. In case two, the information of the user and the posts are stored separately, but each time a user recovers a post he makes two commades instead of one. In the long run, which of these solutions is the best to optimize the speed of my server? Thank you for your answers,
Jesver
Since you mentioned that it's a social media application, so the assumption is that there can be plenty of posts by a single user. Also since you have mentioned about using Cassandra, the first scenario will not scale well for a few reasons.
Extensive updates can somehow be costly since it involves a read operation prior to write. It can be considered as an Antipattern.
The information about user will be redundant in each post. In the longer run, it will be a pain ensuring consistent user information in all the post.
The second alternative might be better in which 2 tables are created for users & posts, along with maintaining the relationship at the application level.