i was really confused about this sharding and config server, now i see they are all different instances and connected using mongo router and state of data is managed by config servers, big thanks man, very good playlist too, it also has kubernetes, i was really unsure of picking mongodb, for a family project because of deployment, deployment itself isn't an issue but i wanted to be prepared for an unlikely situation that i would need to scale it,
Hi Daniel, thanks for watching this video. That's an interesting topic which I am yet to explore. I will look into it and record a video. Thanks for suggesting this topic. Cheers.
Thank You for this tutorial! Great stuff. Do all the shards hold the entire data similar to the replica-set configuration? To be more precise when data is written to one shard will it be replicated into all the other shards. This will be the ideal set up for my production environment as I want to deploy my shards in a multi-cloud environment and if the communication is down between the two environments I still want my application to be able to write to the database.
Hi Varun, it is not like a replicaset. Individual shard is a replicaset of its own. So within a shard the data is available and in sync with all the replicas. But each shard is different. They don't hold the same data. Data are stored in chunks. For example, if you set chunk size to 100MB, then first chunk of 100MB will be written to shard1 and next chunk of 100MB will be written to shard2 and so on. Config servers are the ones that hold metadata about which shard contains which data. Sharding is for scaling purpose not for redundancy.
Hello, great tutorial! Question Please -> What do we do if we have each of our config servers running in their OWN Host Environment? Do we run 1 docker container for each config server in each host environment? ... In your video you just launched all 3 containers for a 3-replica set in the same environment. I am trying to understand/implement a real-world model. Thank you!
Awesome playlist! Just wanted to ask, when connecting to your container instance, is using mongodb://192.168.1.81:40001 the same as mongodb://localhost:40001?
Hi Justin, thanks for watching. It depends on from where you are running this command. In this video, 192.168.1.81 was my Linux workstation. If I were to connect to mongo instances from my linux workstation, I can either use 192.168.1.81 or localhost. But if you were to connect from another container or a different machine, then you will have to use the ip address.
I am getting this error "No host described in new configuration with {version: 1, term: 0} for replica set cfgrs maps to this node" once I initiate instances of mongodb as replica set using rs.initiate
Failed to connect to localhost:60000, in(checking socket for error after poll), reason: Connection refused, Getting this error on trying to connect to Mongos, thanks in advance.
Thanks for this very understandable video !! I would simply like to know if there is a way to automate the config (rs.initiate especially), as such deployment could be from a CI/CD pipeline Best regards
Great video as always! 👍 Need some advice: 🙏 I only have these words 🤔. (behave today finger ski upon boy assault summer exhaust beauty stereo over). I don't know what they are. What should I do with them? 🤷♀️
I can't initialite the replica set, when I use rs.initiate( ... { ... _id: "cfgrs", ... configsvr: true, ... members: [ ... { _id : 0, host : "127.0.0.1:40001" }, ... { _id : 1, host : "127.0.0.1:40002" }, ... { _id : 2, host : "127.0.0.1:40003" } ... ] ... } ... ) I just get No host described in new configuration 1 for replica set cfgrs maps to this node is there anything else I haven't done??
@@grahftheseeker Glad that you managed to resolve it. Good job. Sorry I didn't get a chance to reply to your original comment. I thought I did. cheers.
Hi Theara, thanks for watching this video. The ideal setup in production scenarios would be to run each mongo instance in its own server. For example, config servers with 3 replicaset would be run on 3 different servers. And a shard with 3 replicaset would be run on 3 different servers. There is no point in running two mongo instances in one server. If the server crashes, it would take down the 2 mongo instances. So one mongo instance per server. But in your case if you are doing it for learning pupose, you can just put all the instances in one droplet or split between two droplets. Both your option 1 and 2 would work just fine. Cheers.
Please send more details about your problem. If you followed every step exactly as shown in this video, you would'nt have problem accessing the shared. You must have deviated from the steps somewhere.
hello sir, thank you, yes its possible i missed or made erros but anyway if you check your issues tab in the learn-mongodb repo on github i posted how i completed the process..thxz alot Lisa
hello instead of mongo mongodb://192.168.1.81:40001 to connect to a mongo instance , only this work ed for me so far, docker exec -it cfgsvr1 mongo is it the same effect? Lisa
@@justmeandopensource hello sir, and thank you for your vids and reply but i dont get your answer , well i mean i understand mongos is for read/write but i was not able to connect to mongos and you can check my posts in your github issues as i was only able to complete the process of sharding with the merge and configyuration from another lesson online thxz Lisa
@@justmeandopensource hello , yes i know but i tried all my IP addresses when i did ipconfig at the cmd prompt and it never worked , only when i put the cluster name it worked, i got that from another lesson online, which i dont understand usally localhost works as input for this..i dont know Lisa thaz alot
Hi I am new to your channel. I am facing a problem whether I should go for many to many relationships with momgodb. Should I make a collection for follow and following like a social media site
Hi Jivan, I am not entirely sure in what context you are asking this question. I won't be able to answer without the complete picture. Moreover, I am from ops background and don't rely on me on the app/db design implementations.
Hi Chinmay, thanks for watching. You normally get this error when the hosts can't communicate with each other. I am not sure in which environment you are deploying these replica members. Whether on AWS, DIgital Ocean or other cloud providers or on-prem. But you need to make sure that each member (host) of the replicaset can communicate with each other. So if there is a firewall, just open all the ports between these hosts.
@@RishinderRana Hi, thanks for watching. Could you please post the commands you used to start the replicasets, initiate the replicaset and other useful error to pastebin.com and share the details. Thanks.
@@justmeandopensource Here's the link to the paste: pastebin.com/RHARJVKJ. I cloned your repository and made some changes to it, so it's quite similar.
Hi Theara, thanks for watching this video. I am going to do few videos around backup and restore of mongodb shards. You will get a notification when I upload videos to this series if you have subscribed to my channel. Cheers.
How much `Server machine` (At least), If I tried to create 3 configs, 3 sharding (Each a shard has 3 member replica set)? For example I tried to create: - 3 Config Server - 3 Sharding (Each a 3 member replica set) ----------------------- My Structure with 3 Server on Digital Dropletes - Droplet 1: cfgsvr1, shard1svr1, shard2svr1, shard3svr1 - Droplet 2: cfgsvr2, shard1svr2, shard2svr2, shard3svr2 - Droplet 3: cfgsvr3, shard1svr3, shard2svr3, shard3svr3 Please advise...
Hi Theara, I would have gone with the same structure as you have. Perfectly designed. Spreading the config servers among 3 droplets and spreading each member of each shard among 3 droplets. This is a perfect scenario. If you had put all 3 config servers in a single droplet, that is single point of failure. Similarly if you had put all replicas of a shard in a single droplet, again single point of failure. What you have is a good architecture. Thanks.
About choosing the shard key, I haven't paid much attention to it as I am doing basic stuff. But its a separate topic and you have to go through some documentations from MongoDB. Cheers.
... would be great if you were to redo this deployment onto a K8s (instead of docker) environment. ... maybe using k3d as a local lab environment where you can simulate a multi node cluster.
hello i am trying to run your software exactly as written just i want to try on different actual machiens and so i am on a vbox on my 1st machine ubuntu18 and on vmare on my 2nd machine and so from 1st machine i tried to connect sudo mongo mongodb//(my ip address of 2nd machine in vmare which has bridged hosting and also bridged on 1st) but i get connection refused i tried ssh from 1st machine in 2nd machine and it works so why i cant connect with your code? i am using virutal ubuntu machines on windows mchine so i can follow directly ok thank you Lisa
it seems i need to add the ip address in the yaml file , here is the commad syntax direct from mongo website but i find it confusing would you know how to actually enter the info not just sample? from mongo website: mongod --configsvr --replSet --dbpath --bind_ip localhost, so would this be good? mongod --configsvr --replSet repli1 --dbpath /data/db --bind_ip localhost,localhost |192.168.88.1 --port 27017 thxz alot
this works mongod --configsvr --replSet mongors1conf --dbpath /data/db --bind_ip localhost,192.168.x.x --port 27017 i put x x as example for my 1st machine ip address but the ip address only connects on the starting machine not the remote 2nd machine i still cant connect it says The requested address is not valid in its context. not sure why Lisa
hello i was actually running the sytnax on my win cmd line so i ran it now from Vbox linux cmd line and i have vbox on my 2nd machine and i ran this cmd syntax from 1st machine mongod --configsvr --replSet mongors1conf --dbpath /data/db --bind_ip 0.0.0.0,192.168.x.x --port 27017 so i change bindIp to 0 so its open to all, but now i get addrss already in use error and i tried many dofferent Ip address...very complex not sure why if it has to do with ssh but i can ssh already i tried it works so i dont know what im doing in error also not sure if i have change host file and hostname file that would be really complex and alot of work not sure why thxz anyway..i am looking at vids that deploy shards directly on aws atlal mongo or cloud G or azure or diitgiot ocen or 1and 1 etc cloud providers since that is the ultimate prurpose to deploy on the web on physical servers for production evirmnet thank you Lisa
Hi @Just me and Opensource, Mongodb strategy for Multi-Company Web App? I tried to build POS System that will be running on cloud. Each user must belong to a Company. Each Company can only access it’s own data. Each user can access it’s own data and some data shared with other users of the same company. Imagine 100 companies (Only my countries) and 100 users per company , it could get very bad in performance and secutiry, if I use 1 Mongodb database for whole app. I think I can define 100 dbs, lets say db_0001 , db_0002 , … with same name collections, so the app can be efficient and more secure. but It is difficult to manage. OR we could use `Mongo Sharding`? Please advise and share!
Hi Theara, Sharding is basically splitting your data across multiple mongodb instances. Mongodb is extremely scalable. That is one of its main selling point. SO you don't have to worry about your databases growing big. You can have a database for each of your company and you can have the same collection name as long as it is in its own database. It all depends on your architecture and design. No single solution. My videos are to provide some basic ideas and concepts to getting started with MongoDB and Sharding. You will have to design an appropriate solution for your needs. Thanks.
@@justmeandopensource So it mean that we could use only one database for all companies register. Some time I think to use one database for on company. but can't do, because don't understand how to use dynamic db connection on `Meteor, Mongo`.
@@yuomtheara For production large scale deployments you can go with Mongo Cloud for easy adinistration and for support. Otherwise you can manage it on your own. Thanks.
@@justmeandopensource It mean that I would to connect to `local` database name in Sharding Example for Standalone DB `MONGO_OPLOG_URL: 'mongodb://mongodb/local'`
Your videos are the best. I have a question regarding authentication in a sharded environment, where do I have to setup the superuser? In the mongos, in the config or in the mongod? Also, if I have a collection in mongod and if I want a user just to read it, do I have to set it up in the mongod?
plz check your github repo i was able to start config servers connect , i was able to strat shrd1 cluster connect but i cant connect to mongos thxz Lisa...i posted issue
hello thank you for the vids , i am now trying to deploy this on 3 physical machines computers instead of 1 physical machine with 3 ports , do i replace the inputs for the ssh IP address of each physical machine computer?..also i would then want to deploy this online like i guess mongo atlas with a remote server like i guess aws or heroku..do you have a lesson for this vid or written?,,thxz alot sir Lisa
If you want to run the mongodb processes as docker containers on the three physical machines, update the docker compose accordingly to include the ip address of physical machines and use the standard 27017 port.
Thanks for the Video, it is clear explanation on csrs and the relation to the sharding
@@rajan1172 Thanks for watching.
i was really confused about this sharding and config server, now i see they are all different instances and connected using mongo router and state of data is managed by config servers, big thanks man, very good playlist too, it also has kubernetes, i was really unsure of picking mongodb, for a family project because of deployment, deployment itself isn't an issue but i wanted to be prepared for an unlikely situation that i would need to scale it,
Hi Neelu, thanks for watching. Cheers.
@@justmeandopensource also i wont have to re-initiate replicaset after restarting server right,
Thank you so much, nice explanation with practical experience.
Hi Sandesh, thanks for watching.
very nice one keep it up
Hi Shubham, thanks for watching. Cheers.
Hi , Very nice explanation. Your videos are helping a lot
Hi Krishna, thanks for watching.
Thank you!!! The best video on sharding implementation
Hi Adil, thanks for watching.
Thanks for making this video!!! Keep it up
Hi Umar, thanks for watching this video. Cheers.
Top content . Thanks for the effort
Hi Nikola. thanks for watching. Cheers.
Thank you so much ! i loved this guides :D U explain so clear :)
Hi Ezequiel, thanks for watching. I have few more videos planned and probably will be releasing in the coming weeks.
I just went through it. Great stuff
Thanks for watching.
Good video sir..thank you
Hi Shyam, thanks for watching.
Awesome vedio...great stuff......
Hi Suvajit, thanks for watching. Cheers.
Thanks man! Well said and done!
Hi Fernand, thanks for watching.
thank you ,very clear explanation about sharding!.
Thanks for watching Gurdeep.
Thank you for making this video. Hope you can also do a video on backing up and restoring a sharded cluster using mongotools or via snapshots.
Hi Daniel, thanks for watching this video. That's an interesting topic which I am yet to explore. I will look into it and record a video. Thanks for suggesting this topic. Cheers.
Great tutorial!
Great video, thank you!!!
Thanks for watching. Cheers.
sir i have used local host instead of ip everywhere but at the last step i am facing error to go inside mongos to connect it to shards
Thank You for this tutorial! Great stuff. Do all the shards hold the entire data similar to the replica-set configuration? To be more precise when data is written to one shard will it be replicated into all the other shards. This will be the ideal set up for my production environment as I want to deploy my shards in a multi-cloud environment and if the communication is down between the two environments I still want my application to be able to write to the database.
Hi Varun, it is not like a replicaset. Individual shard is a replicaset of its own. So within a shard the data is available and in sync with all the replicas. But each shard is different. They don't hold the same data. Data are stored in chunks. For example, if you set chunk size to 100MB, then first chunk of 100MB will be written to shard1 and next chunk of 100MB will be written to shard2 and so on.
Config servers are the ones that hold metadata about which shard contains which data. Sharding is for scaling purpose not for redundancy.
Hi Venkat...Request you to make a video on setting up sharding in mongodb on kubernetes cluster..Thanks & Cheers!!
Hello, great tutorial! Question Please -> What do we do if we have each of our config servers running in their OWN Host Environment? Do we run 1 docker container for each config server in each host environment? ... In your video you just launched all 3 containers for a 3-replica set in the same environment. I am trying to understand/implement a real-world model. Thank you!
Awesome playlist! Just wanted to ask, when connecting to your container instance, is using mongodb://192.168.1.81:40001 the same as mongodb://localhost:40001?
Hi Justin, thanks for watching.
It depends on from where you are running this command. In this video, 192.168.1.81 was my Linux workstation. If I were to connect to mongo instances from my linux workstation, I can either use 192.168.1.81 or localhost. But if you were to connect from another container or a different machine, then you will have to use the ip address.
I am getting this error "No host described in new configuration with {version: 1, term: 0} for replica set cfgrs maps to this node" once I initiate instances of mongodb as replica set using rs.initiate
How can we specify shard key? Or what is the sharding criteria in this example?
Failed to connect to localhost:60000, in(checking socket for error after poll), reason: Connection refused,
Getting this error on trying to connect to Mongos, thanks in advance.
Is it compulsory to deploy shard as a replica set or can just have one primary node, no slaves?
Thanks for this very understandable video !! I would simply like to know if there is a way to automate the config (rs.initiate especially), as such deployment could be from a CI/CD pipeline
Best regards
Great video as always! 👍 Need some advice: 🙏 I only have these words 🤔. (behave today finger ski upon boy assault summer exhaust beauty stereo over). I don't know what they are. What should I do with them? 🤷♀️
I can't initialite the replica set, when I use rs.initiate(
... {
... _id: "cfgrs",
... configsvr: true,
... members: [
... { _id : 0, host : "127.0.0.1:40001" },
... { _id : 1, host : "127.0.0.1:40002" },
... { _id : 2, host : "127.0.0.1:40003" }
... ]
... }
... )
I just get No host described in new configuration 1 for replica set cfgrs maps to this node
is there anything else I haven't done??
sorry I just figured out why did I do wrong
@@grahftheseeker Glad that you managed to resolve it. Good job. Sorry I didn't get a chance to reply to your original comment. I thought I did. cheers.
Cool.
Hi,
If I tried deploy `Mongo Sharding` with 3 DigitalOcean Droplets and `2 Config, 2 Sharding(2 RS), 1 Router`.
Which one better for structure?
(1)
- DO-A
- cf21
- cfg2
- DO-B
- sh1
- sh2
- DO-C
- Apps
- Mongo Router
--------------
(2)
- DO-A
- cfg1
- sh1
- DO-B
- cfg2
- sh2
- DO-C
- Apps
- Mongo Router
Hi Theara, thanks for watching this video.
The ideal setup in production scenarios would be to run each mongo instance in its own server. For example, config servers with 3 replicaset would be run on 3 different servers. And a shard with 3 replicaset would be run on 3 different servers. There is no point in running two mongo instances in one server. If the server crashes, it would take down the 2 mongo instances. So one mongo instance per server.
But in your case if you are doing it for learning pupose, you can just put all the instances in one droplet or split between two droplets.
Both your option 1 and 2 would work just fine.
Cheers.
@@justmeandopensource
Thanks very clear.
Cool.
what about using FQDN instead of statique IP ?
U have the database in mongos . But if there is already database present in mongod . Then how to do sharding.
Can we implement the sharding on two servers?? And how?
hello i tried i tried IP 27017 and localhost and all my actual IP addresses of my laptop 192.168 etc and nothing works to connect noithing Lisa
Please send more details about your problem. If you followed every step exactly as shown in this video, you would'nt have problem accessing the shared. You must have deviated from the steps somewhere.
hello sir, thank you, yes its possible i missed or made erros but anyway if you check your issues tab in the learn-mongodb repo on github i posted how i completed the process..thxz alot Lisa
@@pjmclenon Sure will check.
hello instead of mongo mongodb://192.168.1.81:40001 to connect to a mongo instance , only this work ed for me so far, docker exec -it cfgsvr1 mongo
is it the same effect? Lisa
Hi, thanks for watching. In a sharded cluster, you will have to connect only to the mongos router for any read/write operations.
@@justmeandopensource hello sir, and thank you for your vids and reply but i dont get your answer , well i mean i understand mongos is for read/write but i was not able to connect to mongos and you can check my posts in your github issues as i was only able to complete the process of sharding with the merge and configyuration from another lesson online thxz Lisa
@@pjmclenon The ip address in the connection string "mongo mongodb://192.168.1.81:40001", is my ip address. It will be different in your case.
@@justmeandopensource hello , yes i know but i tried all my IP addresses when i did ipconfig at the cmd prompt and it never worked , only when i put the cluster name it worked, i got that from another lesson online, which i dont understand usally localhost works as input for this..i dont know Lisa thaz alot
@@pjmclenon Hmm. Okay.
... with all of this up, how would you connect to it from Python ?
Great Content! My roadblock is trying to have the config servers run via the mongo config file at startup, Is there anyway to do this?
Actually I made some headway today finally made it run via a config file!
Hi I am new to your channel. I am facing a problem whether I should go for many to many relationships with momgodb. Should I make a collection for follow and following like a social media site
Hi Jivan, I am not entirely sure in what context you are asking this question. I won't be able to answer without the complete picture. Moreover, I am from ops background and don't rely on me on the app/db design implementations.
@@justmeandopensource sharding of db in single database instance and replicating it Vs replicating shards
When I give rs. initiate()
I get
No host described in new configuration 1 for replica set cfgrs maps to this node
Thanks in advance
Hi Chinmay, thanks for watching. You normally get this error when the hosts can't communicate with each other. I am not sure in which environment you are deploying these replica members. Whether on AWS, DIgital Ocean or other cloud providers or on-prem. But you need to make sure that each member (host) of the replicaset can communicate with each other. So if there is a firewall, just open all the ports between these hosts.
@@justmeandopensource I'm getting the same error on localhost. How can I open ports on localhost?
@@RishinderRana Hi, thanks for watching. Could you please post the commands you used to start the replicasets, initiate the replicaset and other useful error to pastebin.com and share the details. Thanks.
@@justmeandopensource Here's the link to the paste: pastebin.com/RHARJVKJ. I cloned your repository and made some changes to it, so it's quite similar.
rs.initiate doesn't work for me
How to backup data on Mongo Sharding?
From `Sharding IP or Config IP or Mongo Router IP`?
Could you example?
Hi Theara, thanks for watching this video. I am going to do few videos around backup and restore of mongodb shards. You will get a notification when I upload videos to this series if you have subscribed to my channel. Cheers.
@@justmeandopensource
Waiting you...
Thanks.
@@justmeandopensource
Excuse me, Could you share me any document to `Sharding Backup/Restore`?
Now I would like to do it.
Thanks
@@yuomtheara I will be doing a video on backup/restore in Mongo Sharded cluster. I will let you know when I release that video. Cheers.
How much `Server machine` (At least), If I tried to create 3 configs, 3 sharding (Each a shard has 3 member replica set)?
For example I tried to create:
- 3 Config Server
- 3 Sharding (Each a 3 member replica set)
-----------------------
My Structure with 3 Server on Digital Dropletes
- Droplet 1: cfgsvr1, shard1svr1, shard2svr1, shard3svr1
- Droplet 2: cfgsvr2, shard1svr2, shard2svr2, shard3svr2
- Droplet 3: cfgsvr3, shard1svr3, shard2svr3, shard3svr3
Please advise...
Hi Theara, I would have gone with the same structure as you have. Perfectly designed. Spreading the config servers among 3 droplets and spreading each member of each shard among 3 droplets. This is a perfect scenario.
If you had put all 3 config servers in a single droplet, that is single point of failure. Similarly if you had put all replicas of a shard in a single droplet, again single point of failure.
What you have is a good architecture.
Thanks.
Just me and Opensource
I will try it tonight
Just me and Opensource
But now I am not clear about sharing key.
I will follow your docs link again and again
All the best.
About choosing the shard key, I haven't paid much attention to it as I am doing basic stuff. But its a separate topic and you have to go through some documentations from MongoDB. Cheers.
... would be great if you were to redo this deployment onto a K8s (instead of docker) environment. ... maybe using k3d as a local lab environment where you can simulate a multi node cluster.
Can you please share me the Github link
Hi Praneeth, thanks for watching. The github link is in the video description if thats what you are after. Cheers.
hello i am trying to run your software exactly as written just i want to try on different actual machiens and so i am on a vbox on my 1st machine ubuntu18 and on vmare on my 2nd machine and so from 1st machine i tried to connect sudo mongo mongodb//(my ip address of 2nd machine in vmare which has bridged hosting and also bridged on 1st) but i get connection refused
i tried ssh from 1st machine in 2nd machine and it works so why i cant connect with your code? i am using virutal ubuntu machines on windows mchine so i can follow directly ok thank you Lisa
it seems i need to add the ip address in the yaml file , here is the commad syntax direct from mongo website but i find it confusing would you know how to actually enter the info not just sample?
from mongo website:
mongod --configsvr --replSet --dbpath --bind_ip localhost,
so would this be good?
mongod --configsvr --replSet repli1 --dbpath /data/db --bind_ip localhost,localhost
|192.168.88.1 --port 27017
thxz alot
or is bind_ip 0.0.0.0?
or maybe this is better?
mongod --configsvr --replSet repli1 --dbpath /data/db --bind_ip 0.0.0.0, 192.168.88.1 -port 27017
this works
mongod --configsvr --replSet mongors1conf --dbpath /data/db --bind_ip localhost,192.168.x.x --port 27017
i put x x as example for my 1st machine ip address
but the ip address only connects on the starting machine not the remote 2nd machine i still cant connect it says The requested address is not valid in its context. not sure why Lisa
hello i was actually running the sytnax on my win cmd line so i ran it now from Vbox linux cmd line and i have vbox on my 2nd machine and i ran this cmd syntax from 1st machine
mongod --configsvr --replSet mongors1conf --dbpath /data/db --bind_ip 0.0.0.0,192.168.x.x --port 27017
so i change bindIp to 0 so its open to all, but now i get addrss already in use error and i tried many dofferent Ip address...very complex not sure why if it has to do with ssh but i can ssh already i tried it works so i dont know what im doing in error also not sure if i have change host file and hostname file that would be really complex and alot of work not sure why thxz anyway..i am looking at vids that deploy shards directly on aws atlal mongo or cloud G or azure or diitgiot ocen or 1and 1 etc cloud providers since that is the ultimate prurpose to deploy on the web on physical servers for production evirmnet thank you Lisa
thankkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk youuuuuuuuuuuuuuuuuuuuuuuuu
Thats a very big thank you. Thanks for watching. Cheers.
first of all such a great video but what if I am using atlas mongo
Hi, thanks for watching. If you are using Atlas Mongo, then you have the Atlas console to configure all these with ease.
@@justmeandopensource thank You so much, may I get your linked in account? If you don't mind
@@Jackdisc567 No problem. Here it is. www.linkedin.com/in/venkatnagappan/
Hi @Just me and Opensource,
Mongodb strategy for Multi-Company Web App?
I tried to build POS System that will be running on cloud. Each user must belong to a Company. Each Company can only access it’s own data. Each user can access it’s own data and some data shared with other users of the same company. Imagine 100 companies (Only my countries) and 100 users per company , it could get very bad in performance and secutiry, if I use 1 Mongodb database for whole app.
I think I can define 100 dbs, lets say db_0001 , db_0002 , … with same name collections, so the app can be efficient and more secure. but It is difficult to manage.
OR we could use `Mongo Sharding`?
Please advise and share!
Hi Theara, Sharding is basically splitting your data across multiple mongodb instances. Mongodb is extremely scalable. That is one of its main selling point. SO you don't have to worry about your databases growing big. You can have a database for each of your company and you can have the same collection name as long as it is in its own database. It all depends on your architecture and design. No single solution. My videos are to provide some basic ideas and concepts to getting started with MongoDB and Sharding. You will have to design an appropriate solution for your needs.
Thanks.
@@justmeandopensource
So it mean that we could use only one database for all companies register.
Some time I think to use one database for on company.
but can't do, because don't understand how to use dynamic db connection on `Meteor, Mongo`.
@@justmeandopensource
We should buy the Mongo cloud or could use own deploy (Sharding)?
@@yuomtheara For production large scale deployments you can go with Mongo Cloud for easy adinistration and for support. Otherwise you can manage it on your own. Thanks.
@@yuomtheara I see.
could you please help me on command syncFrom().
How to connect `MONGO_OPLOG_URL` in Mongos Router?
I base on `Meteor` and use 2 connection witn Mongo
- MONGO_URL:
- MONGO_OPLOG_URL:
Hi Theara, I don't have any experience using Meteor. Sorry no idea about the question. You will have to dig the internet yourself. Cheers.
@@justmeandopensource
thanks
@@yuomtheara you are welcome
@@justmeandopensource
It mean that I would to connect to
`local` database name in Sharding
Example for Standalone DB
`MONGO_OPLOG_URL: 'mongodb://mongodb/local'`
@@justmeandopensource
Could We create more than one database name in Sharding (Multi DB)?
Your videos are the best. I have a question regarding authentication in a sharded environment, where do I have to setup the superuser? In the mongos, in the config or in the mongod? Also, if I have a collection in mongod and if I want a user just to read it, do I have to set it up in the mongod?
plz check your github repo i was able to start config servers connect , i was able to strat shrd1 cluster connect but i cant connect to mongos thxz Lisa...i posted issue
i was only able to complete the process of sharding with the merge and configyuration from another lesson online thxz Lisa
hello thank you for the vids , i am now trying to deploy this on 3 physical machines computers instead of 1 physical machine with 3 ports , do i replace the inputs for the ssh IP address of each physical machine computer?..also i would then want to deploy this online like i guess mongo atlas with a remote server like i guess aws or heroku..do you have a lesson for this vid or written?,,thxz alot sir Lisa
If you want to run the mongodb processes as docker containers on the three physical machines, update the docker compose accordingly to include the ip address of physical machines and use the standard 27017 port.
hello ok thank you for configuration info for 3 or more actual machines , i will try it thanx alot
@@pjmclenon No worries.
[ Request ] Deploy Mongo Sharding with Authentication (Keyfile)!
Yeah. I am planning to do that as well. Struggling to get some time. Cheers.
This seems overkill... why do you need 3 replicas? a redundant replica should be enough
To anyone watching, be careful with this. Zero security implementation here.
Your email ID bro?
Hi Ram, many thanks for watching. I would be happy to offer my help/assistance in TH-cam comments. Cheers.
Great video, thanks!
Glad you liked it! Thanks for watching.