Hi,
I have an application deployed into Google App Engine. This application have a database in Google Cloud Datastore. To improve the performance, the data stored into Datastore, is stored in App Engine Memcache too. I would like to implement this in an Apigee X proxy and I have several questions.
- In terms of performance, is better option use Datastore with Service Callouts or use KVM as database?
- to support multi-region, are the KVM datastores in the same region that the Apigee Instance?
- do you think it is better option to to use Cache Policy or a MemoryStore instance of App Engine Memcache?
Thank you,
Regards.
Solved! Go to Solution.
oh! you used the term "proxy" to describe the thing you have in AppEngine. Is it actually a proxy? If that's so, then I think you're correct - for better performance, scale, and capability, you can use the Apigee platform for your API Proxy purposes, and eliminate that thing you've built in App Engine. Apigee will do authentication, authorization, routing, and so on, associated to your APIs.
An example of data stored here would be users data needed to accept or reject the request to the API, the endpoints list that the consumer application can invoke, information about authentication mechanism that this proxy will use in the target API .
Apigee has its own Domain Specific Language. For all of the things you are describing, you can configure Apigee to perform that work. There is no need for an Apigee API proxy to use an external datastore like Cloud datastore to hold that configuration information. Apigee stores the configuration in its own internal datastore, which is multi-region as appropriate.
You might want to check out some Apigee 101 videos to get the idea for how you can configure Apigee to do authentication, routing, and so on.
I would like to implement this in an Apigee X proxy and ....
Can you explain further about your goals w.r.t. "implement this in an Apigee X proxy"? The reference architecture is to use AppEngine (or Cloud Run or Functions) for hosting application logic, and use Apigee for API Proxies. The API Proxy is intended to do things like: validate inbound credentials, route to upstream systems, mediate security, transform payloads or API interfaces (act as a "facade"), and similar. It is not a good pattern to use an Apigee-hosted API proxy as a "container" for application logic that reads or updates databases.
- In terms of performance, is better option use Datastore with Service Callouts or use KVM as database?
I recommend that you defer optimizing for performance. First get the architecture right, get the building blocks right. Performance is a concern. It should not be the primary or sole concern when selecting the components and designing how they work together. So I think your first question is not a good question to start with.
A better question: What are the right components? The Apigee KVM is not a transactional database, and you should not treat it as such. It is not optimized for storing or caching application data. It's primarily intended to store metadata that can be used with API calls. Metadata might include: routing information, data associated to service-level, default values for particular clients or apps, and so on. So I advise you to not try to use Apigee KVM for storing general application data. It's not the right choice for application data. A good place to store application data is in one of the Google Cloud data storage options. If you want caching, a good choice for that is Cloud MemoryStore (a managed Redis or memcached), or... if you're committed to App Engine, and you find the programming model easier, then you can may wish to use the Memcache that is embedded in App Engine.
- to support multi-region, are the KVM datastores in the same region that the Apigee Instance?
the datastore backing the KVM is distributed and multi-region.
- do you think it is better option to to use Cache Policy or a MemoryStore instance of App Engine Memcache?
If I were designing a traditional system, that had application logic, data (with some ability to cache it), and APIs, and I would look at using
There are other options. For example, you can build ALL of that capability into a single app. You could use Java, embed the ehcache library for caching, use JAX-RS for exposing REST, write your own logic for verifying OAuth tokens and logging analytics data, and embed SQLite for in-app data store. Or you could do something similar with C# as the language. Or nodejs. Regardless of your language, host it all on a VM, and boom - the problem is solved with just one application element. This WILL WORK. But what if you have requirements to handle concurrent load, to be consistent with an existing portfolio of APIs, to connect to existing data stores, to scale out, to allow a team of people to update the system, to have audit controls on changes to data or logic, to have other application modules that might access the same data, and so on... in other words, what if you have typical enterprise requirements? In that case, this design approach of embedding everything within a single code base may not be the best choice. In that case, using dedicated infrastructure for the different functional areas may be wiser.
Hi,
Thank you for your response and excuse me for not explaining in more detail.
The application I am talking about is an api proxy developed in Java and deployed on Google App Engine. This proxy api is in charge of managing communications between different applications (APIs), basically providing authentication, authorisation and routing. This api proxy has all the necessary data for authorisation and authentication in Cloud Datastore. Datastore is its database, and it relies on Memcache to improve latency. Data in this storage is queried only by entities key.
What I am looking for is to use Apigee instead of this proxy to make it more robust, to improve the whole API management and to provide many more features than it currently has.
That is why I was thinking about the best solution where to store this data so that the access from the proxies I deploy in apigee has the best possible performance.
An example of data stored here would be users data needed to accept or reject the request to the API, the endpoints list that the consumer application can invoke, information about authentication mechanism that this proxy will use in the target API ...
I will also need multi-region support so Datastore/Firestore alone is not enough.
Thank you,
Regards.
oh! you used the term "proxy" to describe the thing you have in AppEngine. Is it actually a proxy? If that's so, then I think you're correct - for better performance, scale, and capability, you can use the Apigee platform for your API Proxy purposes, and eliminate that thing you've built in App Engine. Apigee will do authentication, authorization, routing, and so on, associated to your APIs.
An example of data stored here would be users data needed to accept or reject the request to the API, the endpoints list that the consumer application can invoke, information about authentication mechanism that this proxy will use in the target API .
Apigee has its own Domain Specific Language. For all of the things you are describing, you can configure Apigee to perform that work. There is no need for an Apigee API proxy to use an external datastore like Cloud datastore to hold that configuration information. Apigee stores the configuration in its own internal datastore, which is multi-region as appropriate.
You might want to check out some Apigee 101 videos to get the idea for how you can configure Apigee to do authentication, routing, and so on.
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |