Access to the database for 2 Apps

28 views
Skip to first unread message

tim....@googlemail.com

unread,
Oct 16, 2014, 2:39:21 PM10/16/14
to appscale_...@googlegroups.com
Hi guys,

how can I get access to one database (cassandra) for 2 different apps, which runs on Appscale.
E.g. one app is store data to the database and the other is only read the stored data.
Is it possible?

Thanks,
Tim

Navraj Chohan

unread,
Oct 16, 2014, 2:44:59 PM10/16/14
to appscale_...@googlegroups.com

Hi Tim,
There is no way to do this straight up but you can modify the code to do such access controls. You would have to modify AppDB/data store_server.py to enable this. Glad to give further instruction if you want to go down this path.

Thanks
Raj

--
You received this message because you are subscribed to the Google Groups "AppScale Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to appscale_commun...@googlegroups.com.
To post to this group, send email to appscale_...@googlegroups.com.
Visit this group at http://groups.google.com/group/appscale_community.
For more options, visit https://groups.google.com/d/optout.

tim....@googlemail.com

unread,
Oct 16, 2014, 3:13:20 PM10/16/14
to appscale_...@googlegroups.com
Hi Raj,

yes, I want to try it. But first, is it a lot of work to modify the datastore_server.py?
What are the main steps for the modification in datastore_server.py?

Thanks,
Tim


Am Donnerstag, 16. Oktober 2014 20:44:59 UTC+2 schrieb Raj:

Hi Tim,
There is no way to do this straight up but you can modify the code to do such access controls. You would have to modify AppDB/data store_server.py to enable this. Glad to give further instruction if you want to go down this path.

Thanks
Raj

On Oct 16, 2014 11:39 AM, <tim....@googlemail.com> wrote:
Hi guys,

how can I get access to one database (cassandra) for 2 different apps, which runs on Appscale.
E.g. one app is store data to the database and the other is only read the stored data.
Is it possible?

Thanks,
Tim

--
You received this message because you are subscribed to the Google Groups "AppScale Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to appscale_community+unsub...@googlegroups.com.

Navraj Chohan

unread,
Oct 16, 2014, 4:46:25 PM10/16/14
to appscale_...@googlegroups.com
Hi Tim,
There are a few places where you would need to put in code:

There may be some other places as well. See the different types of request that come in:

When the request come in they will have certain application IDs. You'll have to add code that does something like this for puts and deletes:
if app_id == "reader_app_id":
 app_id = "writer_app_id"
So now the reader ID will switch to the writer ID, allowing it to access its data.
For the queries you'll have to do query.set_app("writer_app_id").

And add code that just returns empty results or throws a READ_ONLY exceptions if the ID is the writer for read operations (gets and queries).

This wont give you access to composite queries. So if you have things specified in your index.yaml file, it'll require some hacking on the application server side.

Let me know if you need additional clarification.

Thanks,
Raj

To unsubscribe from this group and stop receiving emails from it, send an email to appscale_commun...@googlegroups.com.

To post to this group, send email to appscale_...@googlegroups.com.
Visit this group at http://groups.google.com/group/appscale_community.
For more options, visit https://groups.google.com/d/optout.



--
Navraj Chohan (Raj), PhD
Co-Founder of AppScale Systems
A Google Cloud Partner,
Gartner 2014 Cool Vendor, 
and a GigaOm Structure/LaunchPad "Best of the Best" Startups

615 State Street
Santa Barbara, CA 93101
r...@appscale.com
http://navrajchohan.com
Reply all
Reply to author
Forward
0 new messages