Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

locize tech talk

603 views

Published on

- What is locize?
- Why serverless?
- Why AWS?
- Technology stack
- Base function types (code)
- Tooling
- Q&A

http://locize.com

Published in: Technology
  • Be the first to comment

locize tech talk

  1. 1. T E C H TALK how locize leverages serverless
  2. 2. localization as a service localization: The process of making a product suitable for use in a particular country or region. as a service: easy to use, scale as you grow/ need, hassle-free, collaborative, etc… WHAT IS LOCIZE?
  3. 3. Bridging the gap between translation and development As we know how hard it can be to have a solid and working localization process between developers and technical editors / translators our mission is to offer a new platform where everybody is efficient to do its own work and everybody is happy. OUR MISSION
  4. 4. InContext Editor Often doing correct translations needs more information by providing more context information. The best context is always the place where the content is shown - your website. Continuous Localization Complete your CI/CD pipeline with continuous localization! You’re able to deploy your translation files separated from your software so you can update and manage them independently. Flexible Integration Your web project stays connected with locize. No more moving files around. Always keeping the overview. SOME BENEFITS We help you to solve your localization and translation process, decreasing development time and cost.
  5. 5. DAY ZERO - HOW ALL BEGAN 2011 2013 2014 2016 2018 2019 2021 All started back in 2011 when we were in search for an internationalization library that meets our demand - allowing to run both on server side node.js and on our client side single page applications. ?
  6. 6. Enhanced scalability Everyone wants his app to be successful, but if that happens, can it handle the load? Serverless architecture means you don’t need to make that choice. Scale technically with your business model! Lower cost In terms of both computing power and human resources, serverless saves. The next level of DevOps is to move towards NoOps! The real PaaS Most PaaS are not geared towards bringing entire applications up and down for every request, whereas FaaS platforms do exactly this. WHY WE CHOOSE SERVERLESS?
  7. 7. - only ready FaaS provider (and more) - works out of the box - scales like expected - API-first approach - lambda future in the edge AWS integrates like a charm with other AWS services: - API Gateway - DynamoDB - Simple Storage Service (S3) - CloudFront - Simple Email Service (SES) - etc… WHY WE CHOOSE AWS?
  8. 8. THE BASIC SETUP It integrates very well with S3 (where we serve the localized files) and with DynamoDB (our main work storage). We don’t have to worry about scaling, multi-server communication and other problems related to distributed systems.
  9. 9. JavaScript everywhere! Everything is written in JavaScript: - app backend - api - web client - cli Full-Stack JavaScript
  10. 10. express We use 3 different lambda types LAMBDA FUNCTIONS RESTful APIs using the express framework async triggered by other lambda functions to compute non blocking tasks s3 event i.e. triggered by a new CloudFront log file that was saved to s3 (i.e. to calculate downloads)
  11. 11. const express = require('express'); const bodyParser = require('body-parser'); const app = express(); const ensureSettings = require('./lib/ensureSettings'); const verifyApiKey = require('./lib/verifyApiKey'); const missing = require('./routes/missing'); const update = require('./routes/update'); const download = require('./routes/download'); const cors = require('cors'); app.use(cors()); app.use(ensureSettings); app.use(bodyParser.urlencoded({ limit: '5mb', extended: true })); app.use(bodyParser.json({ limit: '5mb'})); app.post('/missing/:projectId/:version/:language/:namespace', verifyApiKey, missing ); app.post('/update/:projectId/:version/:language/:namespace', verifyApiKey, update ); app.get('/download/:projectId/:version?/:language?/:namespace?', download ); if (require.main === module) { // called directly app.listen(3000); console.log('lambda started locally on port 3000'); } else { // required as a module module.exports = app; } app.js const awsServExp = require('aws-serverless-express'); const app = require('./app'); const server = awsServExp.createServer(app); exports.handler = (event, context) => { awsServExp.proxy(server, event, context); }; lambda.js
  12. 12. updateNamespace.js const aws = require('aws-sdk'); const lambda = new aws.Lambda({ region: 'eu-west-1' }); // ... lambda.invoke({ FunctionName: 'locize-async-processing', // fire and forget; 'RequestResponse' would wait for response InvocationType: 'Event', LogType: 'None', Qualifier: version, // dev or prod or xy Payload: JSON.stringify({ event: 'namespaceUpdated', payload: { projectId: meta.projectId, version: meta.version, language: meta.language, namespace: meta.namespace } }, null, 2) }, (error/*, data*/) => { // ... }); async
  13. 13. const AWS = require('aws-sdk'); exports.handler = (event, context) => { const region = event.Records[0].awsRegion; const s3 = new AWS.S3({ region: region }); const ddb = new AWS.DynamoDB.DocumentClient({ region: region }); const srcBucket = event.Records[0].s3.bucket.name; const srcKey = event.Records[0].s3.object.key; // ... s3.headObject({ Bucket: srcBucket, Key: srcKey }, (err, data) => { if (err) { console.error(err); context.done(null, null); return; } // ... }); }; index.js
  14. 14. If you want to build simple services and run them with AWS Lambda, and you're looking for something low- overhead, easy to get started with, and you only want to use the node.js runtime, Claudia is a good choice. OUR TOOLING focused works only for node.js, but it does it really well It automatically installs templates to convert parameters and results into objects that Javascript can consume easily, and makes things work the way Javascript developers expect out of the box. no abstraction deployment utility, not a framework It does not abstract away AWS services, but instead makes them easier to get started with. Claudia is not trying to change the way you structure or run projects. simple helps you get simple stuff done, quickly There's no need to learn a special interface syntax, no need to keep your definition spread across multiple files and introduce the overhead of coordination and maintenance -- just write the code to handle requests.
  15. 15. Let’s share some experience. FEEL FREE TO ASK ANYTHING! locize.com claudiajs.com aws.amazon.com/lambda Q & A
  16. 16. T H A N K YOU www.locize.com

×