Best way to create email database for multiple users - c#

So here's what I'm trying to do.
I'm building an app using c# and MySQL as it's database. The database should basically be able to store inbox, sent mail, drafts, spam and trash typically.
Now here's the issue. This app is supposed to support multiple users. Meaning each user is supposed to see their own email's. Typically this would suggest that I must create a new schema for every new user, anme it accordingly and create tables inside it for inbox, sent, drafts etc.
Yes, it would be possible I suppose but assuming I may have a thousand user's... That's gonna make database management tedious among other issues that may arise.
Question here is would there be a more organised way / method of doing this? Preferably one that would make management or coding for it easier.
Appologies to be so broad. This is for a school project.

This app is supposed to support multiple users.
That basically means you need a table Users and every table supporting multiple users needs a column where you store the Users Primary Key. That way you can have a single table and have the data of multiple users in it.

Related

How to Retrieve All Active Inventories from All tenants and companies to one custom screen selector in Acumatica?

How to Retrieve All Active Inventories from All tenants and companies to one custom screen selector in Acumatica??
In ISV Solution I am trying this. How to approach this scenario
Disclaimer: What you are asking appears to venture into a use case that is contrary to a foundational design element of Acumatica ERP - isolation of tenants within a single database. While I have a similar use case in mind in which I need to do the same, use of any of these suggestions should be weighed seriously against your business requirements and operating constraints.
After discussion with some Acumatica Developer MVP's and Acumatica staff, there is no SUPPORTED method for doing this directly with tables already containing a CompanyID field. However, here are a few possible ways to achieve your desired results.
Create alternate SQL Tables / Acumatica DAC's without CompanyID and CompanyMask so that the data can be shared. This will require keeping the supplemental table data in sync.
UNSUPPORTED (This will fail an ISV Certification) - Create a SQL view that excludes CompanyID and CompanyMask and an Acumatica DAC for that view. This will allow visibility to the data, regardless of tenant, without having to create or maintain duplicate data. Again, I was advised strongly against this approach in the same statement of it being possible.
Use an alternative tool to access the data in the SQL database if you have direct access to the database. This tool would have to access the database in a way completely independently of PXData so that all database queries do not automatically receive the "CompanyID = X" in the where clause.
It was mentioned that you might do something with impersonating other users, but I don't have any experience with that. I'm not sure if it would allow cross-tenant data access, but I don't believe it would allow viewing more than 1 tenant even if it does let you view another tenant at all.
My understanding is that the first option is the preferred method to stay within Acumatica in a supported way. The third option could be valid if you already use other analytics tools like Cognos.

Can a table be added to a replication Db which isn't part of the original Db?

I am trying to build a WinForms app that allows the user to fill out a form for our company while keeping it clean and standardized. As part of this project, I have created a replication from our production Db with only the tables for clients and client contacts. I need those tables available to the App so it can pull current client information for this form. I wanted to add another table to the replication that is not from the original Db that will take all the information added for the form. I guess I don't need it, but I was wondering if it was possible and, if so, will it break anything.
I can already hear some of you guys reading this saying, why don't you just add another table to the production Db. Well, I thought of that but, the App that is bound by that Db is very strict and runs a check every time the app is launched to make sure the Db hasn't been corrupted. If it finds a new table has been added, I'm sure it wouldn't work. Also, I hear some of you shouting at your monitors, "Why do you want this table as part of the Replication, Why not just house it on a different Db that won't affect your precious app?" And to those people I would say, I just thought of that. But, I am trying to make something lightweight that can be put on a lot of computers without much over head or back end. Thank you in advance for considering this problem.

Have Users Interact with MS Access Queries instead of Tables

I am working on a project where I need to create a database to track the status of units throughout the production process. My current blockade involves getting the users to interact with a DataGridView that is supplied from a Microsoft Access Query instead of a Microsoft Access Table.
What I want to do is create a query in Microsoft Access and have it link to the DataGridView so end users can interact with a query instead of the actual tables, while populating all parent tables.
I am not sure if what I am attempting to do is possible or advised. This is the first time I have built a database in the professional world and want to make sure I am doing things properly. I have also never built a C# application for business use and have very limited experience with the language itself.
I have tried creating the Query in Access and linking it to the application in the same way you would add a table from a data source. That would allow me to view the data in the query...but it would display as a read-only and not allow for any data to be altered (the query builder in the TableAdapter Query Configuration Wizard indicated it was a read-only) . I have tried adding all related table adapters to the TableAdapterManager and it still didn't help.
I apologize if this question sounds disjointed as I am trying to overcome one obstacle at a time and do not want to overload one question with multiple issues. I can supply my ERD if it will make things easier and I have it normalized to at least 2NF.

Best way to store remote database locally for offline usage (without running mysql server locally)?

Good morning fellow friends of paleness.
Please help me find a good approach to solve the following problem:
What am I trying to do?
I would like to create a c# software that does the following two things:
The first part is a database where the user can store contact information. Each set of data consists of around 10 fields, not more than a couple of hundred contacts will be stored, and less than twenty users will have access to the database.
Secondly the user shall be able to select a subset of the data by applying filters. He then should be able to send personalized emails to the contacts in these subsets.
What are the constraints?
I would like to store the contact data mainly on a remote server that has mysql capability
However, when a user is offline, I want him to still be able to access the data, so a way to store the data locally is needed. Selecting subsets and saving email jobs for later execution shall be possible in offline mode
I do not want the user need to install or start any server locally when he uses the program
When the user goes online the local and the remote data will be synchronized
What is the problem?
The solution I came up with was to store the data locally either in an XML file or embed a database like sqlite in the program. But XML will not be a good choice for the "selecting a subset" feature and both approaches will need conversion to mysql I figured. I know the amount of data is not that big, so maybe either approach is fine. But maybe someone has a better idea altogether?
It would be great to hear your thoughts on how to store the data locally.
Cheers, Essi

emails sent three times asp.net website

I am working on a e-commerce website and there is an issue which we are trying to solve.
After customer completed order she is receiving three emails (all of them same) instead of one.
The website is running on three servers and we think that's the problem because using only one server brings one email delivered to the customer.
I would like to know what we should do so the user will receive only one email instead of three and we will still run the website on three servers.
Thanks in advance, Laziale
You cannot count on locking hints in the database for this. A hint is just a hint; there's no guarantee that the locking will happen as you expect (assuming this is SQL Server). In general, a relational database is just that, a database. A table is not a queuing mechanism and you will always have problems if you try to use it that way.
Nonetheless, in order to implement a different solution, we have to determine if a single record is being added to the "queue" or if three records are being added. If it is the first, and only a single record is added but three emails are sent out then the solution is simple. Instead of using a database table as your queue, use Microsoft Message Queues (MSMQ) instead. They are part of Windows Server and have been since at least 2003, maybe even all the way back to 2000. They will provide you with an actual queue specifically designed for what you're trying to accomplish.
If there are three actual records being added to the "queue" table in the database that means there is a code problem. Even with three Web servers in the load balancer, the fact remains that a single order submission only happens on one of those servers. The business logic that places the email notification in the queue could not come from more than one server because the request only originates from one server.
I would check the table first and determine if there are multiple records being added. If not, change the implementation to use MSMQ. If so, check your code to see why more than one record is being added in the request.

Categories