[go-nuts] saving files on google app engine

2019-01-19 Thread Val
Hello Chris,
I suspect you're trying to build a stateful server, which is highly discouraged 
on GAE.
Scaling up and down to zero may kill instances any time, and you would lose 
your scoreboard, if it's in memory or in the local fs. And what about 2 
instances with contradictory scoreboards?
The solution (using GAE) is to make a stateless server and use a database like 
Datastore, Firestore, or Cloud SQL.
Cheers

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] saving files on google app engine

2019-01-17 Thread Robert Engels
There are some options to increase the local storage on an instance, but 
compute engine is probably a better solution for something like that. 

> On Jan 17, 2019, at 7:16 PM, Chris FractalBach  wrote:
> 
> So I noticed this post: https://blog.golang.org/appengine-go111
> 
> And especially noticed this part:
>> Furthermore, the application code is completely portable—there are no ties 
>> to the infrastructure that your application is deployed on.
> 
> 
> 
> So I wanted to try it out! Just to keep things simple, I revisited 
> https://golang.org/doc/articles/wiki/ just to get back to basics.
> I attempted to make really simple highscores for a game:  
> 1 json file,POST score, GET summary
> 
> But once I ioutil.WriteFile gets called...
> SaveAs :: unable to save scoreboard to file :: open first.json: read-only 
> file system
>  
> and then I realized...
>> The runtime includes a writable /tmp directory, with all other directories 
>> having read-only access. Writing to /tmp takes up system memory.  
> 
>> https://cloud.google.com/appengine/docs/standard/go111/runtime
> 
> 
> 
> So that explains the writing-file issue.
> Perhaps I'm attempting to use app engine for something it wasn't designed for?
> 
> seems like overkill to use a VM instance or a database for something this 
> simple.
> 
> Anybody got some advice?
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] saving files on google app engine

2019-01-17 Thread Chris FractalBach
So I noticed this post: https://blog.golang.org/appengine-go111

And especially noticed this part:

Furthermore, the application code is completely portable—there are no ties 
> to the infrastructure that your application is deployed on.



So I wanted to try it out! Just to keep things simple, I revisited 
https://golang.org/doc/articles/wiki/ just to get back to basics.
I attempted to make really simple highscores for a game:  
1 json file,POST score, GET summary

But once I ioutil.WriteFile gets called...

SaveAs :: unable to save scoreboard to file :: open first.json: read-only 
file system

 
and then I realized...

The runtime includes a writable /tmp directory, with all other directories 
> having read-only access. Writing to /tmp takes up system memory.  

https://cloud.google.com/appengine/docs/standard/go111/runtime



So that explains the writing-file issue.
Perhaps I'm attempting to use app engine for something it wasn't designed 
for?

seems like overkill to use a VM instance or a database for something this 
simple.

Anybody got some advice?

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.