Jonkman Microblog
  • Login
Show Navigation
  • Public

    • Public
    • Network
    • Groups
    • Popular
    • People

Conversation

Notices

  1. Don Romano (alt) (thor@noagendasocial.com)'s status on Wednesday, 08-May-2019 10:25:02 EDT Don Romano (alt) Don Romano (alt)

    1. Begin to write node.js back-end with bare-bones SQL queries.

    2. Realise that representing entities as JS objects would be handy.

    3. Begin to write code that resembles an ORM.

    4. Stop, because ORMs are already a thing.

    5. Check for JS ORMs online. They're all vaguely as horrible as Hibernate and expect you to define your entities in some kind of internal data structure.

    6. Start dreaming about a relational database that seamlessly integrates with JS so you don't even notice it's there.

    In conversation Wednesday, 08-May-2019 10:25:02 EDT from noagendasocial.com permalink
    1. Don Romano (alt) (thor@noagendasocial.com)'s status on Wednesday, 08-May-2019 10:31:34 EDT Don Romano (alt) Don Romano (alt)
      in reply to

      What I would like to have is a database that pretends to be an in-memory object graph, but is actually keeping in lock-step with a relational database behind the scenes.

      If I make an object and stick it in an array that I assign to a special root object, that array should immediately become a table, or attempt to attach to a table that already exists in the DB schema.

      In conversation Wednesday, 08-May-2019 10:31:34 EDT from noagendasocial.com permalink
      1. Don Romano (alt) (thor@noagendasocial.com)'s status on Wednesday, 08-May-2019 10:32:56 EDT Don Romano (alt) Don Romano (alt)
        in reply to

        If I create a table in the DB, that should immediately appear as an object in the special root object. If I read an array element that hasn't been cached in memory, a new SELECT query with a range LIMIT clause should fetch the relevant rows. Think of it like virtual memory for databases. It swaps the pages in as you access that bit of memory.

        In conversation Wednesday, 08-May-2019 10:32:56 EDT from noagendasocial.com permalink
        1. Don Romano (alt) (thor@noagendasocial.com)'s status on Wednesday, 08-May-2019 10:37:45 EDT Don Romano (alt) Don Romano (alt)
          in reply to

          Since you can run into race conditions, you want to implement SQL transactions. Transactions are probably the only "special" thing outside of normal coding you'd worry about in this system.

          Thing is, I don't think you could pull this off in most languages. You'd have to override how the language performs the basic action of creating object members, fetching them and storing them. If you make a new field, you'd need the parent class to somehow override how the memory is accessed in fields.

          In conversation Wednesday, 08-May-2019 10:37:45 EDT from noagendasocial.com permalink
          1. Don Romano (alt) (thor@noagendasocial.com)'s status on Wednesday, 08-May-2019 10:39:03 EDT Don Romano (alt) Don Romano (alt)
            in reply to

            You'd at least need to overload the array access operator, but adding hooks to simple assignments would also be necessary, to track changes to objects you've accessed.

            In conversation Wednesday, 08-May-2019 10:39:03 EDT from noagendasocial.com permalink
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

Jonkman Microblog is a social network, courtesy of SOBAC Microcomputer Services. It runs on GNU social, version 1.2.0-beta5, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All Jonkman Microblog content and data are available under the Creative Commons Attribution 3.0 license.

Switch to desktop site layout.