The power of SST Framework

Felipe Lisboa
4 min readMay 18, 2023

--

The Platform engineering is become the most discussed approach over the Dev Ops world, when we started with the Dockerized environments and moved to more lightful environments, to allow the new orchestration models as Kubernetes and swarm.

The improvement of the IaC bring us to another level and new questions. How emulate or run some resources? We can use some good tools as Localstack but there’s some less painful as light ways that came from.

The Aws CDK allow a good approach but left the local capabilities, so is the where the SST shines.

We can create a mixup of cloud services with the local benefits, good to run a best development similar as possible from the production.

I’d like to create an application test, to check if suits on a god fit to the developer experience.

So let’s start creating a nextjs application to check and evaluate this framework.

yarn create next-app

and apply

yarn create sst

The application test represents a chessboard with a routing problem. Where we define the start of the drone position, define the pickup point and the delivery point. I decided to say yes to all of start questions from next cli creation, so We’ll had tailindcss and typescript tools enabled.

Here we’ll create the Infrastructure of the application

This includes the nextjs running over lambda, including their SSR,API lambdas, and Image optimizer lambda, and attach a dynamodb table with their fields definitions.

To run locally we just need to run

yarn dev

And our nextjs application is running now \o/

I just draw a draft with UI to start the development step of the test.

Now I’ll start to map the basic scenarios that I need to cover on problem.

This is the best fit because we can estimate the response and start from the resolution. It’ll took less time to reach the solution

The test aim to find the best route with an algorithm. At this case I’ve chosed the Dikjstra, that is one of the most know. But when we have a spatial memory problem, we can use the A* algorithm that includes a better resource optimization in memory and we can add some different weights too.

With the related optimized path, we’ll need to fetch the linked list of an API to retrieve the total time cost.

I’ve started with the draft of the solution, with the test case with the assertions, spliting the logic from each part of problem. This helped to optimize and refactor the solution when they start to fit into the expected results.

Let’s refactor the logic formed on UI to a hook pattern

The motivation to refactor is remove the draft logic from the UI, keeping only visual structure of the page. This approach is based on design thinking process, where we draft and organize the basic ideas, so we decide witch approach to solve and we can spend time refactoring

After this part, I decided to improve the design specs, adding the responsiveness capability.

And to deploy to production just run the command

yarn sst deploy — stage prod

The conclusion of this review It’s just to review how simple is implement with SST, almost forgetting that has a lot of steps to deploy an application

You can check the full implementation here

--

--

Felipe Lisboa
Felipe Lisboa

Written by Felipe Lisboa

Computer Engineer, Design Thinking Professional Certified, focused on solving problems.

No responses yet