Our fees are changing on 4 March 2023. Learn more.


Share

The Tech Diaries Vol 1. Amazon Web Services

The Tech Diaries Vol 1. Amazon Web Services

A behind-the-screens look at what goes into being a global leader in digital brokerage.

29 March 2021

The Stake community is filled with more than just traders and investors. Within this group are engineers, entrepreneurs, and innovators wanting to know how our platform is built. To begin, let’s look at the way we integrate with the best in class cloud solutions that our partner, Amazon Web Services, develops.

API Gateway

Our team has been hard at work to launch API Gateway, an AWS managed service that allows infrastructure engineers to easily maintain and secure APIs at any scale

What are some of the benefits of API gateway?

Stake’s mobile app and website communicate with its servers via a RESTful API layer. API Gateway has all the benefits of enterprise-grade middleware including:

  • Easy monitoring of API usage and changes
  • Cloudwatch logging and alarms alerting the team at busy times
  • Serverless infrastructure with automatic scaling

As our number of users continues to grow, serverless scaling and extensive monitoring become critical to providing a seamless experience around the clock.

API Gateway and Microservices

As Stake continues to build out its microservice architecture, client-to-microservice communication becomes a critical element to consider.

One approach would be to have direct client-to-microservice communication, whereby a client app can make requests directly to some microservices, as follows:

However, realistically the example above is not practical. Client apps usually need to consume functionality from more than one microservice. Therefore, introducing an intermediate level (or Gateway) between microservice-based applications can help us avoid the following problems:

  • The need to roll out a new app version and force users to update
  • Too many round trips between client apps and servers (which would add latency).
  • Further security issues by exposing too many microservice endpoints to the internet.

Therefore, an API gateway can act as the intermediate proxy between client application requests as follows:

In fact – you can (and we do) have many API gateways talking to each other, but without getting too complex, hopefully, this simple example has illustrated some benefits.

SQS (Simple Queuing Service)

In the brokerage world, speed of execution and information flow in real-time becomes absolutely pivotal. We all want to know the second a stock becomes ready to trade after IPO, immediate feedback on trade executions, and our portfolio balance marked to the latest stock prices.

With millions and millions of requests and messages passing through our system every month, we need to make sure nothing goes missing!

There are lots of different ways of managing this – and one way we are currently using is a simple queuing service.

One example is when our broker executes trades. Our broker publishes messages about the execution to an SQS queue, which Stake then receives. Stake redistributes these messages to queues sitting in all of its AWS data centres. Receivers of these messages are called consumers. When a consumer receives a message it may execute some code.

For example, a consumer has been built to give you notifications of real-time execution via email, and also making sure that trade execution is reflected in all the relevant places (e.g. holdings and buying power). Once you get to a certain scale, without queuing, any system risks messages not being processed in time (and out of order). Many parts of our business continue to make more active use of this technology, to support both our customers and operations staff having visibility on all things real-time.

S3 Web Hosting

Our desktop platform has been available to Australians and New Zealanders, and we are super excited to get it live in the UK and Brazil.

Up until this point, we have been statistically serving the site from AWS on a dedicated EC2 out of a single datacenter.

UK and Brazil change the game. We of course want the best possible experience for all our customers across the globe!

By transitioning our web hosting to utilise S3 and making use of AWS’s extensive edge-location network for geo-located caching, we are making sure our UK and Brazilian customers get the best possible browser experience.

← Back to blog

Don’t have Stake?

Get $10 when you fund Stake AUS, a free US stock when you fund Stake Wall St. Do both, get both!


Stake logo
Download Stake
App Store logo
Google Play logo

Stakeshop Pty Ltd is registered as an overseas company in New Zealand (NZBN: 9429047452152), and is registered as a Financial Service Provider under the Financial Service Providers (Registration and Dispute Resolution) Act 2008 (No. FSP774414). We hold a full licence issued by the Financial Markets Authority to provide a financial advice service under the Financial Markets Conduct Act 2013. However, the content on this website has not been prepared to take into account any of your individual objectives, financial situation or needs. To the extent you require further information about the relevant New Zealand legislation that may apply, or require specific advice, please contact your legal and/or financial adviser (as appropriate). The information on our website or our mobile application is not intended to be an inducement, offer or solicitation to anyone in any jurisdiction in which Stake is not regulated or able to market its services. At Stake, we’re focused on giving you a better investing experience but we don’t take into account your personal objectives, circumstances or financial needs. Any advice is of a general nature only. As investments carry risk, before making any investment decision, please consider if it’s right for you and seek appropriate taxation and legal advice. Please view our Terms & Conditions, Privacy Policy, Financial Advice Disclosure and Disclaimers before deciding to use or invest on Stake. By using the Stake website or service in any way, you agree to our Privacy Policy and Terms & Conditions All financial products involve risk and you should ensure you understand the risks involved as certain financial products may not be suitable to everyone. Past performance of any product described on this website is not a reliable indication of future performance. Stake is a registered trademark under class 36 (New Zealand).

Copyright © 2023 Stake. All rights reserved.