728x90 반응형 전체 글303 .NET 6 API with Redis] 4. API using Hashes Data Type 출처 : https://dotnetplaybook.com/redis-as-a-primary-database/ 이제까지 Strings Data Type만 사용하여 api를 구현하였다. structure objects를 저장하는데 Strings보다는 Hashes가 더 알맞다. Strings 1 to 1 mapping between Key and Value Set using SET Returned using GET Hashes 1 to multiple mapping between Key and Field / Value pairs Stores Field / Value pairs Set using HMSET Get all items using HGETALL Get individual items using HGET.. 2022. 5. 18. .NET 6 API with Redis] 3. Model , Repository, Controller구성 출처 : https://dotnetplaybook.com/redis-as-a-primary-database/ 1. Application architecture 2. Model Platform.cs using System.ComponentModel.DataAnnotations; namespace RedisAPI.Models { public class Platform { [Required] public string Id { get; set; } = $"platform:{Guid.NewGuid().ToString()}"; [Required] public string Name { get; set; } = string.Empty; } } 3. Repository IPlatformRepo.cs using Redis.. 2022. 5. 18. .NET 6 API with Redis] 2. docker를 사용해서 redis 컨테이너 구성 출처 : https://dotnetplaybook.com/redis-as-a-primary-database/ 개발환경 : Visual Studio Code, .NET 6.0 SDK, Docker 1. VSCode에서 ASP.NET Core Web API 템플릿을 선택하여 프로젝트를 생성한다. redis를 docker를 사용해서 세팅해보자. window에서 docker 설치방법은 아래 글을 참조하자. https://bigexecution.tistory.com/122 Windows 10] Docker Desktop 설치 Docker Desktop이란? Docker Desktop은 윈도우나 맥 환경에서 컨테이너화된 어플리케이션 또는 microservice를 생성할 수 있도록 해주는 설치 어플리케이션이다. Do.. 2022. 5. 18. .NET 6 API with Redis] 1. Redis란? 출처 : https://dotnetplaybook.com/redis-as-a-primary-database/ Redis란? Key / Value 데이터저장소 Caching 빠른성능 : 가볍고 단순한 구조, Key / Value 검색, In Memory Redis Data Type Strings Lists Hashes Sets Sorted Sets Caching 이란? 캐싱은 원본에서 가져와서 반환하는 것보다 더 빠르게 반환할 수 있는 데이터의 복사본을 만든다. 1. Server-side cache(Redis)가 없는 경우 Client App에서 API를 호출하고, API는 Database에서 데이터를 찾아서 반환한다. 2. Server-side cache(Redis)가 있는 경우 - Cache에서 원하는.. 2022. 5. 18. Windows 10] Docker Desktop 설치 Docker Desktop이란? Docker Desktop은 윈도우나 맥 환경에서 컨테이너화된 어플리케이션 또는 microservice를 생성할 수 있도록 해주는 설치 어플리케이션이다. Docker Desktop은 Docker Engine, Docker CLI client, Docker Compose, Docker Content Trust, Kubernetes, Credential Helper를 포함한다. Docker Desktop설치 1. Windows 버전 확인! Windows 10 64-bit: Pro 2004 (build 19041) or higher, or Enterprise or Education 1909 (build 18363) or higher. 2. Hyper-V + WSL2(option.. 2022. 5. 3. .NET 6] Hot Chocolate GraphQL : subscription(7) subscription은 real-time event notification이다. 해당 기능을 위해서, subscription은 web socket을 사용한다. request pipeline에 web socket을 추가 후, subscription을 build 해보자. 1. SubscriptionType 추가 Subscription.cs using BulkyBook.Models; namespace BulkyBook.GraphQL { public class Subscription { [Subscribe] [Topic] public Author OnAuthorAdded([EventMessage] Author author) => author; } } 2. request pipeline에 websoket 추가 .. 2022. 4. 19. 이전 1 ··· 32 33 34 35 36 37 38 ··· 51 다음 728x90 반응형