May I propose another schema for your table post :
CREATE TABLE mykeyspace.post (
id uuid,
title text static,
photo photo,
PRIMARY KEY (id, photo)
);
CREATE TYPE mykeyspace.photo (
id uuid,
details text
);
This schema means :
- There is one partition by id => a partition is equivalent to a post
- There is one title by partition/post
- There is multiple photo ids by partition/post
This schema should serve your goal very well until you reach about 100.000 photos by partition/post.
If you have never used static columns before, you can refer to Datastax documentation
The driver can do the paging for you. See Paging Feature in Datastax Java driver documentation.
The Cql query looks like this :
select photo.id, photo.details from post where id=*your_post_id*;
PS : I think you should not use uppercase in your schema.