Urgent.News

What's breaking now, across hundreds of outlets.

Tech

SurrealDB for Beginners: One Database for Documents, Graphs, and Real-Time

SurrealDB is a database that tries to do it all: documents, graphs, key-value storage, and real-time updates in one system. Instead of running Postgres for tables, Redis for caching, and something else for real-time, you can do all of it in SurrealDB. How does it work? You store records in tables, but each record can hold nested data like a document. Records can also link to each other, which…

SurrealDB is a versatile database that combines documents, graphs, key-value storage, and real-time updates into a single system. Unlike traditional database systems where each task requires a different tool, such as Postgres for tables, Redis for caching, and a separate solution for real-time updates, SurrealDB handles all these functions within its own framework.

The core of SurrealDB's design is the storage of records in tables, with each record capable of holding nested data structures similar to a document. But this is not its only capability. Records can also reference each other, which enables complex graph queries. Furthermore, SurrealDB allows developers to subscribe to changes, ensuring that any frontend application connected to the database will receive immediate updates whenever data changes.

For beginners, SurrealDB offers an intuitive query language called SurrealQL, which is akin to SQL but with advanced features. The database can be started with a single command, and a built-in web user interface allows users to run queries and view data without needing any additional installations.

SurrealDB is particularly well-suited for applications where data elements are interconnected, such as social networking platforms, recommendation systems, and real-time dashboards. One of its standout features is the ability to perform complex queries, like finding all friends of friends who have liked a specific post, which is often more straightforward in SurrealDB using graph queries compared to complex SQL joins.

However, it is important to note that SurrealDB is still a relatively new database, meaning its ecosystem of tools, tutorials, and hosting solutions is not as extensive as those of more established databases like Postgres or MongoDB. While it may lack the breadth of tutorials and hosting options, SurrealDB is an excellent learning tool for students and developers working on side projects.

It is advisable to use it initially for educational purposes and to thoroughly review the documentation before considering it for production applications.

To get started with SurrealDB, you can run it in memory mode, create two linked records, and then retrieve that data in a single query. This simple exercise encapsulates the fundamental concept behind SurrealDB: the seamless integration of data and its relationships.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in Tech

You Opened a New Tab and Forgot Why. A Memory Lab Built Half-Life Levels to Study It.

You open a new tab to look something up. The tab loads. You stare at the search bar. What was it? You go back to your editor, see the half-written function, and it comes right back.

  • Walking through doorways causes forgetting, according to University of Notre Dame researchers.
  • Virtual Half-Life levels with 66 rooms studied doorway-induced memory loss.
  • Setting intentions before task switches may reduce context shift memory disruption.

Security Assessment: Blunder (Hack The Box) — Penetration Testing Report

Security Assessment Report: Blunder Technical Security Assessment & Penetration Testing Report conducted on the target environment Blunder hosted on Hack The Box , executed in accordance with PTES and…

  • Blunder environment tested on Hack The Box with PTES, NIST standards
  • Critical risk from unauthenticated remote exploit vector for full compromise
  • Pedro Araiz achieved host compromise, root access via exploit delivery

How I built FetchPins, a free Pinterest downloader (Laravel + yt-dlp)

Pinterest is a save-first platform. You can pin anything, but there is no download button — no way to keep a video, image or GIF as a file on your own device.

  • FetchPins is a free Pinterest downloader without requiring an account or app
  • Uses yt-dlp for video pins and oEmbed/Open Graph for images and GIFs
  • Limits downloads to 720p videos, 736px images, and caches media for one day

AirTag in (PRODUCT)RED?

Apple reportedly plans to release four (PRODUCT)RED products by December 1, and there might be a fifth. 9to5Mac 's Chance Miller this week reported that he heard from a source that Apple has also…

More from Tuesday 24 November →