Earlier quoted context omitted.
I have somehow feeling that this does not answer the original question. Could you give some examples of impossible or not easy tasks this achieves and other solutions don’t?
Take the recently popular actor model as an example. Each player is an actor, which can not only ensure the simplicity of development, but also ensure the atomicity of the player's data in one operation. But if a player-to-player transaction system is designed, it is difficult for this actor model to achieve the atomicity of this transaction. But Lockval Engine can easily do all this. Because Lockval Engine is data-o…
Show HN: Lockval Engine – A distributed backend KV engine that can run scripts
11–20 of 21 posts
Re: Show HN: Lockval Engine – A distributed backend KV engine that can run scripts
#12I can definitely see this as something to bootstrap a backend quickly. It could serve as a nice in-between of Firebase/Supabase and a fully fledged server.
It took me a long time to grok the docs though. It would be great if there were more simple examples. The landing page refers to a lot of the nitty-gritty details, including method names and services in the architecture, but imo that's getting into the weeds before explaining the value prop. I also had a hard time figuring out the apidemo page on my phone screen.
Re: Show HN: Lockval Engine – A distributed backend KV engine that can run scripts
#13There's some cool ideas here. From what I understand, you basically implement a few endpoints in a serverless-esque fashion, which have access to methods to store data, and the engine will keep the client updated and handle consistency? I can definitely see this as something to bootstrap a backend quickly. It could serve as a nice in-between of Firebase/Supabase and a fully fledged server. It took me a long time to g…
Yes, as you said, gw and api in Lockval Engine implement stateless services, db implements ACID for front-end and back-end data, and trigger provides calling methods outside the engine.
So this is a complete closed-loop backend engine. It provides the most basic computing and data synchronization capabilities, and other functions can also be provided to upper-level scripts in the form of plug-ins
Sorry for the very lacking and messy documentation, I'll try to get them out of there as soon as I can. I made apidemo and playground pages, I think these two pages can help you understand how Lockval Engine is used in a more intuitive way. In addition, these two pages can be downloaded locally to build the experience yourself.
I'm also sorry that none of these pages are optimized for mobile, web development is really not my strong point.
Re: Show HN: Lockval Engine – A distributed backend KV engine that can run scripts
#14Earlier quoted context omitted.
Take the recently popular actor model as an example. Each player is an actor, which can not only ensure the simplicity of development, but also ensure the atomicity of the player's data in one operation. But if a player-to-player transaction system is designed, it is difficult for this actor model to achieve the atomicity of this transaction. But Lockval Engine can easily do all this. Because Lockval Engine is data-o…
Can you elaborate on an example with games that have some form of "fog of war"? Or rather only some state is seen by X players?
Lockval Engine provides a Watch function. Players can watch the UID of a certain map block or the UID of a certain observation point, so that a function similar to the fog of war can be realized.
This demo can be viewed in "Prepare a globalChat struct" and "send A message to globalChat" on the apidemo page. This demo can evolve a variety of similar functions.
Re: Show HN: Lockval Engine – A distributed backend KV engine that can run scripts
#15Does Starlark have Python libraries like requests, pyquery, libpq, SQLite client, etc? The Go angle is certainly intriguing.
For safety, the script does not provide any API that harms your environment. But you can use the Go plugin to write the API you need and provide it to the script. The solution can be found in "Use api.*.so for more functionality" in [apidemo]( https://apidemo.lockval.com/ ) Go plugin code: https://github.com/lockval/api.so
how do you ensure safety? Can the scripts make network or IO calls?
Also, how do you actually run the scripts? in some isolated docker container / VM?
Re: Show HN: Lockval Engine – A distributed backend KV engine that can run scripts
#16Earlier quoted context omitted.
For safety, the script does not provide any API that harms your environment. But you can use the Go plugin to write the API you need and provide it to the script. The solution can be found in "Use api.*.so for more functionality" in [apidemo]( https://apidemo.lockval.com/ ) Go plugin code: https://github.com/lockval/api.so
> For safety, the script does not provide any API that harms your environment. how do you ensure safety? Can the scripts make network or IO calls? Also, how do you actually run the scripts? in some isolated docker container / VM?
Just like the functions provided by the playground page, users can fill in any code, so I must ensure that it cannot write functions that can harm the server.
However, someone wants to connect to sql, mongodb, local files, http, etc. Even if it is the same http request function, everyone's needs may be different, so the Go plugin function mentioned above allows users to develop the functions they want. In this way, someone will make a more useful mysql plug-in, someone will make a mongodb plug-in, and so on. If you can't find the function you want, you can also develop one yourself.
Re: Show HN: Lockval Engine – A distributed backend KV engine that can run scripts
#17Earlier quoted context omitted.
> For safety, the script does not provide any API that harms your environment. how do you ensure safety? Can the scripts make network or IO calls? Also, how do you actually run the scripts? in some isolated docker container / VM?
The script is running in the VM on the api service and does not provide any IO functions. Just like the functions provided by the playground page, users can fill in any code, so I must ensure that it cannot write functions that can harm the server. However, someone wants to connect to sql, mongodb, local files, http, etc. Even if it is the same http request function, everyone's needs may be different, so the Go plugi…
Thank you for answering! but I am still not sure how can you prevent someone importing io lib in go or js and writing to a file.
> Just like the functions provided by the playground page, users can fill in any code, so I must ensure that it cannot write functions that can harm the server.
can you tell me more on how are you ensuring this?
Re: Show HN: Lockval Engine – A distributed backend KV engine that can run scripts
#18Earlier quoted context omitted.
The script is running in the VM on the api service and does not provide any IO functions. Just like the functions provided by the playground page, users can fill in any code, so I must ensure that it cannot write functions that can harm the server. However, someone wants to connect to sql, mongodb, local files, http, etc. Even if it is the same http request function, everyone's needs may be different, so the Go plugi…
> The script is running in the VM on the api service and does not provide any IO functions. Thank you for answering! but I am still not sure how can you prevent someone importing io lib in go or js and writing to a file. > Just like the functions provided by the playground page, users can fill in any code, so I must ensure that it cannot write functions that can harm the server. can you tell me more on how are you en…
github.com/dop251/goja
github.com/yuin/gopher-lua
go.starlark.net
Go scripts (programs) are not subject to any restrictions. So there is no Go script support in the playground(debug)
Re: Show HN: Lockval Engine – A distributed backend KV engine that can run scripts
#19Earlier quoted context omitted.
> The script is running in the VM on the api service and does not provide any IO functions. Thank you for answering! but I am still not sure how can you prevent someone importing io lib in go or js and writing to a file. > Just like the functions provided by the playground page, users can fill in any code, so I must ensure that it cannot write functions that can harm the server. can you tell me more on how are you en…
python, Lua and JS These functions are implemented by these packages: github.com/dop251/goja github.com/yuin/gopher-lua go.starlark.net Go scripts (programs) are not subject to any restrictions. So there is no Go script support in the playground(debug)
Re: Show HN: Lockval Engine – A distributed backend KV engine that can run scripts
#20Earlier quoted context omitted.
python, Lua and JS These functions are implemented by these packages: github.com/dop251/goja github.com/yuin/gopher-lua go.starlark.net Go scripts (programs) are not subject to any restrictions. So there is no Go script support in the playground(debug)
Thank you so much! This explains how they are run. I will explore these repositories.