I thought I knew Redis, but I was wrong. Setup a database, then download Redis Insight and you'll see why bit.ly/3wnVsXA. Stay tuned for a full tutorial where we really put it to the test.
I always used redis as volatile key value storage, either cache or transitional data .. but I didn't knew you can actually use it as primary database... I will dig more into it. Thanks.
This is a channel I didn't know I needed. I am studying up on different cloud services and it's like drinking from a fire hydrant. When I have to get familiar with dozens of services, it's great to have the ability to get a brief overview just like it is done in this video. Thank you!
Fantastic as usual (you really make our content look bad next to yours Jeff haha) What I would add is redis achieves full durability through APF (append only file) journaling aka WAL or redo logs in other databases. The beauty here is you can configure how durable you want Redis to be which can give you more write performance. Full durability means every write synchronously writes to the AOF disk and only succeeds when that write to disk succeeds. Your writes are as fast as your AOF disk but you suffer no data loss in case of an outage. You can configure redis journaling to be asynchronously written every x second (minimum 1 second) which means writes are blazing fast (in memory). Every second the writes are buffered and asynchronously written to the AOF. However you could lose a second worth of data in case of an outage. So I am really interested to see how redis perform in full durability mode against other DBMS specially with indexes and concurrent transactions.
@@Fireship depends on the system don't you think, for a financial system or a system which heavily depends on data integrity, fast doesn't mean better, correct does.
“if you need relations then add graphs extension” I would love to see a video where you explain if it possible to swap a relation database with a graph database
I have to admit - whenever I'm trying to understand some fancy tech concept, like get a detailed overview of it, Fireship is the one-stop solution !! Amazing content 👏🏻👏🏻👏🏻
3 года назад+24
Your ability to produce quality content so fast is amazing
Your shorts are usually jokey but these videos really do a good job of explaining the main functionality of certain frameworks and concepts. Whether or not I'd use redis comes down to what project is being worked on. All projects I've worked on so far have never needed something more advanced than a regular mysql database. The thing is that people want more performance out of it yet I haven't come even close to the full potential by optimizing my queries properly and beyond that level of performance we're talking about completely different levels of scale
These videos are highly accessible and that’s why they blow up. Fireship should get a dedicated team with the express purpose of planning out these bite-sized videos… seriously. Have different “tiers” as well, like normie, beginner, and tech wizard videos.
@@JariNestel true but like one of the answers says you can snapshot the data and save its indexes in redis. However that will make it behave like a normal relational database but will solve the problem. Yeah otherwise you're right TBs of ram is unrealistic and undesirable.
@@JariNestel Additionally, if you run out of RAM, Redis just starts ejecting data with no regard to its meaning or context. Seems like a pretty terrible primary database, TBH.
Been using Redis for many years, and NEVER did I think to use it for more than just a basic message bus or cache store... Thank you for opening my eyes!
I use Redis as my primary to reduce complexity but I think it's a preference thing. I don't like queries and procedures so it's better for my sanity just to fetch and parse the data.
Not just preference. Apples, oranges. Google for ACID vs BASE. (right tool) => right job. Also HA/FT is not " "guaranteed" by Redis snapshots || "transaction logs" (or even combined) in Redis as opposed to oldskool SQL-like BASE platforms. It is with transaction logs, but takes a hell lot of time to recover. Devil is in the details. (the 101th second and onwards...) Check out AWS ElastiCache reference. (yes it's managed, but still) It does however cope with HA/FT via replication in an excellent way! Redis is wonderful for a given set of challenges, "traditional" SQL (or SQL-like) engines are perfect for other types of problems etc.
I am contemplating using redis as a primary store but is discouraged by the small amount of people using redis as a primary store. What are the caveats or gotchas involved in this?
@@MrSMGun it's basically a key-value storage. You can store binary data, strings, lists and sets. It's flat so you have to emulate depth with fake paths in key strings or double keying by making one value a list of id's of other values that are part of a single group.
I have learnt a lot of new things that I have never worked with from your videos, like AWS, nginx, kubernetes, graphQL(and other dbs), typescript to name a few. One thing that I don't understand is how they work together. I would really love to see a video where you design a mock system using all of these (and possibly more) and explain each of their roles and why you chose it (kinda like your reverse-cloud migration video using raspberry pi). Whenever I think of a software architecture I think of them as several layers that interact with each other. However, I am unable to assign which layer what belongs to by watching a stand alone tutorial about a single tool. Btw, I am a college senior pursuing CS major and I love your content. Thanks for all the awesome contents.
For me personally, the possibility to use Redis as a very easy message broker is more interesting. But as always, your 100 seconds of... videos are awesome!
I was lucky enough to have used Redis in my previous job (a bit more than two years) and its awesome. The only problem I see with using Redis is the use of third-party libraries to connect with it.
I implemented using Redis on our backend on a pretty basic level and I will say that it was pretty easy it’s a little tricky sometimes if you wanna filter through data to the user but you can’t argue with how fast it is
I lurve me some Redis. It's been my favorite DB since 2011. However, using it as your primary database is only a good idea when you can afford to lose the last few seconds of data in the event of a container or service failure since write ACKs do not wait for a memory to disk write to complete.
I would (and have) use redis as primary database for the application or microservice but would still have a persisting database in the background that could reinstantiate the state to redis if need be.
I use "Redis" while talking to FE team and other developers, to "Show off", as I won't tell my friends that I own top varient of Iphone but surely tell them that what 'sekcy' tech I use, thanks for making these videos as summarized...
I would use Redis in “client side apps” as support until the final commit. For example, eletronic health records are extremelly complex and a patient’s single day events involve hundreds or thousands of structured and unstructured data. Having a malleable and simpler “first” line in memory/client hd dbms can help to deal with the persistence design at server side, to reduce data volume exchanges during the process. Won’t use it for big data analytics or to deal with higher data security needs.
haha this video will have caused a lot of people a lot of headache in a few years. No single tool can make your app magically faster. It's about system design and using the right tools in the right places. Stay safe out there
If you use Redis as your primary database you probably want it to be durable. By default Redis only fsyncs every second. In conclusion this means you have to configure Redis to fsync to disk synchronously with each request, which will hurt performance significantly or have to tell your application developers that one second of acknowledged writes could be lost.. Redis is also primarily single threaded (I know that Redis forks for snapshots and log rewrites etc. and that there is multi threading since Redis 6 "I/O threading" but this implementation is so bad lets pretend it doesn’t exist…) So if you really want to scale Redis you have to go for a Redis Cluster.
I love your 100 seconds videos! I watch and like them all, hoping to help you beat the RUclips recommendation algorithm and make these wonderful short videos show up as suggested videos for other folks. Now have a great day, and keep up the good work!
Awesome!!!!!! The best short explanation about Redis. Good to know about Redis as the primary database is an option on the table (is not a SQL joke but it could be hahaha). Depending on the use case can and cost relation it can be really great. The Radisson and RedisGraph look very interesting to me.
You didnt even touch on redis pub/sub which is by far the best feature. Redis saved my project at least 3 times over, when i comes to scaling. Every dev should know how to use this. I cant recommend it enough
I see that it's possible to use redis as a primary database, but migrating a legacy system built on a traditional relational database to redis is an absolute no-go.
I thought I knew redis. But I only knew about the key-value store. Never seen the JSON or Search functionality. Definitely gonna try that after seeing this video. Thanks a lot, and I'd love to see more about redis
i am thinking of using as a primary database. I did not see a ton of feedback on it's usage on a production env as a primary database. What are some of the caveats or gotchas for using it over a rdbms or mongo?
As primary DB no,especially if there is need for strong persistence guarantees ( between ram & disk ), also not sure how easily is it to scale and synchronise across multiple machines / disks . Enterprise DBs eg oracle) sells both very highly priced. For small personal projects everything works, but production systems are not easy to experiment with in small teams .Amazing video though.
Hey Fireship. I use Redis and love this approach. I love all your content and never miss a video💙. I have a request, could you do one for Rethink DB and probably one about deploying a running container instance. Appreciate it. Thanks for all the content, I have grown as a developer watching your channel ❤️. Cheers.
Depends on what you want to do. But you can write to your cache and database and then check your cache to read values and fallback to your database if it doesn't exist in the cache. You can also batch queries to your database.
I use redis as a cache for stuff I don't want to persist but want my code to have fast access to. I use it as a queue and cache for sharing data between our nodes responsible for processing it. I also use it to cache results of expensive but fairly frequent queries.
The drawback of using redis is of course, it uses RAM persistently and my goodie ol machine can't handle it. But once you are already setup, it is just so good when on production that it makes me cry.
I've used redis in production before, the first problem is always "do you need it" it not just fast database as I thought, turned out we didn't need redis.
Some functionality I moved to Postgresql and store data into the unlogged table (create unlogged table if not exists ). If Postgresql will be restarted all data will be lost. But it is OK for my architecture.
I thought I knew Redis, but I was wrong. Setup a database, then download Redis Insight and you'll see why bit.ly/3wnVsXA. Stay tuned for a full tutorial where we really put it to the test.
let's go i'll finally have a reason to learn redis if you explain it :D
I get what you are saying. It is just a lot of work upfront to set an excellent caching system.
I thought I knew Redis, but I was wrong too! I never knew it was acronym for Remote Dictionary Server 🔥
I always used redis as volatile key value storage, either cache or transitional data .. but I didn't knew you can actually use it as primary database... I will dig more into it. Thanks.
you learn wayy faster
This is a channel I didn't know I needed. I am studying up on different cloud services and it's like drinking from a fire hydrant. When I have to get familiar with dozens of services, it's great to have the ability to get a brief overview just like it is done in this video. Thank you!
100 seconds! That's all the attention span I have
nice
i forgot what i was going to say
Kinda sad
@@thedragonrises6882 what do you mean kinda
@@gubocci I mean it could've been 30secs like most of the morons on social media nowadays but atleast OP is on 100secs for now.
I got less. Got lost in the middle of the video.
Fantastic as usual (you really make our content look bad next to yours Jeff haha)
What I would add is redis achieves full durability through APF (append only file) journaling aka WAL or redo logs in other databases.
The beauty here is you can configure how durable you want Redis to be which can give you more write performance. Full durability means every write synchronously writes to the AOF disk and only succeeds when that write to disk succeeds. Your writes are as fast as your AOF disk but you suffer no data loss in case of an outage.
You can configure redis journaling to be asynchronously written every x second (minimum 1 second) which means writes are blazing fast (in memory). Every second the writes are buffered and asynchronously written to the AOF. However you could lose a second worth of data in case of an outage.
So I am really interested to see how redis perform in full durability mode against other DBMS specially with indexes and concurrent transactions.
Love your content as well, bro ♥️
Love your content... Because of you I have learned a lot... Thanks for sharing your valuable time and knowledge man
Interesting, I'll roll the dice and take performance over reliability.
@@Fireship depends on the system don't you think, for a financial system or a system which heavily depends on data integrity, fast doesn't mean better, correct does.
Jeff always using background music, maybe you should consider about that in your future video
As a computer science student, I start from your channel whenever I have to study a different topic. Thanks for the excellent short content.🙏
The animation at 2:16 was kinda cool
@Ishtiaque A Walid that was too easy to type so I figured..
Probably made in Adobe After Effects
@@_timestamp I was hoping it was a css keyframes anim
Redis in 100 Seconds
Me: "pfff... I already know reddis. I bet there is nothing I'll learn"
@0:19:
Me: "I've already failed"
same, mindblown!
Seems you didn't even know how to spell it. :D
“if you need relations then add graphs extension” I would love to see a video where you explain if it possible to swap a relation database with a graph database
Want to see this too. Because now, it seems like to use a cow instead of a horse in a wagon. You maybe can, but why?
Neo4j
@@assorium exactly, that's a very good analogy.
Graph databases are awesome I’m working with one right now for a project. And seeing that redis now includes one as an option I’m sold!!
and since neo4j just launched a graphdb.....
You just totally changed my understanding of Redis at 1 AM. Excellent video.
It is closed source for future updates now
It's not open source but instead "source-available"
Incredible. This is by far the most clear and concise explanation of Redis I've ever heard
I have to admit - whenever I'm trying to understand some fancy tech concept, like get a detailed overview of it, Fireship is the one-stop solution !! Amazing content 👏🏻👏🏻👏🏻
Your ability to produce quality content so fast is amazing
That animated intro 😍
I can't say no to a tech video that teaches me something valuable in only 100 seconds.
Salvatore Sanfilippo is one of the many reasons why I'm proud of being Italian (he comes just after the pizza)
And football?
hope you guys win on sunday.
You won!!!!
Your shorts are usually jokey but these videos really do a good job of explaining the main functionality of certain frameworks and concepts. Whether or not I'd use redis comes down to what project is being worked on. All projects I've worked on so far have never needed something more advanced than a regular mysql database. The thing is that people want more performance out of it yet I haven't come even close to the full potential by optimizing my queries properly and beyond that level of performance we're talking about completely different levels of scale
These videos are highly accessible and that’s why they blow up. Fireship should get a dedicated team with the express purpose of planning out these bite-sized videos… seriously.
Have different “tiers” as well, like normie, beginner, and tech wizard videos.
Honestly you have such a gift, I don’t even think redis themselves could come up with a better commercial
I have setup Redis as cluster with 6 nodes. ✌
@Chris Habgood spoilers, it is, but once you set it up correctly you’re good to go
@Chris Habgood no as of now no such issue. Just we need to follow proper configuration
Why you need many nodes? I thought it was scalable to couple of GBs easily? I don't think you're having >300GB dataset?
@@dr.z7958 why wouldn’t he?
@@dr.z7958 master slave architecture for failover. 3 master nodes and 3 slave nodes.
The idea of Redis as primary database terrifies me 😬
Always fast database sounds too good to be true tho
Me too, especially as I don't see it scaling into the TB region at all, though as temporary storage it proofed itself to be the better solution.
@@JariNestel You don't see it scaling into TB/PB region because you have this "feeling" or you some proof/ actual implementation issues?
@@JariNestel true but like one of the answers says you can snapshot the data and save its indexes in redis. However that will make it behave like a normal relational database but will solve the problem. Yeah otherwise you're right TBs of ram is unrealistic and undesirable.
@@JariNestel Additionally, if you run out of RAM, Redis just starts ejecting data with no regard to its meaning or context. Seems like a pretty terrible primary database, TBH.
@@ShaneTheKing you have full control over what eviction policy is used, which can be disabled all together if you want.
Been using Redis for many years, and NEVER did I think to use it for more than just a basic message bus or cache store... Thank you for opening my eyes!
I use Redis as my primary to reduce complexity but I think it's a preference thing. I don't like queries and procedures so it's better for my sanity just to fetch and parse the data.
Not just preference. Apples, oranges. Google for ACID vs BASE. (right tool) => right job. Also HA/FT is not "
"guaranteed" by Redis snapshots || "transaction logs" (or even combined) in Redis as opposed to oldskool SQL-like BASE platforms. It is with transaction logs, but takes a hell lot of time to recover. Devil is in the details. (the 101th second and onwards...)
Check out AWS ElastiCache reference. (yes it's managed, but still) It does however cope with HA/FT via replication in an excellent way! Redis is wonderful for a given set of challenges, "traditional" SQL (or SQL-like) engines are perfect for other types of problems etc.
I am contemplating using redis as a primary store but is discouraged by the small amount of people using redis as a primary store. What are the caveats or gotchas involved in this?
@@MrSMGun it's basically a key-value storage. You can store binary data, strings, lists and sets. It's flat so you have to emulate depth with fake paths in key strings or double keying by making one value a list of id's of other values that are part of a single group.
Thanks for making it in dark background.
I am using it as a cache memory for news sites; the primary database is PostgreSQL
What is your backend Framework
I have learnt a lot of new things that I have never worked with from your videos, like AWS, nginx, kubernetes, graphQL(and other dbs), typescript to name a few. One thing that I don't understand is how they work together. I would really love to see a video where you design a mock system using all of these (and possibly more) and explain each of their roles and why you chose it (kinda like your reverse-cloud migration video using raspberry pi).
Whenever I think of a software architecture I think of them as several layers that interact with each other. However, I am unable to assign which layer what belongs to by watching a stand alone tutorial about a single tool.
Btw, I am a college senior pursuing CS major and I love your content. Thanks for all the awesome contents.
look up "system design"
For me personally, the possibility to use Redis as a very easy message broker is more interesting. But as always, your 100 seconds of... videos are awesome!
Redis is still somehow one of the most underrated tools on the web
I was lucky enough to have used Redis in my previous job (a bit more than two years) and its awesome. The only problem I see with using Redis is the use of third-party libraries to connect with it.
100 seconds of Cassandra / Scylla. Keep up the good work!
this is the best first approach someone can get to more in depth knowledge
managing Redis at scale is a challenge.. since you mentioned Redislabs, running the database on Redislabs also removes scale headaches!
You've mastered the youtube viewer attention span. "Redis in 5 minutes" would get very little interest. But a minute and a half? Yeah I can spare that
I implemented using Redis on our backend on a pretty basic level and I will say that it was pretty easy it’s a little tricky sometimes if you wanna filter through data to the user but you can’t argue with how fast it is
I was just studying this! I also read that redis can serve as a pub/sub mechanism replacing your usual queue tech (for example SQS)
Google Sheet with Sheet API & Google script is the only database I'm ever going to use...
I have only used redis to store session and such but this makes me wanna expand upon it. Thank you!!
Now repeat this 100 seconds video 10 more times. I love this channel. Thanks Jeff
Other channel :- "speed up the video"
Fireship:- "Decrease the speed" 😂
I like your 100 second video Jeff. I always make sure that I watch your video each day.
These short videos are very addictive.
I lurve me some Redis. It's been my favorite DB since 2011. However, using it as your primary database is only a good idea when you can afford to lose the last few seconds of data in the event of a container or service failure since write ACKs do not wait for a memory to disk write to complete.
Haven't worked with Reddis for a long time. "Reddis as the main db" is an interesting concept..
Thanks
I would (and have) use redis as primary database for the application or microservice but would still have a persisting database in the background that could reinstantiate the state to redis if need be.
I love your 100 seconds stuff!!! 🔥
nice straight forward 'no nonsense' video. Thanks a lot for these!
My Access Database for my website of 5,000,000 users is just fine thank you.
Now, off to figure out why people are complaining about it being slow. 😁
Wow never thought of using redis as primary database. Thanks a lot
I use "Redis" while talking to FE team and other developers, to "Show off", as I won't tell my friends that I own top varient of Iphone but surely tell them that what 'sekcy' tech I use,
thanks for making these videos as summarized...
This is the channel every single software engineer need, I thought I knew Redis... now I know that I know nothing
I would use Redis in “client side apps” as support until the final commit. For example, eletronic health records are extremelly complex and a patient’s single day events involve hundreds or thousands of structured and unstructured data. Having a malleable and simpler “first” line in memory/client hd dbms can help to deal with the persistence design at server side, to reduce data volume exchanges during the process. Won’t use it for big data analytics or to deal with higher data security needs.
haha this video will have caused a lot of people a lot of headache in a few years. No single tool can make your app magically faster. It's about system design and using the right tools in the right places. Stay safe out there
If you use Redis as your primary database you probably want it to be durable. By default Redis only fsyncs every second. In conclusion this means you have to configure Redis to fsync to disk synchronously with each request, which will hurt performance significantly or have to tell your application developers that one second of acknowledged writes could be lost.. Redis is also primarily single threaded (I know that Redis forks for snapshots and log rewrites etc. and that there is multi threading since Redis 6 "I/O threading" but this implementation is so bad lets pretend it doesn’t exist…) So if you really want to scale Redis you have to go for a Redis Cluster.
I love your 100 seconds videos!
I watch and like them all, hoping to help you beat the RUclips recommendation algorithm and make these wonderful short videos show up as suggested videos for other folks.
Now have a great day, and keep up the good work!
Got an email from Redis Lab today featuring this video!
Its excellent for syncing the data from your relational database and serving your get requests through it
in the last 5 years redis has grown pretty neat. did relational redis on application level with lua scripting on redis in 2015 using a php app :)
Best fucking explanation I've seen on Redis for a very long time
have been using redis for Queue tasks without knowing all of this ! thanks for letting me know this
These kind of videos are what I need when I have to install software as prerequisites for a project and I want to know what they are.
I am a beginner in the backend programming field and am about to choose a database system for my portfolio. Redis and MySQL seem quite good.
We are using Redis primarily for storing data that are often required from backend. Can Redis also be used as a message broker?
Indeed, message broker and kafka-like streams are common use cases.
What is your backend Framework
If you want something similar to SQS but where you can also delete any message by id, RSMQ is a pretty decent nodejs library to make your life easier
Awesome!!!!!!
The best short explanation about Redis. Good to know about Redis as the primary database is an option on the table (is not a SQL joke but it could be hahaha).
Depending on the use case can and cost relation it can be really great.
The Radisson and RedisGraph look very interesting to me.
Too be honest before this video I thought of redis as a fast simple key-value cache... might have to rethink
Same, didn't realize they had extensions like RedisGraph.
Well technically you're not wrong, but you can do anything with a bit of hash map.
Key-value store, pub-sub, streams, and all the add ons...
You didnt even touch on redis pub/sub which is by far the best feature.
Redis saved my project at least 3 times over, when i comes to scaling. Every dev should know how to use this. I cant recommend it enough
Broo I just learn Redis today from bootcamp, then your video just came up 😳😳
I see that it's possible to use redis as a primary database, but migrating a legacy system built on a traditional relational database to redis is an absolute no-go.
Has someone else started skipping the video backward at the start? sounds pretty good. Great video btw
I thought I knew redis. But I only knew about the key-value store. Never seen the JSON or Search functionality. Definitely gonna try that after seeing this video. Thanks a lot, and I'd love to see more about redis
this aged well
Agreed
what happened?
@@kairavb License shenanigans
I would use Redis as a primary database because it is *SUPER* fast.
I use redis as a primary database. Great for handling tons of concurrent writes and reads.
i am thinking of using as a primary database. I did not see a ton of feedback on it's usage on a production env as a primary database. What are some of the caveats or gotchas for using it over a rdbms or mongo?
Oh damn I was using Redis the traditional way for a long time I didn't know how much it evolved!
I'd like to see a video on etcd. Not only is it a powerful key-value store, but understanding how it uses the raft algorithm in a cluster is amazing.
This has made me pretty excited about a DB. It seems super scary keeping it in memory though!
As primary DB no,especially if there is need for strong persistence guarantees ( between ram & disk ), also not sure how easily is it to scale and synchronise across multiple machines / disks . Enterprise DBs eg oracle) sells both very highly priced. For small personal projects everything works, but production systems are not easy to experiment with in small teams .Amazing video though.
"you will get your answer when you upload damn tutorial" - Bully Maguire
Redis stream is also an awesome feature for realtime applications and realtime analytics.
Though you have explained so much but its only brought down to storing key:value pair!
Hey Fireship. I use Redis and love this approach. I love all your content and never miss a video💙. I have a request, could you do one for Rethink DB and probably one about deploying a running container instance. Appreciate it. Thanks for all the content, I have grown as a developer watching your channel ❤️.
Cheers.
How do you use both a relational database (postgreSQL for example) and redis in the same website?
Depends on what you want to do. But you can write to your cache and database and then check your cache to read values and fallback to your database if it doesn't exist in the cache. You can also batch queries to your database.
I use redis as a cache for stuff I don't want to persist but want my code to have fast access to.
I use it as a queue and cache for sharing data between our nodes responsible for processing it.
I also use it to cache results of expensive but fairly frequent queries.
From today I will see redis from a different angle
I was waiting for this video for long! Thank you Jeff!
Never thought Redis could serve as a primary DB
I would use Redis as primary database in some cases but also not in some other cases.
It really just depends on the needs for me...
Now I know why Redis is always the most wanted technology on those Stack Overflow annual surveys
1:20 did anyone else see that blur?
Nope
Wow, I was about to integrate redis into my stack to speed up mongodb. But now I'm thinking of dropping the mongodb part.
The drawback of using redis is of course, it uses RAM persistently and my goodie ol machine can't handle it. But once you are already setup, it is just so good when on production that it makes me cry.
Comparing Redis to SQL is like comparing Bicycle to Train, It won't be much useful beyond basic caching and simple models.
The other thing are queries, maybe executing searches in redis is harder than in a traditional database engine. Specially when the data set is larger.
Good video. Please make one on JSDocs too.
Boom so redis can help you get and set data as fast as possible
being persistent is the key. and redis is just crash away from truncate. Only good for caching. managed redis is much more expensive.
Are you available for freelance work for startups?
I've used redis in production before, the first problem is always "do you need it" it not just fast database as I thought, turned out we didn't need redis.
NATS in 100 sec please. Awesome series :)
Ultimate explanation in shot period
Nice explanation in short time, thanks!
I was literally setting up redis as a session storage yesterday. That's some spooky timing for this video.
Some functionality I moved to Postgresql and store data into the unlogged table (create unlogged table if not exists ). If Postgresql will be restarted all data will be lost. But it is OK for my architecture.