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

When you invest, your capital is at risk.

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?

Start ahead of the game. Get a free stock in one of Nike, Dropbox, GoPro or a mystery stock when you sign up and fund your account within 24 hours.

When you invest, your capital is at risk.

Stake logo
Download Stake
App Store logo
Google Play logo
The value of investments can go up as well as down and you may receive back less than your original investment. 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. 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. Please view our Terms & Conditions, Privacy Policy 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 the trading name of Hellostake Limited (no. 11676409), authorised and regulated by the UK Financial Conduct Authority (FRN: 830771).

Copyright © 2023 Stake. All rights reserved.