Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement server side Palindrom to connect to a Starcounter server from another server #341

Open
miyconst opened this issue Dec 13, 2017 · 8 comments

Comments

@miyconst
Copy link

Currently we have a mechanism to keep JSON view-model mirrored between client (web browser) and server (Starcounter app) seamlessly and without extra pain for the developers.

It was requested multiple times to provide the same functionality for different clients other than web browsers. The most requested client is a C# .Net application.

There should be a server side (C# .Net) Palindrom library which would be able to connect to a Starcounter hosted app and communicate through the JSON view-models the same way web browser does.

cc @chrhol, @alshakero

@warpech
Copy link

warpech commented Dec 13, 2017

I know that @mtornwall had a working implementation of this for his own purpose. Is it usable?

@mtornwall
Copy link

That implementation technically exists but isn't particularly good and - in my opinion - a dead end for further development.

@ubbeK
Copy link

ubbeK commented Dec 13, 2017

This is something @eriksunsol have asked for, for test purposes.

@tomalec
Copy link

tomalec commented Dec 18, 2017

Just to clarify, we are talking about C# .Net Palindrom client.

I think it could be the joined effort with the idea to create JS version of Palindrom server - in my opinion, it should be a just more symmetric implementation of Palindrom (or parts of current Palindrom) that could be set via config to work as a master or slave.

Then it would allow us to:

  • Implement C# version also once for both ends,
  • and use it to modularize our current setup (C# server JS client),
  • share more tests,
  • share the knowledge and understanding between JS and C# teams.

I believe we are not far of it as I had this idea for quite long in my head, and OT is designed to support it.
JSON Patch, JSON Patch Queue, OT Agent are ready to serve at both ends,

@miyconst
Copy link
Author

@tomalec the biggest challenge is communication between .Net thread run inside Starcounter database thread with NodeJs Palindrom. How do we apply/generate patches? Someone has to investigate this before we can decide on anything.

@warpech
Copy link

warpech commented Dec 18, 2017

The only way I can think of @tomalec's proposal to work is through using a JS interpreter for .Net. I found some projects for that but I am not sure about their production-readiness:

There are also projects that package the Node app and Node runtime into a single executable: https://github.com/zeit/pkg (and its predecessor http://enclosejs.com/), https://github.com/nexe/nexe. Differences explained here vercel/pkg#42

@tomalec
Copy link

tomalec commented Dec 18, 2017

My proposal was not about using JS version, but before translating current Palindrom to C# I'd make PalindromJS client+server, and then translate it to C#. So at the and we will have Palindrom C# client-setup communicating with another instance of the same library Palindrom C# in server-setup.

@miyconst
Copy link
Author

Today me and @tomalec had a short discussion regarding this feature and came to the following conclusion:

  • Palindrom as a standalone server side package would let us promote Palindrom and JSON Patch protocol.
  • Server side Palindrom can and should be implemented as NPM module for NodeJs and NuGet package for .Net.
  • It's possible to generate C# out of JavaScript and other way around, so it's possible to keep single code base for both languages.

There are two tasks to start with:

  • @chrhol needs to decouple server side Palindrom into a separate package, which can be customized and reused.
  • @alshakero or @tomalec need to impelment a NodeJs server side Palindrom version.

The idea of having NodeJs thread running on Starcounter server is cool, but not very realistic. Keeping single code base for both of the packages should be good enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants