I was testing AMPLIFY Mobile Backend Services and pumped gigabytes of data into it using cURL. Here are some observations – and how you can do this yourself!
Now, I’m not much of a mobile app developer and understand that the service usually caters for folks working with various SDKs to consume managed backends that offer push notifications, location, check-ins, and many other things. But, since our MBaaS has an API (Swagger | Documentation), nobody says you can’t use it from a script or even a backend of your choice.
So I’ve done exactly that – and wrote a couple of shell scripts that use cURL for Key/Value data manipulation. Find them on GitHub.
Get the value of ‘foo’
GET /v1/keyvalues/get.json?name=foo&key=XXXX
Set ‘foo’ = ‘bar’
PUT /v1/keyvalues/set.json?key=XXXX
Cookie: _session_id=XXXXX
Content-Type: multipart/form-data; .........
Testing under load
So, this works quite well! I can imagine using this key/value store from a regular, probably Python-based backend.
To test the performance, I’ve pumped quite a bit of arbitrary data into one of the MBaaS buckets.
100 parallel workers, 10k requests in total with a ~20kb payload gives me response times around/under 1 second, this is quite good! I’ve brought this up to ~1 million requests and it’s still performing solid.
Use Cases
As I’ve already mentioned, the service is primarily intended as a mobile backend to be consumed by apps. However, the example shows that we can think of other use cases as well. My colleague, Shawn Ryan, puts it this way:
Front-end experiences may require a custom data store that needs to be quickly spun up and scalable, further, front end experiences can drive hundreds of millions of API calls per day to existing back end databases and these need protection from the load. Data as a service as a layer in between systems is then often used as a buffer between an enterprise back-end systems and the front end. Data as a service provides scale to a legacy back end at a lower cost (via noSQL linear scale) and further can serve to reduce complexity and ensure availability for any front-end experience.
Learn more about AMPLIFY Mobile Backend Services