GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Conversation

Notices

  1. Embed this notice
    Aral Balkan (aral@mastodon.ar.al)'s status on Wednesday, 30-Aug-2023 02:08:56 JST Aral Balkan Aral Balkan

    Been doing some research into implementing migrations for Domain’s JSDB database (basically, JavaScript data structure migration) and it’s amazing to me how many of the solutions out there use semver to version databases with no good reason.

    If your database requires a migration, it is a major version. Where does minor and patch even come into it? Why complicate it beyond version 1, 2, 3… etc.?

    I do wish folks would stop and think for a moment before adopting things without understanding them.

    In conversation Wednesday, 30-Aug-2023 02:08:56 JST from mastodon.ar.al permalink
    • Linux Walt Alt (@lnxw37a2) {3EB165E0-5BB1-45D2-9E7D-93B31821F864} likes this.
    • Embed this notice
      Aral Balkan (aral@mastodon.ar.al)'s status on Wednesday, 30-Aug-2023 02:13:36 JST Aral Balkan Aral Balkan
      in reply to

      I’m actually now wondering if implementing lazy migrations at the object level is madness or not.

      e.g., myDatabase.someTable.someObject.latest().someProperty

      Where the latest method ensures migrations for the object are lazily run as necessary.

      Of course, that would complicate authoring quite a bit because if you forgot that latest() call things would go poof!

      Hmm… if only there was a way to run an initiliser when using Object.create()… #JSDB already uses proxies so maybe?

      #js #database

      In conversation Wednesday, 30-Aug-2023 02:13:36 JST permalink
    • Embed this notice
      Aral Balkan (aral@mastodon.ar.al)'s status on Wednesday, 30-Aug-2023 03:23:58 JST Aral Balkan Aral Balkan
      in reply to
      • Claudius

      @claudius Read an article where someone was suggesting using hashes for the same reason. They were actually essentially creating a basic directed acyclic graph with the migrations. Neat but rather overkill for my use case, I think (says the guy looking into if he can use a Proxy to automatically carry out necessary migrations at the object-level for persisted classes) :)

      In conversation Wednesday, 30-Aug-2023 03:23:58 JST permalink
    • Embed this notice
      Claudius (claudius@imd.social)'s status on Wednesday, 30-Aug-2023 03:23:59 JST Claudius Claudius
      in reply to

      @aral rails timestamps the migration (iso8601) and has one table that keeps track of applied migrations. This is a good idea in a scenario where Multiple Devs might add migrations on separate branches where a single version number would fall short.

      In conversation Wednesday, 30-Aug-2023 03:23:59 JST permalink
    • Embed this notice
      Aral Balkan (aral@mastodon.ar.al)'s status on Wednesday, 30-Aug-2023 03:25:19 JST Aral Balkan Aral Balkan
      in reply to
      • Matt Boehm

      @bigolewannabe Yeah, that would make sense.

      In conversation Wednesday, 30-Aug-2023 03:25:19 JST permalink
    • Embed this notice
      Matt Boehm (bigolewannabe@hachyderm.io)'s status on Wednesday, 30-Aug-2023 03:25:21 JST Matt Boehm Matt Boehm
      in reply to

      @aral
      Possibly one reason is to keep the version of the app in line. Linear increase of the DB schema means you basically need a decoder ring to figure out which app version uses which schema number.

      In conversation Wednesday, 30-Aug-2023 03:25:21 JST permalink
    • Embed this notice
      Aral Balkan (aral@mastodon.ar.al)'s status on Wednesday, 30-Aug-2023 03:45:08 JST Aral Balkan Aral Balkan
      in reply to
      • Claudius

      @claudius I quite like the idea that each database object (be it a collection or a single object) has its own migration code encapsulated within it. So if from version 2 to 3 only Collection X and Object Y have changed, they can lazily carry out their migrations the first time they’re accessed.

      Just had a quick look at JSDB to remind myself how I’m doing things and it should work by having the Proxy methods carry out the migration check.

      Going to spike it and see how/if it works :)

      In conversation Wednesday, 30-Aug-2023 03:45:08 JST permalink
    • Embed this notice
      Claudius (claudius@imd.social)'s status on Wednesday, 30-Aug-2023 03:45:10 JST Claudius Claudius
      in reply to

      @aral yeah solving 95% is probably the way to go. You can always get more complicated later without too much hassle.

      In conversation Wednesday, 30-Aug-2023 03:45:10 JST permalink

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.