DEV Community

David Romero
David Romero

Posted on

Fight the Fire

Journal Entry July 8 2020

Study For Java OCA

Today's Topics

  • Arrays

Different forms of initializing an array

int[] numAnimals;
int [] munAnimals2;
int numAnimals3[];
int numAnimals4 [];

String Array and int array 'a' -> 97

String[] towns = {"Antigua", "Escuintla", "Coban"}
int[] numbers = {100, 2, -9, 'a'};

Serverless Rest API

The service I'm currently working has the following structure:

(Since chalice is a serverless microframework we put libs under chalibelib)

  • app.py - define the route and the methods, returns a response
  • validations.py - define the mandatory and non_editable attributes and validate based on requirements
  • databases.py - dynamoDB table.scan() and table.put_item()
  • custom_reponses - make the http response based on status code, body and headers

DynamoDB

I'm using DynamoDB as a document database for the moment.

Tables: Collection of data

Items: Group of attributes that is uniquely identifiable.

Attributes: Fundamental data element.

Document Sample, volcanoId is the primary Key

[
  {
    "volcanoID":205,
    "name":"Tajumulco",
    "elevation":4220,
    "coordinates":{
      "N":"15-02-04",
      "W":"91-54-12″
    }, 
    "last_eruption": 1863
  },
  {
    "volcanoID": 206,
    "name": "Tacaná",
    "elevation": 4060,
    "coordinates" : {
    "N": "15.07.48",
    "W": "92.06.45″
    },
    "last_eruption":1986
   }
]

Primary Key: Identifier for the item.

Secondary Indexes: used for queries.


Things to do

Google Ads API
Oauth2.0 authentication on lambdas


Song of the Day

Andy Moor feat. Sue McLaren - Fight The Fire

Top comments (0)