Skip to content

Proposal: Allow monthly file sharding as alternative to daily #19

Description

@melvincarvalho

Summary

The current spec mandates daily files (YYYY/MM/DD/chat.ttl). This proposal suggests allowing monthly files (YYYY/MM.ttl) as an alternative for moderate-activity chat rooms.

Problem with Daily-Only

For rooms with low-to-moderate activity (~10-100 messages/day):

Metric Daily Monthly
Files per year 365 12
HTTP requests to load 1 month ~30 1
Avg file size 10-50KB 300KB-1MB
Directory listings needed Many Few

Daily sharding creates:

  • Many small files (overhead)
  • Many HTTP requests for historical browsing
  • Complex discovery (need to enumerate days)

Proposal

Allow implementations to choose sharding granularity:

<#chat> a meeting:LongChat ;
    :shardingPeriod :monthly .  # or :daily (default)

Monthly structure:

/chat/
  index.ttl
  2024/
    01.ttl
    02.ttl

Daily structure (current, remains default):

/chat/
  index.ttl
  2024/
    01/
      15/chat.ttl
      16/chat.ttl

Discovery

Readers would check index.ttl for sharding type, then:

  • Daily: enumerate YYYY/MM/DD/
  • Monthly: enumerate YYYY/MM.ttl

Or better: index file lists all shard URIs explicitly.

Use Cases

Room Type Recommended
High-volume (100+ msgs/day) Daily
Moderate (10-100 msgs/day) Monthly
Low-volume (<10 msgs/day) Monthly or even yearly

Backwards Compatibility

  • Daily remains the default
  • Existing daily chats continue working
  • Monthly is opt-in for new chats
  • Readers must support both (follow links from index)

References

Would love feedback on whether this flexibility would be acceptable while maintaining interoperability.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions