Wann Dokumentdatenbanken verwenden

NoSQL-Konzepte

Miriam Antona

Software engineer

Geeignete Fälle

  • Kataloge
    • E-Commerce-Websites/-Apps speichern Produktinfos
    • Unterschiedliche Attribute je Produkt
    • Verwandte Infos einbetten

Bild eines Hemds

{
  "product_id": 879,
  "name": "Fashion shirt",
  "category": {
    "category_id": 15,
    "name": "Tops & t-shirts",
    "type": "Shirt"
  }
}
NoSQL-Konzepte

Geeignete Fälle

  • Event-Logging
    • Arten von Events:
      • Benutzer-Logins
      • Produktkauf
      • Fehler
      • ...
    • Sharding nach:
      • Zeit
      • Event-Typ
      • ...

Bild eines Event-Logs

{
  "type": "info",
  "message": "user_logged",
  "user_id": 551,
  ...
}
NoSQL-Konzepte

Geeignete Fälle

  • Benutzerprofile
{
  "user_id": 512,
  "name": "Carol",
  "last_name": "Harper",
  "email": "[email protected]",
  "address": {
    "street": "123 Sesame Street",
    "city": "New York City",
    "state": "New York"
  },
  ...
}

Bild eines Benutzerprofils.

  • Informationen können variieren
  • Flexible Dokumente
NoSQL-Konzepte

Geeignete Fälle

  • Content-Management-Systeme
    • Blogs, Videoplattformen usw.
    • Inhalte der Nutzer
      • Kommentare
      • Bilder
      • Videos
      • ...

Bild eines Blogs

{
  "id": 458,
  "url": "myblog/datazy.com",
  "title": "How to write a blog entry at Datazy",
  "tags": [
    "Datazy",
    "Blog"
  ],
  "last10comments": [
    { "name": "Eliza", "comment": "Great!" },
    { "name": "Eric", "comment": "Thank you!"}
  ]...
}
NoSQL-Konzepte

Geeignete Fälle

  • Echtzeit-Analysen
    • Seitenaufrufe, eindeutige Besucher ...
    • Einfach zu speichern

Bild einer Echtzeitanalyse

{
  "_id": "1000241",
  "hour": "Sat Jun 12 2021 16:40:00 GMT+0200 (EST)",
  "site": "datazy",
  "uniques": 5,
  "pageviews": 15,
  ...
}
NoSQL-Konzepte

Ungeeignete Fälle

  • Sehr stark strukturierte Daten
  • Daten sind immer konsistent
NoSQL-Konzepte

Lass uns üben!

NoSQL-Konzepte

Preparing Video For Download...