【问题标题】:Firebase Database Design : Calendar appFirebase 数据库设计:日历应用
【发布时间】:2017-06-18 06:48:39
【问题描述】:

我是 firebase 数据库的新手(一般来说是 NoSQL)。我正在设计一个类似于谷歌日历的应用程序。用户可以创建活动并邀请其他用户。其他用户可以通过去、不去、也许去来响应这个事件。

这是我设计的(根据我的 MySQL 经验):

public class User {
   String email;
   String name;
}


public class Event {
    int id;
    String name;
    String topic;
    //other fields
}

public class EventSubscription {
    int id;
    String userEmail;
    String eventId;
    String status
} 

用户可以更新活动(添加或修改受邀用户、更改任何数据)或删除活动(这将删除受邀用户的所有邀请)。

这种数据库设计是否足够好? 任何帮助表示赞赏。

【问题讨论】:

  • @TimBiegeleisen 感谢您的评论。我们可以有其他更好的模式吗?
  • 我说错了,没有意识到 Firebase 不是 SQL。更了解 Firebase 的人应该发表评论。在 SQL 中,您的架构对我来说看起来不错。

标签: android firebase firebase-realtime-database


【解决方案1】:

也可以是这样的

public class User {
       String email;
       String name;
       List<HashMap<String ,String>> invitation; // the key is eventId, the value is the status
    }


    public class Event {
        int id;
        String name;
        String topic;
        //other fields
    }

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-03-06
    相关资源
    最近更新 更多