Alexa sdk, save data for later sessions - alexa-skills-kit

I'm relatively new to Alexa and AWS. I'm trying to save data generated by a RequestHandler to use it later in another Handler. I know how to use the SessionAttributes, but this only works, if the skill isn't terminated meanwhile and since i can't increase the timeout, i need another solution. I read in another post, that you can save something in some DB, but i don't know how he did that:
Alexa Skills Set SDK - increase timeout of skill
Can anyone recommend a tutorial or documentation for something like that?
Btw i use nodejs and sdk v2

You are correct.
If you are trying to save the data somewhere, like a database, it is better to use Dynamo DB.
Here's a link to the tutorial on adding Memory to your skill. Hopefully this helps.

Related

How to manage firebase by URL

Good night.
May someone help me?
I'm trying to upload data throught arduino and SIM800L to firebase, I have seen one tutorial in github but It didn't work for me, I have done a code to upload data to thingspeak db and it works with url using get method, If I put this in the navigator i see the data in thingsepak:
https://api.thingspeak.com/update?api_key=API_KEY&field1=0DATA1&field2=-0DATA2&field3=0DATA3
So in thingspeak I'm going to see in field1:DATA1, field2:-DATA2, field3:DATA3
Is It possible to make the same with firebase?
For example:
https://api.firebaseio.com/update?api_key=API_KEY&field1=0data1&field2=0
Sorry for my english
Kind regards,
Thanks!
Firebase Realtime Database has a REST API that you can access using any modern HTTP client.
Some of the operations will not work if you are just using a web browser to enter a URL. If you want something that allows you to write data purely by URL, you will have to build that API yourself.

can I post data to my server directly instead of firebase

I am considering firebase for an app - mainly for the real-time but other features like the analytics and authentication (and price) are other bonuses.
I have my own database and I want everything saved in there. Firebase will have a small portion of the dataset I push as it's needed.
So I'm basically thinking that the firebase data will be read only to the users. If a user comments, that will actually go to my server, I'll authenticate, clean, whatever.. and push to the that feed.
Are there problems with this approach? Are there other (better) ways to solve the problem?
This is a completely valid approach. Firebase is designed so you can use specific features that suit your needs.

Validate data before insertion in Firebase

I'm building an app which uses user contributed content.
The contribution by each user should be available to all others in real time.
I was looking into firebase Realtime database for this.
However, when a user contributes content, there are quite heavy validations and calculations (read server side) to be done on the data before making it available to others.
Is it possible to have a server side validation in firebase ? Or should I look for alternatives ?
Initially, Firebase did not have a feature to implement server-side processing/calculations. All your processing had to be done on the client side.
Now, they've recently introduced a new feature called Cloud Functions For Firebase. Its a really useful new addition where you can write server-side code without the hassles of managing servers or instances. Read up more about it from the above link.
Also, this Youtube playlist by Jen Person is a great start. And, you can find examples similar to your use case here.

SQLite and Cloud applications

i was wondering if there is a way to enable cloud features for a SQLite database application.
Should i save the whole database to the cloud each time ? For example when i quit the application is it required to save the whole database to the cloud.
What do you suggest ?
Should i drop SQLite and use another database for cloud programming .
iCloud supports SQLite databases.
When properly setup it will only sync change logs instead of the entire database. In theory it's pretty nice. I haven't however had the best of luck using it yet, it seems to be a little too buggy to actually use in ios 5, hopefully it's better in 6.
To be most efficient you could manage a changelog of objects that are modified by the app. Then when its time to sync (while closing the app for instance), you can make operational requests to the Cloud. For add and update you can send the entire object, while for delete just the oid should suffice.
This is a very simple sync scenario. Things can get complicated fast if you are looking to send changes that happen in the Cloud down to the device. That is a scenario for a different thread.
Based on your question, you just need to sync from the device to the Cloud.

Implementing chat system: where to store chat data?

i am implementing a chat system in asp.net, much like google chat and i use xmhttp to send and receive data, and i am using a single table to store all chat for all user.
i wanted to create global temporary tables in sql using a XMLHttpRequest so as to be abl to organise data better(instead of storing all the chat in a sigle table which can(i dont know for sure) cause locking issues when many users are accessing it.)
also for my system i don't have to store the chat and so i thought that a global temporary table would be better since it will already be dropped and save me the trouble of clearing it.
but the after the table has been created by the Xmlhttprequest it gets dropped just after its creation....why this happen i don't know....i also have removed all connection closing lines but still no luck
so what should i do?? also if anyone knows of any online resources that can points me about best practices to follow please tell me.
Your table won't have locking issues with many users accessing it. Temporary tables are not meant to be shared cross-call, and you're going to wind up with far more roadblocks down that path. It is probably better to simply store your data in a table, then poll the table.
The only time you could have "locking issues" is if the users are attempting to write the same chunk of data to the same row at the same time ... which shouldn't be happening in a chat application.
Additionally, Google Chat uses a COMET style implementation instead of a polling implementation. It has been my experience that COMET > polling in terms of user experience.
You're not supposed to keep any chat messages on your database actually... unless you're implementing offline messages.

Resources