Update:I found this isn't main reason of increase usage.
I'm already using notification key to send notification.And I knew is that can't subscribe notification key to a topic.But we need a user can login same account on multiple devices. So I decide save notification key on realtime database.
How my application work is when a user send a message to chatroom then cloud function triggered and read data once(group_chatroom_notification_keys/chatroom_id_1) to get all user_notification_key_n and send notification to each user. Problem is send every message need read chatroom all notification key again.This way increase so much realtime database GB downloaded.I paid 35% of earn to google every month now.
I also a bit confuse this doc say:
"For fast, secure delivery to single devices or small groups of devices, target messages to registration tokens, not topics."
what does it mean secure delivery? If I using chatroom_id as topic and subscribe all chatroom users token to topic for reduce the cost. Then chatroom notification data will steal by other device? because all chatroom should be private and I don't know how to reduce the cost correctly.
Someone have better way to do this? The cost for this is necessary?
chatroom_id. I think you are being charged for the reads and writes to the database, not for the notification. Maybe you are fetching all the chat instead of the latest messages using pagination. Just a thought.