Skip to content
This repository has been archived by the owner on Mar 26, 2022. It is now read-only.

Proposals

Javier Ardura edited this page Mar 6, 2019 · 10 revisions

02/26/2019

Local database use proposal ( REJECTED )

Introduction

The idea is propose the use of a local database to keep and send messages explaining their advantages and disadvantages.

Idea

Using any kind of database to:

  • POD reading keeping messages into the database.
  • Also keeping sent messages to load it easiest.
  • Create a smart database controller, who is able to reading and writing on the pod.

Advantages

SOLID isolation, the most difficult part, maybe, of the chat.

  1. Dealing with database that is easy, familiar and provide a lot of info.
  2. Making a common chat where the database and handlers will be used as adapters.
  3. Solving 25MB POD's storage.
  4. Avoiding server use, that should be established, study its behavior and if the app become too big solving potential storage conflicts.
  5. Easiest to create first tests, just reading and writing a database.
  6. Model also used by Whatsapp to storage chats.
  7. Lot of tutorials available on the internet, becoming the decentralization the most difficult part.

Disadvantages / doubts

  1. It isn't a solution, just a delegation.
  2. Delegation of the storage releasing to the handlers.
  3. Running slowdown.
  4. Difficulties to include the database with the programming language.

REJECTION REASONS

Some important reasons to discard it:

  • Writing twice will be a running problem.
  • Inconsistencies using the same account in different computers caused by the database.
  • Troubles caused by "downloading" any user their own database.

03/05/2019

Save chats using JSON (Accepted)

Example

Save chat with user with this format.

In martinlacorrona.solid.community/private/javierardura.solid.community/chat.json:

 {
  "webid_sender": "martinlacorrona.solid.community",
  "webid_reciever": "javierardura.solid.community",
  "lastupdate": "2019-03-04T18:26:50.511Z",
  "messages": [
    {
      "date": "2019-03-04T18:25:43.511Z",
      "message": "Hola javi"
    },
    {
      "date": "2019-03-04T18:25:45.511Z",
      "message": "Que tal?"
    },
    {
      "date": "2019-03-04T18:27:30.511Z",
      "message": "Yo estoy bien, gracias por preguntar."
    }
  ]
}

In javierardura.solid.community/private/martinlacorrona.solid.community/chat.json:

{
  "webid_sender": "javierardura.solid.community",
  "webid_reciever": "martinlacorrona.solid.community",
  "lastupdate": "2019-03-04T18:26:50.511Z",
  "messages": [
    {
      "date": "2019-03-04T18:26:44.511Z",
      "message": "Bien"
    },
    {
      "date": "2019-03-04T18:26:50.511Z",
      "message": "Y tu?"
    }
  ]
}

When javierardura or martinlacorrona open the chat, the content should be:

[2019-03-04 18:25:43] Martin: Hola javi
[2019-03-04 18:25:45] Martin: Que tal?
[2019-03-04 18:26:44] Javier: Bien
[2019-03-04 18:26:50] Javier: Y tu?
[2019-03-04 18:27:30] Martin: Yo estoy bien, gracias por preguntar.

Clone this wiki locally