Code Monkey home page Code Monkey logo

embed's Introduction

embed

Experimental and broken for now.

This is a golang layer that is embedded inside the client.

It allows:

  • the client to speak different transports for exotic security aspects
  • run background task without the app open:
    • Flutter is great at GUI. (MANY Foreground)
    • Golang is great at networking. (Singleton Background)

Run as a Background Service

We are moving to a Foreground and Background process model and so embedding is not needed.

Why ?

  • UX Ergonomics

    • Apps can be segregated to all the UX multi tasking experience to be high ergonomics.

    • Allows the GUI to not stutter because of the multi threading.

  • Security

    • Having the data and networking in a separate process provides more security at development time and runtime.

    • SSO (single Sign on) is centralised to one place.

    • Multi-tenant can be done in one place independent of the OS.

  • Notifications

    • Background is always running ( OS ) and so notification wake ups can be do not need the Google and Apple notification gateways and leak data.
  • Data synchronisation

    • Runs in the background and so UX on app started up is instant.

    • Allows offline editing to work much better because the data is less old.

  • Alignment

    • Mobile and Desktop have same Topology.

    • Web just bypasses the local golang background service and uses the Cloud Server that acts on the users behalf.

    • The same Services can run on the devices as in the cloud such as:

      • Search indexer
      • KV Store
      • VPN
      • and other goodies that Flutter cant do.
  • Interoperability

    • Others can build Apps in any languages they want.

Architecture:

  • Foreground runs the Flutter Apps

  • Background singleton service runs the golang code for all networking.

  • IPC options

    • GRPC based IO between them OS IPC mechanism.

      • Desktop will be easy
      • Mobile not so easy
      • Protocol buffers not GRPC
    • Or GRPC uses a GRPC socket and so we do not have to get into the weeds of IPC.

      • Often used approach
      • Will be much secure if we use a Cert between Foreground and Background. Can be bootstrapped from the Server on startup.

Dev aspects

  • The background process is best thought of as a PUB SUB topic based Network.

  • You are essentially working at the Domain Model layer and so your models do not have to match one to one to the PUB SUB topics.

  • You can remap them how you want. Its gives the Flutter app the ability to compose their Domain Models to not be a one for one match as the PUB SUB topics in the network.

  • When a record changes in the Background process it will just tell the Flutter foreground app over the GRPC stream.

  • We can set it up so the common Flutter code just puts it directly into HIVE, and so you just forget about it.

embed's People

Contributors

winwisely99 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.