Skip to content

Conversation

JeremyPlease
Copy link
Contributor

Addresses issue mentioned in comments of PR #7

Example:

Then, Parse Server runs this code and determines that the new filename is hosted on Parse's legacy file server 😖

@flovilmart
Copy link
Contributor

flovilmart commented Jul 20, 2016

I'm going for vacations, I've added @acinader as collaborator on the repo, so you can review / merge the PR's without me :) Keep it up guys! You are awesome

@JeremyPlease
Copy link
Contributor Author

Thanks @flovilmart! Have a nice vacation 🌞

@acinader I know you're off the rest of today, so feel free to review/merge this PR whenever you have a moment.

@acinader
Copy link
Member

I'm getting ready to run it.

my one bit of feedback would be to make the newPrefix have some definite pattern to it, in case we need to pick them out with a regex to re-process if we discover a problem a few weeks down the road?

@JeremyPlease
Copy link
Contributor Author

@acinader Great idea! Check out the latest commit on this PR and let me know what you think.

If it's all good, go ahead and click the "merge pull request" button.

@codecov-io
Copy link

codecov-io commented Jul 21, 2016

Current coverage is 16.87% (diff: 14.28%)

No coverage report found for master at 5ea04ec.

Powered by Codecov. Last update 5ea04ec...a534c41

@acinader
Copy link
Member

it looks good. figured i would test it first. should just be an hour or two.

@acinader acinader self-assigned this Jul 21, 2016
@natanrolnik
Copy link

I was thinking about it in the last days: keeping the tfss- is also an option, for people that want to disable fileKey in Parse Server (check this PR and this condition).

This way, both Parse Server and hosted Parse will give a URL that works: the first, using Parse's S3, and the latter using your own S3.

@acinader @JeremyPlease don't you think that we could add the "File Renaming" as an option also? Meaning, if the user wants, he can disable it.
@flovilmart enjoy your vacation!

@acinader
Copy link
Member

acinader commented Jul 21, 2016

duh. I like it waaaaay better and I suggest just remove file renaming entirely, even as an option. I can't really imagine the use case and then no data changes.

migration becomes: run the script. verify it with a non prod parse-server. remove file key. if something goes south, just put key back.

i'm currently in the final minutes of restoring a db to test against, but will now wait for @JeremyPlease to weigh in. If he concurs, I'll just wait to test against your idea.

@acinader
Copy link
Member

one other nit would be to add to the readme that it only works on ~1,000 classes?

@natanrolnik
Copy link

Exactly! I agree, and that is exactly the same way I believe it should be.
But still, people might choose different paths...

@acinader
Copy link
Member

@natanrolnik can you humor me and try and think of a use case where someone would want to rename? If we can't think of a potential use case, i'd suggest that changing data is dangerous enough to leave the option out unless there's an reason we can think of to include. Another advantage is to not have one more file naming scheme to worry about in the future....

@JeremyPlease
Copy link
Contributor Author

@natanrolnik Nice find! I missed that PR/feature in Parse Server.

@acinader I mostly agree. However, I think renaming should still be an option. Mainly so that clients using Parse Server can still see files uploaded by clients using api.parse.com.

Example:

  1. Migrate all files from parse.com to Parse Server with file renaming.
  2. Old client using api.parse.com uploads a new file.
  3. If there's no config.fileKey defined in Parse Server, then the file uploaded from the old client will not have the correct files.parse.com url.

@JeremyPlease
Copy link
Contributor Author

JeremyPlease commented Jul 21, 2016

it only works on ~1,000 classes

@acinader What do you mean? Is it even possible to have 1,000 classes in Parse or did you not mean "classes"?

@acinader
Copy link
Member

re: 1,000 classes: I did mean classes. there's a limit of 1,000 on the query to schema, so its a known limitation. clearly not a big deal in any event.

re: file renaming. yup, good one. and i buy it. goes right to the heart of the one remaining problem with the parse migration: inability to support parse.com and parse-server simultaneously, which is giving me such heartburn :). but other uses may have different use cases where it is fine to have both new and old, so i def buy leaving it in as an option. The readme is going to need some explanation of the scenarios? which i think would be really helpful to users like me who are trying to figure out what is going on ;)

@acinader
Copy link
Member

i can test both today....

@natanrolnik
Copy link

natanrolnik commented Jul 21, 2016

I agree @acinader . And it's such a shame that we can define a Mongo URI in the Parse.com dashboard, but we can't define a S3 bucket 😞

@acinader
Copy link
Member

Right? ;)

@acinader
Copy link
Member

acinader commented Jul 21, 2016

though it'd have to be bucket, prefix, two keys, and then what about google....i get it. though the transition to parse-server would really be seamless to end users and product managers if it weren't for that one thing. /rant

@natanrolnik
Copy link

Well, if not an S3 bucket, then a base URL.

@acinader
Copy link
Member

@JeremyPlease fyi, i think i'm waiting on you to weigh in and/or add a commit to start testing. lmk if that's not right. no rush, i got plenty to do here.....

@acinader
Copy link
Member

i'm running test now.

@JeremyPlease
Copy link
Contributor Author

Hey all. (sorry for delayed response)

It seems like the most flexible solution would be to have a setting to enable/disable file renaming. Is that what you think too, @acinader?

The tough part with all of this is going to be providing a good guide/documentation with the tradeoffs of each setup.

@acinader
Copy link
Member

Hi @JeremyPlease -

yes, I'm pretty sure that that is the right option, and I agree that documenting it is tough as I'm having a hard time wrapping my pea brain around it. I'm running this pr now in any event and I'll report back once i've tested in an hour or so.

@acinader
Copy link
Member

looks good. as soon as i am done with the rename options that is running now, i'll restore my db and run the no rename options.

@JeremyPlease
Copy link
Contributor Author

Thanks @acinader.

I'm going to open a separate issue to discuss the guide/documentation/options. Will link here after I gather my thoughts.

@natanrolnik
Copy link

@JeremyPlease I was talking right now to @acinader regarding adding the "no rename" option, but you were faster! Thanks!

@JeremyPlease
Copy link
Contributor Author

@acinader @natanrolnik Could use your input on issue #10. Thanks!

@acinader acinader merged commit af66abe into parse-server-modules:master Jul 26, 2016
@acinader
Copy link
Member

no rename worked too. nice and thanks @JeremyPlease

@Brownmonster
Copy link

re: 1,000 classes: I did mean classes. there's a limit of 1,000 on the query to schema, so its a known limitation. clearly not a big deal in any event.

It needs to run multiple queries using the "skip" query command somehow otherwise it only returns the first 1000 rows worth of data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants