PostgreSQL calling Svelte in real-time via Rust + websockets

Поделиться
HTML-код
  • Опубликовано: 21 окт 2024
  • This video is about getting updates in real time from the database, all the way into the clients browser. I will present (and we look at the code of) a solution where we are listening for changes in PostgreSQL in Rust. These changes are then propagated to svelte based frontend clients via web sockets.
    I thought this was a fun experiment to conduct. If you have any questions about this, feel free to use the comments. I watch the comments like a hawk 🐦. All of the tech used in this video is awesome, much love for PostgreSQL💖, Rust💖 and Svelte💖.
    If you are interested in more top quality web dev content like this one (and help me out), consider subscribing to the channel. 😅🙏
    And don't forget to watch the whole video and hit the like button if you like it🤓👍
    Thanks.
    #websockets #real-time #postgresql #rust #svelte

Комментарии • 27

  • @HugoDuprez449
    @HugoDuprez449 2 года назад +23

    Great! Make more Svelte + Rust content :)

    • @lindblomdev
      @lindblomdev  2 года назад +3

      Glad you liked it 🙂 I don't know when, but I will 🤞

    • @n3cro2012
      @n3cro2012 2 года назад

      +1

  • @irlshrek
    @irlshrek 2 года назад +6

    So cool!! I'm absolutely in love with svelte and sveltekit so I'm glad you covered this

    • @lindblomdev
      @lindblomdev  2 года назад +2

      I haven't looked much into sveltkit since I feel these complete frameworks has ended up being more of blockers than accelerators over the lifetime of projects. But maybe sveltkit is different. Will give it a chance, thanks 🙂👍

    • @irlshrek
      @irlshrek 2 года назад +1

      @@lindblomdev I wouldn't be surprised if that applied to sveltekit too. I imagine integrating various tools into frameworks ends up being an exercise in patience more than anything else. But it might still be worth poking around! I'm having a lot of fun with it

  • @mitotv6376
    @mitotv6376 2 года назад +2

    Nice, I have to learn Rust now.

  • @RichReflectionz
    @RichReflectionz 2 года назад +1

    New to rust, keep up posting more Rust content if your able to as your got a subscriber :)

    • @lindblomdev
      @lindblomdev  2 года назад

      Awesome, great choice of programming language 😊👍 thanks for subscribing, it's appreciated 🙏 rust is definitely on the future menu of the channel. 👌

  • @reggiebdog
    @reggiebdog Год назад +1

    do you have a githhub repo for this demo? I am learning svelte w/ Postgres, but I was blown away with websockets and Rust. Thanks@

    • @lindblomdev
      @lindblomdev  Год назад +1

      No, it was just some throw away code I experimented with and recorded a video about. Do you have any questions about it?

    • @reggiebdog
      @reggiebdog Год назад +1

      @@lindblomdev I think learning how to use websockets is my next step

  • @snk-js
    @snk-js Год назад

    you could increase font size of the vscode when doing that kinda of thing lol; btw very unique implementation

    • @lindblomdev
      @lindblomdev  3 месяца назад

      I have increased now. Yeah I thought it was unconventional 🤪

  • @mannycalavera121
    @mannycalavera121 2 года назад

    Thanks for making this video

  • @cQ2
    @cQ2 Год назад

    Yes, big thing are the resources and how many clients will be, with just 1k clients doing counts on dB could be some tricky and if the dB has millions record we need to look on replicas an all this stuff

  • @dev-rachid
    @dev-rachid Год назад

    What handler means ?
    Thanks 👍

    • @lindblomdev
      @lindblomdev  Год назад +1

      I know the context, assuming you are talking about a message handler. It's a function that executes when a message is received.

  • @mbczxaydbzrkmszj
    @mbczxaydbzrkmszj Год назад

    This video is useless to newbies that are trying to learn if you don't provide a github repository with sample code...

    • @lindblomdev
      @lindblomdev  3 месяца назад

      Sorry for that. It was more meant to show what was possible.

  • @TANRININresulu
    @TANRININresulu Год назад

    Bury server rust code in client side wasm rust assembly binary like this : ruclips.net/video/vjGOpDb44UM/видео.html IFF SUPREME ELEGANT WILLS

    • @lindblomdev
      @lindblomdev  Год назад

      I dont know what you want to do, but talking directly to the postgres from the client isnt something i stand by. I like to have a server inbetween there for different reasons. Some database providers want to make their database more of an application platform, im not on that train :)

    • @TANRININresulu
      @TANRININresulu Год назад +1

      Server costs eliminates that way and hence wasm is compiled binary it most probably safe and also it eliminates load balancer etc… & I am in no relation with any database providers. Because I serve “ONLY” to SACRED SUPREME KING ELEGANT!

    • @lindblomdev
      @lindblomdev  Год назад +1

      Security through obscurity is not safe, when you have sent the bits to the client they are compromised. Either way, thanks for the video recommendation 🙏 I see two interesting areas for wasm, as an alternative for javascript in the browser and as a plugin system for saas products, where customers can upload their own wasm modules and have them run on their data (probably using metered billing, and time limited).

    • @TANRININresulu
      @TANRININresulu Год назад

      Maybe there could be cryptographyic extension in order to remove that obscurity… hence wasm client side server is faster than waiting responses from server in network

  • @Affstuffcom
    @Affstuffcom Год назад +1

    Any github code ?

    • @lindblomdev
      @lindblomdev  Год назад

      No, sorry. It was just throw away code. Was there something particular that you were interested in?