본문 바로가기
[AWS]/Highly Available, Scalable, AWS Stack

23. [활용] Create sessions table in DynamoDB

by SAMSUNG CLOUD-OKY 2022. 1. 23.
반응형

 

"이 값 이름은 PHP 애플리케이션에 하드코딩되어 있으므로 이 값도 동일하게 호출해야 합니다.

테이블 이름이 세션으로 설정되어 있는지 확인하고 기본 키를 ID로 설정하십시오."

 

"기본적으로 DynamoDB 서비스에서 세션 테이블을 생성했습니다.

그리고 다음 비디오 세트에서 PHP 애플리케이션에서 테이블을 사용하는 방법을 살펴보겠습니다."

 

 

 

 

OK in this video let us see how to create a session table.

Right.

This will be a table that our application will use to manage sessions centrally and we want to centralize

sessions and so we create a session table and this will be in the dynamo DB service which is AWS's

nosql offering.

All right let's see how to do this in the later videos we'll see how to use this sessions table.

But for now we have something simple to do which is to create this table.

Right.

So let's go to DynamoDB.

This is in the databases category.

And let's go ahead and create our table.

So I'm going to call this sessions.

You should also call this the same because this value the name is hardcoded in our PHP application so

make sure the name is set to sessions and set the primary key to ID.

OK.

This is the session id right.

And that's it.

You can then create the table.

But before that you may want to change the capacity right.

DynamoDB is a serverless service.

So we don't have micro instances small instances those kinds of things and we have to set up the

capacity in terms of read capacity units which means how many reads per second we want and write capacity

units which means how many writes per second we want and what I suggest you do is that you can remove

auto scaling remove auto scaling and set the capacity to 1 for both read and write right this

will be sufficient for the purposes of this course.

And you can see the cost of this is just 71 cents per month.

Right.

And most of this will also be covered in the free tier and also the cost of this will

be lower in U.S. East as well.

So this is the dynamodb table and and and very soon you'll see it's a serverless service.

So the table doesn't take much time to be created.

Right.

So within seconds this will be ready.

You can now see it is ready and and later when we start using the application and the application

starts reading and writing from the table.

You'll find the items here right you'll find session items listed.

over here under the items tab.

Okay.

Right.

So that's it.

It's a very short video here.

Basically we have created the session table in the DynamoDB service.

And then in the next set of videos we'll see how to use the table from our PHP application.

But before also have to set up the role so that the application

has access to the Dynamodb table.

So the IAM role goes hand in hand with the dynamodb table.

OK because without the IAM role the PHP application cannot talk to the dynamodb table so it needs

permissions.

And the role has to be attached to the server.

You can then start using the table.

Right.

So good luck with this small task and I'll see you in the next set of videos.

 

 

 

반응형

'[AWS] > Highly Available, Scalable, AWS Stack' 카테고리의 다른 글

25. [활용] Setup auto-scaling group  (0) 2022.01.24
24. [활용] Create IAM role  (0) 2022.01.24
22. Intro: Scalability - app layer  (0) 2022.01.23
21. Configure sticky sessions  (0) 2022.01.23
20. Setup load balancer  (0) 2022.01.23

댓글